1 # RUN: llvm-mc %s -triple=mips-unknown-linux -show-encoding -mcpu=mips32r2 | \
2 # RUN: FileCheck %s --check-prefix=CHECK-NOTRAP
3 # RUN: llvm-mc %s -triple=mips-unknown-linux -show-encoding -mcpu=mips32r2 \
4 # RUN: -mattr=+use-tcc-in-div | FileCheck %s --check-prefix=CHECK-TRAP
7 # CHECK-NOTRAP: bnez $11, $tmp0 # encoding: [0x15,0x60,A,A]
8 # CHECK-NOTRAP: # fixup A - offset: 0, value: ($tmp0)-4, kind: fixup_Mips_PC16
9 # CHECK-NOTRAP: div $zero, $25, $11 # encoding: [0x03,0x2b,0x00,0x1a]
10 # CHECK-NOTRAP: break 7 # encoding: [0x00,0x07,0x00,0x0d]
11 # CHECK-NOTRAP: $tmp0:
12 # CHECK-NOTRAP: addiu $1, $zero, -1 # encoding: [0x24,0x01,0xff,0xff]
13 # CHECK-NOTRAP: bne $11, $1, $tmp1 # encoding: [0x15,0x61,A,A]
14 # CHECK-NOTRAP: # fixup A - offset: 0, value: ($tmp1)-4, kind: fixup_Mips_PC16
15 # CHECK-NOTRAP: lui $1, 32768 # encoding: [0x3c,0x01,0x80,0x00]
16 # CHECK-NOTRAP: bne $25, $1, $tmp1 # encoding: [0x17,0x21,A,A]
17 # CHECK-NOTRAP: # fixup A - offset: 0, value: ($tmp1)-4, kind: fixup_Mips_PC16
18 # CHECK-NOTRAP: nop # encoding: [0x00,0x00,0x00,0x00]
19 # CHECK-NOTRAP: break 6 # encoding: [0x00,0x06,0x00,0x0d]
20 # CHECK-NOTRAP: $tmp1:
21 # CHECK-NOTRAP: mflo $25 # encoding: [0x00,0x00,0xc8,0x12]
22 # CHECK-TRAP: teq $11, $zero, 7 # encoding: [0x01,0x60,0x01,0xf4]
23 # CHECK-TRAP: div $zero, $25, $11 # encoding: [0x03,0x2b,0x00,0x1a]
24 # CHECK-TRAP: addiu $1, $zero, -1 # encoding: [0x24,0x01,0xff,0xff]
25 # CHECK-TRAP: bne $11, $1, $tmp0 # encoding: [0x15,0x61,A,A]
26 # CHECK-TRAP: # fixup A - offset: 0, value: ($tmp0)-4, kind: fixup_Mips_PC16
27 # CHECK-TRAP: lui $1, 32768 # encoding: [0x3c,0x01,0x80,0x00]
28 # CHECK-TRAP: teq $25, $1, 6 # encoding: [0x03,0x21,0x01,0xb4]
30 # CHECK-TRAP: mflo $25 # encoding: [0x00,0x00,0xc8,0x12]
33 # CHECK-NOTRAP: bnez $12, $tmp2 # encoding: [0x15,0x80,A,A]
34 # CHECK-NOTRAP: # fixup A - offset: 0, value: ($tmp2)-4, kind: fixup_Mips_PC16
35 # CHECK-NOTRAP: div $zero, $24, $12 # encoding: [0x03,0x0c,0x00,0x1a]
36 # CHECK-NOTRAP: break 7 # encoding: [0x00,0x07,0x00,0x0d]
37 # CHECK-NOTRAP: $tmp2:
38 # CHECK-NOTRAP: addiu $1, $zero, -1 # encoding: [0x24,0x01,0xff,0xff]
39 # CHECK-NOTRAP: bne $12, $1, $tmp3 # encoding: [0x15,0x81,A,A]
40 # CHECK-NOTRAP: # fixup A - offset: 0, value: ($tmp3)-4, kind: fixup_Mips_PC16
41 # CHECK-NOTRAP: lui $1, 32768 # encoding: [0x3c,0x01,0x80,0x00]
42 # CHECK-NOTRAP: bne $24, $1, $tmp3 # encoding: [0x17,0x01,A,A]
43 # CHECK-NOTRAP: # fixup A - offset: 0, value: ($tmp3)-4, kind: fixup_Mips_PC16
44 # CHECK-NOTRAP: nop # encoding: [0x00,0x00,0x00,0x00]
45 # CHECK-NOTRAP: break 6 # encoding: [0x00,0x06,0x00,0x0d]
46 # CHECK-NOTRAP: $tmp3:
47 # CHECK-NOTRAP: mflo $24 # encoding: [0x00,0x00,0xc0,0x12]
48 # CHECK-TRAP: teq $12, $zero, 7 # encoding: [0x01,0x80,0x01,0xf4]
49 # CHECK-TRAP: div $zero, $24, $12 # encoding: [0x03,0x0c,0x00,0x1a]
50 # CHECK-TRAP: addiu $1, $zero, -1 # encoding: [0x24,0x01,0xff,0xff]
51 # CHECK-TRAP: bne $12, $1, $tmp1 # encoding: [0x15,0x81,A,A]
52 # CHECK-TRAP: # fixup A - offset: 0, value: ($tmp1)-4, kind: fixup_Mips_PC16
53 # CHECK-TRAP: lui $1, 32768 # encoding: [0x3c,0x01,0x80,0x00]
54 # CHECK-TRAP: teq $24, $1, 6 # encoding: [0x03,0x01,0x01,0xb4]
56 # CHECK-TRAP: mflo $24 # encoding: [0x00,0x00,0xc0,0x12]
59 # CHECK-NOTRAP: break 7 # encoding: [0x00,0x07,0x00,0x0d]
60 # CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0x00,0x00,0x01,0xf4]
63 # CHECK-NOTRAP: div $zero, $zero, $9 # encoding: [0x00,0x09,0x00,0x1a]
64 # CHECK-TRAP: div $zero, $zero, $9 # encoding: [0x00,0x09,0x00,0x1a]
67 # CHECK-NOTRAP: div $zero, $zero, $zero # encoding: [0x00,0x00,0x00,0x1a]
68 # CHECK-TRAP: div $zero, $zero, $zero # encoding: [0x00,0x00,0x00,0x1a]
71 # CHECK-NOTRAP: break 7 # encoding: [0x00,0x07,0x00,0x0d]
72 # CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0x00,0x00,0x01,0xf4]
75 # CHECK-NOTRAP: break 7 # encoding: [0x00,0x07,0x00,0x0d]
76 # CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0x00,0x00,0x01,0xf4]
79 # CHECK-NOTRAP: move $4, $4 # encoding: [0x00,0x80,0x20,0x25]
80 # CHECK-TRAP: move $4, $4 # encoding: [0x00,0x80,0x20,0x25]
83 # CHECK-NOTRAP: neg $4, $4 # encoding: [0x00,0x04,0x20,0x22]
84 # CHECK-TRAP: neg $4, $4 # encoding: [0x00,0x04,0x20,0x22]
87 # CHECK-NOTRAP: addiu $1, $zero, 2 # encoding: [0x24,0x01,0x00,0x02]
88 # CHECK-NOTRAP: div $zero, $4, $1 # encoding: [0x00,0x81,0x00,0x1a]
89 # CHECK-NOTRAP: mflo $4 # encoding: [0x00,0x00,0x20,0x12]
90 # CHECK-TRAP: addiu $1, $zero, 2 # encoding: [0x24,0x01,0x00,0x02]
91 # CHECK-TRAP: div $zero, $4, $1 # encoding: [0x00,0x81,0x00,0x1a]
92 # CHECK-TRAP: mflo $4 # encoding: [0x00,0x00,0x20,0x12]
95 # CHECK-NOTRAP: ori $1, $zero, 32768 # encoding: [0x34,0x01,0x80,0x00]
96 # CHECK-NOTRAP: div $zero, $4, $1 # encoding: [0x00,0x81,0x00,0x1a]
97 # CHECK-NOTRAP: mflo $4 # encoding: [0x00,0x00,0x20,0x12]
98 # CHECK-TRAP: ori $1, $zero, 32768 # encoding: [0x34,0x01,0x80,0x00]
99 # CHECK-TRAP: div $zero, $4, $1 # encoding: [0x00,0x81,0x00,0x1a]
100 # CHECK-TRAP: mflo $4 # encoding: [0x00,0x00,0x20,0x12]
103 # CHECK-NOTRAP: addiu $1, $zero, -32768 # encoding: [0x24,0x01,0x80,0x00]
104 # CHECK-NOTRAP: div $zero, $4, $1 # encoding: [0x00,0x81,0x00,0x1a]
105 # CHECK-NOTRAP: mflo $4 # encoding: [0x00,0x00,0x20,0x12]
106 # CHECK-TRAP: addiu $1, $zero, -32768 # encoding: [0x24,0x01,0x80,0x00]
107 # CHECK-TRAP: div $zero, $4, $1 # encoding: [0x00,0x81,0x00,0x1a]
108 # CHECK-TRAP: mflo $4 # encoding: [0x00,0x00,0x20,0x12]
111 # CHECK-NOTRAP: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01]
112 # CHECK-NOTRAP: div $zero, $4, $1 # encoding: [0x00,0x81,0x00,0x1a]
113 # CHECK-NOTRAP: mflo $4 # encoding: [0x00,0x00,0x20,0x12]
114 # CHECK-TRAP: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01]
115 # CHECK-TRAP: div $zero, $4, $1 # encoding: [0x00,0x81,0x00,0x1a]
116 # CHECK-TRAP: mflo $4 # encoding: [0x00,0x00,0x20,0x12]
119 # CHECK-NOTRAP: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01]
120 # CHECK-NOTRAP: ori $1, $1, 42405 # encoding: [0x34,0x21,0xa5,0xa5]
121 # CHECK-NOTRAP: div $zero, $4, $1 # encoding: [0x00,0x81,0x00,0x1a]
122 # CHECK-NOTRAP: mflo $4 # encoding: [0x00,0x00,0x20,0x12]
123 # CHECK-TRAP: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01]
124 # CHECK-TRAP: ori $1, $1, 42405 # encoding: [0x34,0x21,0xa5,0xa5]
125 # CHECK-TRAP: div $zero, $4, $1 # encoding: [0x00,0x81,0x00,0x1a]
126 # CHECK-TRAP: mflo $4 # encoding: [0x00,0x00,0x20,0x12]
129 # CHECK-NOTRAP: bnez $6, $tmp4 # encoding: [0x14,0xc0,A,A]
130 # CHECK-NOTRAP: # fixup A - offset: 0, value: ($tmp4)-4, kind: fixup_Mips_PC16
131 # CHECK-NOTRAP: div $zero, $5, $6 # encoding: [0x00,0xa6,0x00,0x1a]
132 # CHECK-NOTRAP: break 7 # encoding: [0x00,0x07,0x00,0x0d]
133 # CHECK-NOTRAP: $tmp4:
134 # CHECK-NOTRAP: addiu $1, $zero, -1 # encoding: [0x24,0x01,0xff,0xff]
135 # CHECK-NOTRAP: bne $6, $1, $tmp5 # encoding: [0x14,0xc1,A,A]
136 # CHECK-NOTRAP: # fixup A - offset: 0, value: ($tmp5)-4, kind: fixup_Mips_PC16
137 # CHECK-NOTRAP: lui $1, 32768 # encoding: [0x3c,0x01,0x80,0x00]
138 # CHECK-NOTRAP: bne $5, $1, $tmp5 # encoding: [0x14,0xa1,A,A]
139 # CHECK-NOTRAP: # fixup A - offset: 0, value: ($tmp5)-4, kind: fixup_Mips_PC16
140 # CHECK-NOTRAP: nop # encoding: [0x00,0x00,0x00,0x00]
141 # CHECK-NOTRAP: break 6 # encoding: [0x00,0x06,0x00,0x0d]
142 # CHECK-NOTRAP: $tmp5:
143 # CHECK-NOTRAP: mflo $4 # encoding: [0x00,0x00,0x20,0x12]
144 # CHECK-TRAP: teq $6, $zero, 7 # encoding: [0x00,0xc0,0x01,0xf4]
145 # CHECK-TRAP: div $zero, $5, $6 # encoding: [0x00,0xa6,0x00,0x1a]
146 # CHECK-TRAP: addiu $1, $zero, -1 # encoding: [0x24,0x01,0xff,0xff]
147 # CHECK-TRAP: bne $6, $1, $tmp2 # encoding: [0x14,0xc1,A,A]
148 # CHECK-TRAP: # fixup A - offset: 0, value: ($tmp2)-4, kind: fixup_Mips_PC16
149 # CHECK-TRAP: lui $1, 32768 # encoding: [0x3c,0x01,0x80,0x00]
150 # CHECK-TRAP: teq $5, $1, 6 # encoding: [0x00,0xa1,0x01,0xb4]
152 # CHECK-TRAP: mflo $4 # encoding: [0x00,0x00,0x20,0x12]
155 # CHECK-NOTRAP: break 7 # encoding: [0x00,0x07,0x00,0x0d]
156 # CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0x00,0x00,0x01,0xf4]
159 # CHECK-NOTRAP: break 7 # encoding: [0x00,0x07,0x00,0x0d]
160 # CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0x00,0x00,0x01,0xf4]
163 # CHECK-NOTRAP: div $zero, $4, $5 # encoding: [0x00,0x85,0x00,0x1a]
164 # CHECK-TRAP: div $zero, $4, $5 # encoding: [0x00,0x85,0x00,0x1a]
167 # CHECK-NOTRAP: break 7 # encoding: [0x00,0x07,0x00,0x0d]
168 # CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0x00,0x00,0x01,0xf4]
171 # CHECK-NOTRAP: break 7 # encoding: [0x00,0x07,0x00,0x0d]
172 # CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0x00,0x00,0x01,0xf4]
175 # CHECK-NOTRAP: move $4, $5 # encoding: [0x00,0xa0,0x20,0x25]
176 # CHECK-TRAP: move $4, $5 # encoding: [0x00,0xa0,0x20,0x25]
179 # CHECK-NOTRAP: neg $4, $5 # encoding: [0x00,0x05,0x20,0x22]
180 # CHECK-TRAP: neg $4, $5 # encoding: [0x00,0x05,0x20,0x22]
183 # CHECK-NOTRAP: addiu $1, $zero, 2 # encoding: [0x24,0x01,0x00,0x02]
184 # CHECK-NOTRAP: div $zero, $5, $1 # encoding: [0x00,0xa1,0x00,0x1a]
185 # CHECK-NOTRAP: mflo $4 # encoding: [0x00,0x00,0x20,0x12]
186 # CHECK-TRAP: addiu $1, $zero, 2 # encoding: [0x24,0x01,0x00,0x02]
187 # CHECK-TRAP: div $zero, $5, $1 # encoding: [0x00,0xa1,0x00,0x1a]
188 # CHECK-TRAP: mflo $4 # encoding: [0x00,0x00,0x20,0x12]
191 # CHECK-NOTRAP: ori $1, $zero, 32768 # encoding: [0x34,0x01,0x80,0x00]
192 # CHECK-NOTRAP: div $zero, $5, $1 # encoding: [0x00,0xa1,0x00,0x1a]
193 # CHECK-NOTRAP: mflo $4 # encoding: [0x00,0x00,0x20,0x12]
194 # CHECK-TRAP: ori $1, $zero, 32768 # encoding: [0x34,0x01,0x80,0x00]
195 # CHECK-TRAP: div $zero, $5, $1 # encoding: [0x00,0xa1,0x00,0x1a]
196 # CHECK-TRAP: mflo $4 # encoding: [0x00,0x00,0x20,0x12]
199 # CHECK-NOTRAP: addiu $1, $zero, -32768 # encoding: [0x24,0x01,0x80,0x00]
200 # CHECK-NOTRAP: div $zero, $5, $1 # encoding: [0x00,0xa1,0x00,0x1a]
201 # CHECK-NOTRAP: mflo $4 # encoding: [0x00,0x00,0x20,0x12]
202 # CHECK-TRAP: addiu $1, $zero, -32768 # encoding: [0x24,0x01,0x80,0x00]
203 # CHECK-TRAP: div $zero, $5, $1 # encoding: [0x00,0xa1,0x00,0x1a]
204 # CHECK-TRAP: mflo $4 # encoding: [0x00,0x00,0x20,0x12]
207 # CHECK-NOTRAP: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01]
208 # CHECK-NOTRAP: div $zero, $5, $1 # encoding: [0x00,0xa1,0x00,0x1a]
209 # CHECK-NOTRAP: mflo $4 # encoding: [0x00,0x00,0x20,0x12]
210 # CHECK-TRAP: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01]
211 # CHECK-TRAP: div $zero, $5, $1 # encoding: [0x00,0xa1,0x00,0x1a]
212 # CHECK-TRAP: mflo $4 # encoding: [0x00,0x00,0x20,0x12]
215 # CHECK-NOTRAP: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01]
216 # CHECK-NOTRAP: ori $1, $1, 42405 # encoding: [0x34,0x21,0xa5,0xa5]
217 # CHECK-NOTRAP: div $zero, $5, $1 # encoding: [0x00,0xa1,0x00,0x1a]
218 # CHECK-NOTRAP: mflo $4 # encoding: [0x00,0x00,0x20,0x12]
219 # CHECK-TRAP: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01]
220 # CHECK-TRAP: ori $1, $1, 42405 # encoding: [0x34,0x21,0xa5,0xa5]
221 # CHECK-TRAP: div $zero, $5, $1 # encoding: [0x00,0xa1,0x00,0x1a]
222 # CHECK-TRAP: mflo $4 # encoding: [0x00,0x00,0x20,0x12]