1 # RUN: llvm-mc %s -triple=mips64el-unknown-linux -show-encoding -mcpu=mips64 | \
2 # RUN: FileCheck %s --check-prefix=CHECK-NOTRAP
3 # RUN: llvm-mc %s -triple=mips64el-unknown-linux -show-encoding -mcpu=mips64 \
4 # RUN: -mattr=+use-tcc-in-div | FileCheck %s --check-prefix=CHECK-TRAP
7 # CHECK-NOTRAP: bne $5, $zero, .Ltmp0 # encoding: [A,A,0xa0,0x14]
8 # CHECK-NOTRAP: # fixup A - offset: 0, value: .Ltmp0-4, kind: fixup_Mips_PC16
9 # CHECK-NOTRAP: ddiv $zero, $4, $5 # encoding: [0x1e,0x00,0x85,0x00]
10 # CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00]
11 # CHECK-NOTRAP: .Ltmp0
12 # CHECK-NOTRAP: addiu $1, $zero, -1 # encoding: [0xff,0xff,0x01,0x24]
13 # CHECK-NOTRAP: bne $5, $1, .Ltmp1 # encoding: [A,A,0xa1,0x14]
14 # CHECK-NOTRAP: # fixup A - offset: 0, value: .Ltmp1-4, kind: fixup_Mips_PC16
15 # CHECK-NOTRAP: addiu $1, $zero, 1 # encoding: [0x01,0x00,0x01,0x24]
16 # CHECK-NOTRAP: dsll32 $1, $1, 31 # encoding: [0xfc,0x0f,0x01,0x00]
17 # CHECK-NOTRAP: bne $4, $1, .Ltmp1 # encoding: [A,A,0x81,0x14]
18 # CHECK-NOTRAP: # fixup A - offset: 0, value: .Ltmp1-4, kind: fixup_Mips_PC16
19 # CHECK-NOTRAP: nop # encoding: [0x00,0x00,0x00,0x00]
20 # CHECK-NOTRAP: break 6 # encoding: [0x0d,0x00,0x06,0x00]
21 # CHECK-NOTRAP: .Ltmp1
22 # CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
25 # CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00]
28 # CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00]
31 # CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00]
34 # CHECK-NOTRAP: or $4, $zero, $zero # encoding: [0x25,0x20,0x00,0x00]
37 # CHECK-NOTRAP: or $4, $zero, $zero # encoding: [0x25,0x20,0x00,0x00]
40 # CHECK-NOTRAP: addiu $1, $zero, 2 # encoding: [0x02,0x00,0x01,0x24]
41 # CHECK-NOTRAP: ddiv $zero, $4, $1 # encoding: [0x1e,0x00,0x81,0x00]
42 # CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
45 # CHECK-NOTRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
46 # CHECK-NOTRAP: ddiv $zero, $4, $1 # encoding: [0x1e,0x00,0x81,0x00]
47 # CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
50 # CHECK-NOTRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
51 # CHECK-NOTRAP: ori $1, $1, 42405 # encoding: [0xa5,0xa5,0x21,0x34]
52 # CHECK-NOTRAP: ddiv $zero, $4, $1 # encoding: [0x1e,0x00,0x81,0x00]
53 # CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
56 # CHECK-NOTRAP: ori $1, $zero, 32768 # encoding: [0x00,0x80,0x01,0x34]
57 # CHECK-NOTRAP: ddiv $zero, $4, $1 # encoding: [0x1e,0x00,0x81,0x00]
58 # CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
61 # CHECK-NOTRAP: addiu $1, $zero, -32768 # encoding: [0x00,0x80,0x01,0x24]
62 # CHECK-NOTRAP: ddiv $zero, $4, $1 # encoding: [0x1e,0x00,0x81,0x00]
63 # CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
66 # CHECK-NOTRAP: bne $6, $zero, .Ltmp2 # encoding: [A,A,0xc0,0x14]
67 # CHECK-NOTRAP: # fixup A - offset: 0, value: .Ltmp2-4, kind: fixup_Mips_PC16
68 # CHECK-NOTRAP: ddiv $zero, $5, $6 # encoding: [0x1e,0x00,0xa6,0x00]
69 # CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00]
70 # CHECK-NOTRAP: .Ltmp2:
71 # CHECK-NOTRAP: addiu $1, $zero, -1 # encoding: [0xff,0xff,0x01,0x24]
72 # CHECK-NOTRAP: bne $6, $1, .Ltmp3 # encoding: [A,A,0xc1,0x14]
73 # CHECK-NOTRAP: addiu $1, $zero, 1 # encoding: [0x01,0x00,0x01,0x24]
74 # CHECK-NOTRAP: dsll32 $1, $1, 31 # encoding: [0xfc,0x0f,0x01,0x00]
75 # CHECK-NOTRAP: bne $5, $1, .Ltmp3 # encoding: [A,A,0xa1,0x14]
76 # CHECK-NOTRAP: nop # encoding: [0x00,0x00,0x00,0x00]
77 # CHECK-NOTRAP: break 6 # encoding: [0x0d,0x00,0x06,0x00]
78 # CHECK-NOTRAP: .Ltmp3:
79 # CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
82 # CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00]
85 # CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00]
88 # CHECK-NOTRAP: ddiv $zero, $5, $4 # encoding: [0x1e,0x00,0xa4,0x00]
91 # CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00]
94 # CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00]
97 # CHECK-NOTRAP: ddiv $zero, $4, $5 # encoding: [0x1e,0x00,0x85,0x00]
100 # CHECK-NOTRAP: or $4, $zero, $zero # encoding: [0x25,0x20,0x00,0x00]
103 # CHECK-NOTRAP: or $4, $zero, $zero # encoding: [0x25,0x20,0x00,0x00]
106 # CHECK-NOTRAP: addiu $1, $zero, 2 # encoding: [0x02,0x00,0x01,0x24]
107 # CHECK-NOTRAP: ddiv $zero, $5, $1 # encoding: [0x1e,0x00,0xa1,0x00]
108 # CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
111 # CHECK-NOTRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
112 # CHECK-NOTRAP: ddiv $zero, $5, $1 # encoding: [0x1e,0x00,0xa1,0x00]
113 # CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
116 # CHECK-NOTRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
117 # CHECK-NOTRAP: ori $1, $1, 42405 # encoding: [0xa5,0xa5,0x21,0x34]
118 # CHECK-NOTRAP: ddiv $zero, $5, $1 # encoding: [0x1e,0x00,0xa1,0x00]
119 # CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
122 # CHECK-NOTRAP: ori $1, $zero, 32768 # encoding: [0x00,0x80,0x01,0x34]
123 # CHECK-NOTRAP: ddiv $zero, $5, $1 # encoding: [0x1e,0x00,0xa1,0x00]
124 # CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
127 # CHECK-NOTRAP: addiu $1, $zero, -32768 # encoding: [0x00,0x80,0x01,0x24]
128 # CHECK-NOTRAP: ddiv $zero, $5, $1 # encoding: [0x1e,0x00,0xa1,0x00]
129 # CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
132 # CHECK-TRAP: teq $5, $zero, 7 # encoding: [0xf4,0x01,0xa0,0x00]
133 # CHECK-TRAP: ddiv $zero, $4, $5 # encoding: [0x1e,0x00,0x85,0x00]
134 # CHECK-TRAP: addiu $1, $zero, -1 # encoding: [0xff,0xff,0x01,0x24]
135 # CHECK-TRAP: bne $5, $1, .Ltmp2 # encoding: [A,A,0xa1,0x14]
136 # CHECK-TRAP: # fixup A - offset: 0, value: .Ltmp2-4, kind: fixup_Mips_PC16
137 # CHECK-TRAP: addiu $1, $zero, 1 # encoding: [0x01,0x00,0x01,0x24]
138 # CHECK-TRAP: dsll32 $1, $1, 31 # encoding: [0xfc,0x0f,0x01,0x00]
139 # CHECK-TRAP: teq $4, $1, 6 # encoding: [0xb4,0x01,0x81,0x00]
141 # CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
144 # CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00]
147 # CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00]
150 # CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00]
153 # CHECK-TRAP: or $4, $zero, $zero # encoding: [0x25,0x20,0x00,0x00]
156 # CHECK-TRAP: or $4, $zero, $zero # encoding: [0x25,0x20,0x00,0x00]
159 # CHECK-TRAP: addiu $1, $zero, 2 # encoding: [0x02,0x00,0x01,0x24]
160 # CHECK-TRAP: ddiv $zero, $4, $1 # encoding: [0x1e,0x00,0x81,0x00]
161 # CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
164 # CHECK-TRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
165 # CHECK-TRAP: ddiv $zero, $4, $1 # encoding: [0x1e,0x00,0x81,0x00]
166 # CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
169 # CHECK-TRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
170 # CHECK-TRAP: ori $1, $1, 42405 # encoding: [0xa5,0xa5,0x21,0x34]
171 # CHECK-TRAP: ddiv $zero, $4, $1 # encoding: [0x1e,0x00,0x81,0x00]
172 # CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
175 # CHECK-TRAP: ori $1, $zero, 32768 # encoding: [0x00,0x80,0x01,0x34]
176 # CHECK-TRAP: ddiv $zero, $4, $1 # encoding: [0x1e,0x00,0x81,0x00]
177 # CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
180 # CHECK-TRAP: addiu $1, $zero, -32768 # encoding: [0x00,0x80,0x01,0x24]
181 # CHECK-TRAP: ddiv $zero, $4, $1 # encoding: [0x1e,0x00,0x81,0x00]
182 # CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
185 # CHECK-TRAP: teq $6, $zero, 7 # encoding: [0xf4,0x01,0xc0,0x00]
186 # CHECK-TRAP: ddiv $zero, $5, $6 # encoding: [0x1e,0x00,0xa6,0x00]
187 # CHECK-TRAP: addiu $1, $zero, -1 # encoding: [0xff,0xff,0x01,0x24]
188 # CHECK-TRAP: bne $6, $1, .Ltmp3 # encoding: [A,A,0xc1,0x14]
189 # CHECK-TRAP; # fixup A - offset: 0, value: .Ltmp3-4, kind: fixup_Mips_PC16
190 # CHECK-TRAP: addiu $1, $zero, 1 # encoding: [0x01,0x00,0x01,0x24]
191 # CHECK-TRAP: dsll32 $1, $1, 31 # encoding: [0xfc,0x0f,0x01,0x00]
192 # CHECK-TRAP: teq $5, $1, 6 # encoding: [0xb4,0x01,0xa1,0x00]
194 # CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
197 # CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00]
200 # CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00]
203 # CHECK-TRAP: ddiv $zero, $5, $4 # encoding: [0x1e,0x00,0xa4,0x00]
206 # CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00]
209 # CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00]
212 # CHECK-TRAP: ddiv $zero, $4, $5 # encoding: [0x1e,0x00,0x85,0x00]
215 # CHECK-TRAP: or $4, $zero, $zero # encoding: [0x25,0x20,0x00,0x00]
218 # CHECK-TRAP: or $4, $zero, $zero # encoding: [0x25,0x20,0x00,0x00]
221 # CHECK-TRAP: addiu $1, $zero, 2 # encoding: [0x02,0x00,0x01,0x24]
222 # CHECK-TRAP: ddiv $zero, $5, $1 # encoding: [0x1e,0x00,0xa1,0x00]
223 # CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
226 # CHECK-TRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
227 # CHECK-TRAP: ddiv $zero, $5, $1 # encoding: [0x1e,0x00,0xa1,0x00]
228 # CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
231 # CHECK-TRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
232 # CHECK-TRAP: ori $1, $1, 42405 # encoding: [0xa5,0xa5,0x21,0x34]
233 # CHECK-TRAP: ddiv $zero, $5, $1 # encoding: [0x1e,0x00,0xa1,0x00]
234 # CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
237 # CHECK-TRAP: ori $1, $zero, 32768 # encoding: [0x00,0x80,0x01,0x34]
238 # CHECK-TRAP: ddiv $zero, $5, $1 # encoding: [0x1e,0x00,0xa1,0x00]
239 # CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
242 # CHECK-TRAP: addiu $1, $zero, -32768 # encoding: [0x00,0x80,0x01,0x24]
243 # CHECK-TRAP: ddiv $zero, $5, $1 # encoding: [0x1e,0x00,0xa1,0x00]
244 # CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]