xref: /llvm-project/llvm/test/MC/Mips/micromips-control-instructions.s (revision 8086b9db3df2a3e63170739b6f8a418cbe5f05be)
1*8086b9dbSSimon Dardis# RUN: llvm-mc %s -triple=mipsel -show-encoding -mcpu=mips32r2 -mattr=micromips -show-inst \
28e918c3cSZoran Jovanovic# RUN: | FileCheck -check-prefix=CHECK-EL %s
3*8086b9dbSSimon Dardis# RUN: llvm-mc %s -triple=mips -show-encoding -mcpu=mips32r2 -mattr=micromips -show-inst \
48e918c3cSZoran Jovanovic# RUN: | FileCheck -check-prefix=CHECK-EB %s
58e918c3cSZoran Jovanovic# Check that the assembler can handle the documented syntax
68e918c3cSZoran Jovanovic# for control instructions.
78e918c3cSZoran Jovanovic#------------------------------------------------------------------------------
88e918c3cSZoran Jovanovic# microMIPS Control Instructions
98e918c3cSZoran Jovanovic#------------------------------------------------------------------------------
108e918c3cSZoran Jovanovic# Little endian
118e918c3cSZoran Jovanovic#------------------------------------------------------------------------------
12dc62fc4aSJozef Kolek# CHECK-EL:    sdbbp                      # encoding: [0x00,0x00,0x7c,0xdb]
13dc62fc4aSJozef Kolek# CHECK-EL:    sdbbp 34                   # encoding: [0x22,0x00,0x7c,0xdb]
1418148671SHrvoje Varga# CHECK-EL-NOT:    .set push
1518148671SHrvoje Varga# CHECK-EL-NOT:    .set mips32r2
1618148671SHrvoje Varga# CHECK-EL:    rdhwr $5, $29              # encoding: [0xbd,0x00,0x3c,0x6b]
1718148671SHrvoje Varga# CHECK-EL-NOT:    .set pop
18ab6d1cceSJozef Kolek# CHECK-EL:    cache 1, 8($5)             # encoding: [0x25,0x20,0x08,0x60]
19ab6d1cceSJozef Kolek# CHECK-EL:    pref 1, 8($5)              # encoding: [0x25,0x60,0x08,0x20]
20ab6d1cceSJozef Kolek# CHECK-EL:    ssnop                      # encoding: [0x00,0x00,0x00,0x08]
21ab6d1cceSJozef Kolek# CHECK-EL:    ehb                        # encoding: [0x00,0x00,0x00,0x18]
22ab6d1cceSJozef Kolek# CHECK-EL:    pause                      # encoding: [0x00,0x00,0x00,0x28]
238e918c3cSZoran Jovanovic# CHECK-EL:    break                      # encoding: [0x00,0x00,0x07,0x00]
24*8086b9dbSSimon Dardis# CHECK-EL-NEXT:                          # <MCInst #{{[0-9]+}} BREAK_MM
25ee20caafSTim Northover# CHECK-EL:    break 7                    # encoding: [0x07,0x00,0x07,0x00]
26*8086b9dbSSimon Dardis# CHECK-EL-NEXT:                          # <MCInst #{{[0-9]+}} BREAK_MM
278e918c3cSZoran Jovanovic# CHECK-EL:    break 7, 5                 # encoding: [0x07,0x00,0x47,0x01]
28*8086b9dbSSimon Dardis# CHECK-EL-NEXT:                          # <MCInst #{{[0-9]+}} BREAK_MM
297c6c36d9SZoran Jovanovic# CHECK-EL:    syscall                    # encoding: [0x00,0x00,0x7c,0x8b]
30*8086b9dbSSimon Dardis# CHECK-EL-NEXT:                          # <MCInst #{{[0-9]+}} SYSCALL_MM
317c6c36d9SZoran Jovanovic# CHECK-EL:    syscall 396                # encoding: [0x8c,0x01,0x7c,0x8b]
32*8086b9dbSSimon Dardis# CHECK-EL-NEXT:                          # <MCInst #{{[0-9]+}} SYSCALL_MM
338e918c3cSZoran Jovanovic# CHECK-EL:    eret                       # encoding: [0x00,0x00,0x7c,0xf3]
34*8086b9dbSSimon Dardis# CHECK-EL-NEXT:                          # <MCInst #{{[0-9]+}} ERET_MM
358e918c3cSZoran Jovanovic# CHECK-EL:    deret                      # encoding: [0x00,0x00,0x7c,0xe3]
36*8086b9dbSSimon Dardis# CHECK-EL-NEXT:                          # <MCInst #{{[0-9]+}} DERET_MM
378e918c3cSZoran Jovanovic# CHECK-EL:    di                         # encoding: [0x00,0x00,0x7c,0x47]
38*8086b9dbSSimon Dardis# CHECK-EL-NEXT:                          # <MCInst #{{[0-9]+}} DI_MM
398e918c3cSZoran Jovanovic# CHECK-EL:    di  $10                    # encoding: [0x0a,0x00,0x7c,0x47]
40*8086b9dbSSimon Dardis# CHECK-EL-NEXT:                          # <MCInst #{{[0-9]+}} DI_MM
418e918c3cSZoran Jovanovic# CHECK-EL:    ei                         # encoding: [0x00,0x00,0x7c,0x57]
42*8086b9dbSSimon Dardis# CHECK-EL-NEXT:                          # <MCInst #{{[0-9]+}} EI_MM
438e918c3cSZoran Jovanovic# CHECK-EL:    ei  $10                    # encoding: [0x0a,0x00,0x7c,0x57]
44*8086b9dbSSimon Dardis# CHECK-EL-NEXT:                          # <MCInst #{{[0-9]+}} EI_MM
458e918c3cSZoran Jovanovic# CHECK-EL:    wait                       # encoding: [0x00,0x00,0x7c,0x93]
46*8086b9dbSSimon Dardis# CHECK-EL-NEXT:                          # <MCInst #{{[0-9]+}} WAIT_MM
47a0f53289SZoran Jovanovic# CHECK-EL:    wait 17                    # encoding: [0x11,0x00,0x7c,0x93]
48*8086b9dbSSimon Dardis# CHECK-EL-NEXT:                          # <MCInst #{{[0-9]+}} WAIT_MM
494e7ac4adSZoran Jovanovic# CHECK-EL:    tlbp                       # encoding: [0x00,0x00,0x7c,0x03]
504e7ac4adSZoran Jovanovic# CHECK-EL:    tlbr                       # encoding: [0x00,0x00,0x7c,0x13]
514e7ac4adSZoran Jovanovic# CHECK-EL:    tlbwi                      # encoding: [0x00,0x00,0x7c,0x23]
524e7ac4adSZoran Jovanovic# CHECK-EL:    tlbwr                      # encoding: [0x00,0x00,0x7c,0x33]
536e6a2c9cSZoran Jovanovic# CHECK-EL:    prefx 1, $3($5)            # encoding: [0x65,0x54,0xa0,0x09]
548e918c3cSZoran Jovanovic#------------------------------------------------------------------------------
558e918c3cSZoran Jovanovic# Big endian
568e918c3cSZoran Jovanovic#------------------------------------------------------------------------------
57dc62fc4aSJozef Kolek# CHECK-EB:   sdbbp                       # encoding: [0x00,0x00,0xdb,0x7c]
58dc62fc4aSJozef Kolek# CHECK-EB:   sdbbp 34                    # encoding: [0x00,0x22,0xdb,0x7c]
5918148671SHrvoje Varga# CHECK-EB-NOT:    .set push
6018148671SHrvoje Varga# CHECK-EB-NOT:    .set mips32r2
6118148671SHrvoje Varga# CHECK-EB:   rdhwr $5, $29               # encoding: [0x00,0xbd,0x6b,0x3c]
6218148671SHrvoje Varga# CHECK-EB-NOT:    .set pop
63ab6d1cceSJozef Kolek# CHECK-EB:   cache 1, 8($5)              # encoding: [0x20,0x25,0x60,0x08]
64ab6d1cceSJozef Kolek# CHECK-EB:   pref 1, 8($5)               # encoding: [0x60,0x25,0x20,0x08]
65ab6d1cceSJozef Kolek# CHECK-EB:   ssnop                       # encoding: [0x00,0x00,0x08,0x00]
66ab6d1cceSJozef Kolek# CHECK-EB:   ehb                         # encoding: [0x00,0x00,0x18,0x00]
67ab6d1cceSJozef Kolek# CHECK-EB:   pause                       # encoding: [0x00,0x00,0x28,0x00]
688e918c3cSZoran Jovanovic# CHECK-EB:   break                       # encoding: [0x00,0x00,0x00,0x07]
69ee20caafSTim Northover# CHECK-EB:   break 7                     # encoding: [0x00,0x07,0x00,0x07]
708e918c3cSZoran Jovanovic# CHECK-EB:   break 7, 5                  # encoding: [0x00,0x07,0x01,0x47]
717c6c36d9SZoran Jovanovic# CHECK-EB:   syscall                     # encoding: [0x00,0x00,0x8b,0x7c]
727c6c36d9SZoran Jovanovic# CHECK-EB:   syscall 396                 # encoding: [0x01,0x8c,0x8b,0x7c]
738e918c3cSZoran Jovanovic# CHECK-EB:   eret                        # encoding: [0x00,0x00,0xf3,0x7c]
748e918c3cSZoran Jovanovic# CHECK-EB:   deret                       # encoding: [0x00,0x00,0xe3,0x7c]
758e918c3cSZoran Jovanovic# CHECK-EB:   di                          # encoding: [0x00,0x00,0x47,0x7c]
768e918c3cSZoran Jovanovic# CHECK-EB:   di                          # encoding: [0x00,0x00,0x47,0x7c]
778e918c3cSZoran Jovanovic# CHECK-EB:   di  $10                     # encoding: [0x00,0x0a,0x47,0x7c]
788e918c3cSZoran Jovanovic# CHECK-EB:   ei                          # encoding: [0x00,0x00,0x57,0x7c]
798e918c3cSZoran Jovanovic# CHECK-EB:   ei                          # encoding: [0x00,0x00,0x57,0x7c]
808e918c3cSZoran Jovanovic# CHECK-EB:   ei  $10                     # encoding: [0x00,0x0a,0x57,0x7c]
818e918c3cSZoran Jovanovic# CHECK-EB:   wait                        # encoding: [0x00,0x00,0x93,0x7c]
82a0f53289SZoran Jovanovic# CHECK-EB:   wait 17                     # encoding: [0x00,0x11,0x93,0x7c]
834e7ac4adSZoran Jovanovic# CHECK-EB:   tlbp                        # encoding: [0x00,0x00,0x03,0x7c]
844e7ac4adSZoran Jovanovic# CHECK-EB:   tlbr                        # encoding: [0x00,0x00,0x13,0x7c]
854e7ac4adSZoran Jovanovic# CHECK-EB:   tlbwi                       # encoding: [0x00,0x00,0x23,0x7c]
864e7ac4adSZoran Jovanovic# CHECK-EB:   tlbwr                       # encoding: [0x00,0x00,0x33,0x7c]
876e6a2c9cSZoran Jovanovic# CHECK-EB:   prefx 1, $3($5)             # encoding: [0x54,0x65,0x09,0xa0]
888e918c3cSZoran Jovanovic
89dc62fc4aSJozef Kolek    sdbbp
90dc62fc4aSJozef Kolek    sdbbp 34
91dc62fc4aSJozef Kolek    rdhwr $5, $29
92ab6d1cceSJozef Kolek    cache 1, 8($5)
93ab6d1cceSJozef Kolek    pref 1, 8($5)
94ab6d1cceSJozef Kolek    ssnop
95ab6d1cceSJozef Kolek    ehb
96ab6d1cceSJozef Kolek    pause
978e918c3cSZoran Jovanovic    break
988e918c3cSZoran Jovanovic    break 7
998e918c3cSZoran Jovanovic    break 7,5
1008e918c3cSZoran Jovanovic    syscall
1017c6c36d9SZoran Jovanovic    syscall 0x18c
1028e918c3cSZoran Jovanovic    eret
1038e918c3cSZoran Jovanovic    deret
1048e918c3cSZoran Jovanovic    di
1058e918c3cSZoran Jovanovic    di $0
1068e918c3cSZoran Jovanovic    di $10
1078e918c3cSZoran Jovanovic    ei
1088e918c3cSZoran Jovanovic    ei $0
1098e918c3cSZoran Jovanovic    ei $10
1108e918c3cSZoran Jovanovic    wait
111a0f53289SZoran Jovanovic    wait 17
1124e7ac4adSZoran Jovanovic    tlbp
1134e7ac4adSZoran Jovanovic    tlbr
1144e7ac4adSZoran Jovanovic    tlbwi
1154e7ac4adSZoran Jovanovic    tlbwr
1166e6a2c9cSZoran Jovanovic    prefx 1, $3($5)
117476ed8f2SSimon Dardis
118