1 # RUN: llvm-mc %s -triple=mipsel -show-encoding -mcpu=mips32r2 -mattr=micromips \ 2 # RUN: | FileCheck -check-prefix=CHECK-EL %s 3 # RUN: llvm-mc %s -triple=mips -show-encoding -mcpu=mips32r2 -mattr=micromips \ 4 # RUN: | FileCheck -check-prefix=CHECK-EB %s 5 # Check that the assembler can handle the documented syntax 6 # for control instructions. 7 #------------------------------------------------------------------------------ 8 # microMIPS Control Instructions 9 #------------------------------------------------------------------------------ 10 # Little endian 11 #------------------------------------------------------------------------------ 12 # CHECK-EL: sdbbp # encoding: [0x00,0x00,0x7c,0xdb] 13 # CHECK-EL: sdbbp 34 # encoding: [0x22,0x00,0x7c,0xdb] 14 # CHECK-EL-NOT: .set push 15 # CHECK-EL-NOT: .set mips32r2 16 # CHECK-EL: rdhwr $5, $29 # encoding: [0xbd,0x00,0x3c,0x6b] 17 # CHECK-EL-NOT: .set pop 18 # CHECK-EL: cache 1, 8($5) # encoding: [0x25,0x20,0x08,0x60] 19 # CHECK-EL: pref 1, 8($5) # encoding: [0x25,0x60,0x08,0x20] 20 # CHECK-EL: ssnop # encoding: [0x00,0x00,0x00,0x08] 21 # CHECK-EL: ehb # encoding: [0x00,0x00,0x00,0x18] 22 # CHECK-EL: pause # encoding: [0x00,0x00,0x00,0x28] 23 # CHECK-EL: break # encoding: [0x00,0x00,0x07,0x00] 24 # CHECK-EL: break 7 # encoding: [0x07,0x00,0x07,0x00] 25 # CHECK-EL: break 7, 5 # encoding: [0x07,0x00,0x47,0x01] 26 # CHECK-EL: syscall # encoding: [0x00,0x00,0x7c,0x8b] 27 # CHECK-EL: syscall 396 # encoding: [0x8c,0x01,0x7c,0x8b] 28 # CHECK-EL: eret # encoding: [0x00,0x00,0x7c,0xf3] 29 # CHECK-EL: deret # encoding: [0x00,0x00,0x7c,0xe3] 30 # CHECK-EL: di # encoding: [0x00,0x00,0x7c,0x47] 31 # CHECK-EL: di # encoding: [0x00,0x00,0x7c,0x47] 32 # CHECK-EL: di $10 # encoding: [0x0a,0x00,0x7c,0x47] 33 # CHECK-EL: ei # encoding: [0x00,0x00,0x7c,0x57] 34 # CHECK-EL: ei # encoding: [0x00,0x00,0x7c,0x57] 35 # CHECK-EL: ei $10 # encoding: [0x0a,0x00,0x7c,0x57] 36 # CHECK-EL: wait # encoding: [0x00,0x00,0x7c,0x93] 37 # CHECK-EL: wait 17 # encoding: [0x11,0x00,0x7c,0x93] 38 # CHECK-EL: tlbp # encoding: [0x00,0x00,0x7c,0x03] 39 # CHECK-EL: tlbr # encoding: [0x00,0x00,0x7c,0x13] 40 # CHECK-EL: tlbwi # encoding: [0x00,0x00,0x7c,0x23] 41 # CHECK-EL: tlbwr # encoding: [0x00,0x00,0x7c,0x33] 42 # CHECK-EL: prefe 1, 8($5) # encoding: [0x25,0x60,0x08,0xa4] 43 # CHECK-EL: cachee 1, 8($5) # encoding: [0x25,0x60,0x08,0xa6] 44 # CHECK-EL: prefx 1, $3($5) # encoding: [0x65,0x54,0xa0,0x09] 45 # CHECK-EL: swre $24, 5($3) # encoding: [0x03,0x63,0x05,0xa2] 46 # CHECK-EL: swle $24, 5($3) # encoding: [0x03,0x63,0x05,0xa0] 47 # CHECK-EL: lwre $24, 5($3) # encoding: [0x03,0x63,0x05,0x66] 48 # CHECK-EL: lwle $24, 2($4) # encoding: [0x04,0x63,0x02,0x64] 49 # CHECK-EL: lle $2, 8($4) # encoding: [0x44,0x60,0x08,0x6c] 50 # CHECK-EL: sce $2, 8($4) # encoding: [0x44,0x60,0x08,0xac] 51 #------------------------------------------------------------------------------ 52 # Big endian 53 #------------------------------------------------------------------------------ 54 # CHECK-EB: sdbbp # encoding: [0x00,0x00,0xdb,0x7c] 55 # CHECK-EB: sdbbp 34 # encoding: [0x00,0x22,0xdb,0x7c] 56 # CHECK-EB-NOT: .set push 57 # CHECK-EB-NOT: .set mips32r2 58 # CHECK-EB: rdhwr $5, $29 # encoding: [0x00,0xbd,0x6b,0x3c] 59 # CHECK-EB-NOT: .set pop 60 # CHECK-EB: cache 1, 8($5) # encoding: [0x20,0x25,0x60,0x08] 61 # CHECK-EB: pref 1, 8($5) # encoding: [0x60,0x25,0x20,0x08] 62 # CHECK-EB: ssnop # encoding: [0x00,0x00,0x08,0x00] 63 # CHECK-EB: ehb # encoding: [0x00,0x00,0x18,0x00] 64 # CHECK-EB: pause # encoding: [0x00,0x00,0x28,0x00] 65 # CHECK-EB: break # encoding: [0x00,0x00,0x00,0x07] 66 # CHECK-EB: break 7 # encoding: [0x00,0x07,0x00,0x07] 67 # CHECK-EB: break 7, 5 # encoding: [0x00,0x07,0x01,0x47] 68 # CHECK-EB: syscall # encoding: [0x00,0x00,0x8b,0x7c] 69 # CHECK-EB: syscall 396 # encoding: [0x01,0x8c,0x8b,0x7c] 70 # CHECK-EB: eret # encoding: [0x00,0x00,0xf3,0x7c] 71 # CHECK-EB: deret # encoding: [0x00,0x00,0xe3,0x7c] 72 # CHECK-EB: di # encoding: [0x00,0x00,0x47,0x7c] 73 # CHECK-EB: di # encoding: [0x00,0x00,0x47,0x7c] 74 # CHECK-EB: di $10 # encoding: [0x00,0x0a,0x47,0x7c] 75 # CHECK-EB: ei # encoding: [0x00,0x00,0x57,0x7c] 76 # CHECK-EB: ei # encoding: [0x00,0x00,0x57,0x7c] 77 # CHECK-EB: ei $10 # encoding: [0x00,0x0a,0x57,0x7c] 78 # CHECK-EB: wait # encoding: [0x00,0x00,0x93,0x7c] 79 # CHECK-EB: wait 17 # encoding: [0x00,0x11,0x93,0x7c] 80 # CHECK-EB: tlbp # encoding: [0x00,0x00,0x03,0x7c] 81 # CHECK-EB: tlbr # encoding: [0x00,0x00,0x13,0x7c] 82 # CHECK-EB: tlbwi # encoding: [0x00,0x00,0x23,0x7c] 83 # CHECK-EB: tlbwr # encoding: [0x00,0x00,0x33,0x7c] 84 # CHECK-EB: prefe 1, 8($5) # encoding: [0x60,0x25,0xa4,0x08] 85 # CHECK-EB: cachee 1, 8($5) # encoding: [0x60,0x25,0xa6,0x08] 86 # CHECK-EB: prefx 1, $3($5) # encoding: [0x54,0x65,0x09,0xa0] 87 # CHECK-EB: swre $24, 5($3) # encoding: [0x63,0x03,0xa2,0x05] 88 # CHECK-EB: swle $24, 5($3) # encoding: [0x63,0x03,0xa0,0x05] 89 # CHECK-EB: lwre $24, 5($3) # encoding: [0x63,0x03,0x66,0x05] 90 # CHECK-EB: lwle $24, 2($4) # encoding: [0x63,0x04,0x64,0x02] 91 # CHECK-EB: lle $2, 8($4) # encoding: [0x60,0x44,0x6c,0x08] 92 # CHECK-EB: sce $2, 8($4) # encoding: [0x60,0x44,0xac,0x08] 93 94 sdbbp 95 sdbbp 34 96 rdhwr $5, $29 97 cache 1, 8($5) 98 pref 1, 8($5) 99 ssnop 100 ehb 101 pause 102 break 103 break 7 104 break 7,5 105 syscall 106 syscall 0x18c 107 eret 108 deret 109 di 110 di $0 111 di $10 112 ei 113 ei $0 114 ei $10 115 wait 116 wait 17 117 tlbp 118 tlbr 119 tlbwi 120 tlbwr 121 prefe 1, 8($5) 122 cachee 1, 8($5) 123 prefx 1, $3($5) 124 swre $24, 5($3) 125 swle $24, 5($3) 126 lwre $24, 5($3) 127 lwle $24, 2($4) 128 lle $2, 8($4) 129 sce $2, 8($4) 130