[obj2yaml] - Fix a comment. NFC.
[llvm-complete.git] / test / MC / Mips / macro-rem.s
blob40812949664d6ee24d89a67b10022de04eb0996b
1 # RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips32 | \
2 # RUN: FileCheck %s --check-prefix=CHECK-NOTRAP
3 # RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips32 \
4 # RUN: -mattr=+use-tcc-in-div | FileCheck %s --check-prefix=CHECK-TRAP
6 rem $4,$5
7 # CHECK-NOTRAP: bnez $5, $tmp0 # encoding: [A,A,0xa0,0x14]
8 # CHECK-NOTRAP: # fixup A - offset: 0, value: ($tmp0)-4, kind: fixup_Mips_PC16
9 # CHECK-NOTRAP: div $zero, $4, $5 # encoding: [0x1a,0x00,0x85,0x00]
10 # CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00]
11 # CHECK-NOTRAP: $tmp0
12 # CHECK-NOTRAP: addiu $1, $zero, -1 # encoding: [0xff,0xff,0x01,0x24]
13 # CHECK-NOTRAP: bne $5, $1, $tmp1 # encoding: [A,A,0xa1,0x14]
14 # CHECK-NOTRAP: # fixup A - offset: 0, value: ($tmp1)-4, kind: fixup_Mips_PC16
15 # CHECK-NOTRAP: lui $1, 32768 # encoding: [0x00,0x80,0x01,0x3c]
16 # CHECK-NOTRAP: bne $4, $1, $tmp1 # encoding: [A,A,0x81,0x14]
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: [0x0d,0x00,0x06,0x00]
20 # CHECK-NOTRAP: $tmp1
21 # CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
23 # CHECK-TRAP: teq $5, $zero, 7 # encoding: [0xf4,0x01,0xa0,0x00]
24 # CHECK-TRAP: div $zero, $4, $5 # encoding: [0x1a,0x00,0x85,0x00]
25 # CHECK-TRAP: addiu $1, $zero, -1 # encoding: [0xff,0xff,0x01,0x24]
26 # CHECK-TRAP: bne $5, $1, $tmp0 # encoding: [A,A,0xa1,0x14]
27 # CHECK-TRAP: lui $1, 32768 # encoding: [0x00,0x80,0x01,0x3c]
28 # CHECK-TRAP: teq $4, $1, 6 # encoding: [0xb4,0x01,0x81,0x00]
29 # CHECK-TRAP: $tmp0
30 # CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
32 rem $4,$0
33 # CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00]
34 # CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00]
36 rem $4,0
37 # CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00]
38 # CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00]
40 rem $0,0
41 # CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00]
42 # CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00]
44 rem $4,1
45 # CHECK-NOTRAP: move $4, $zero # encoding: [0x25,0x20,0x00,0x00]
46 # CHECK-TRAP: move $4, $zero # encoding: [0x25,0x20,0x00,0x00]
48 rem $4,-1
49 # CHECK-NOTRAP: move $4, $zero # encoding: [0x25,0x20,0x00,0x00]
50 # CHECK-TRAP: move $4, $zero # encoding: [0x25,0x20,0x00,0x00]
52 rem $4,2
53 # CHECK-NOTRAP: addiu $1, $zero, 2 # encoding: [0x02,0x00,0x01,0x24]
54 # CHECK-NOTRAP: div $zero, $4, $1 # encoding: [0x1a,0x00,0x81,0x00]
55 # CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
56 # CHECK-TRAP: addiu $1, $zero, 2 # encoding: [0x02,0x00,0x01,0x24]
57 # CHECK-TRAP: div $zero, $4, $1 # encoding: [0x1a,0x00,0x81,0x00]
58 # CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
60 rem $4,0x8000
61 # CHECK-NOTRAP: ori $1, $zero, 32768 # encoding: [0x00,0x80,0x01,0x34]
62 # CHECK-NOTRAP: div $zero, $4, $1 # encoding: [0x1a,0x00,0x81,0x00]
63 # CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
64 # CHECK-TRAP: ori $1, $zero, 32768 # encoding: [0x00,0x80,0x01,0x34]
65 # CHECK-TRAP: div $zero, $4, $1 # encoding: [0x1a,0x00,0x81,0x00]
66 # CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
68 rem $4,-0x8000
69 # CHECK-NOTRAP: addiu $1, $zero, -32768 # encoding: [0x00,0x80,0x01,0x24]
70 # CHECK-NOTRAP: div $zero, $4, $1 # encoding: [0x1a,0x00,0x81,0x00]
71 # CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
72 # CHECK-TRAP: addiu $1, $zero, -32768 # encoding: [0x00,0x80,0x01,0x24]
73 # CHECK-TRAP: div $zero, $4, $1 # encoding: [0x1a,0x00,0x81,0x00]
74 # CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
76 rem $4,0x10000
77 # CHECK-NOTRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
78 # CHECK-NOTRAP: div $zero, $4, $1 # encoding: [0x1a,0x00,0x81,0x00]
79 # CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
80 # CHECK-TRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
81 # CHECK-TRAP: div $zero, $4, $1 # encoding: [0x1a,0x00,0x81,0x00]
82 # CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
84 rem $4,0x1a5a5
85 # CHECK-NOTRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
86 # CHECK-NOTRAP: ori $1, $1, 42405 # encoding: [0xa5,0xa5,0x21,0x34]
87 # CHECK-NOTRAP: div $zero, $4, $1 # encoding: [0x1a,0x00,0x81,0x00]
88 # CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
89 # CHECK-TRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
90 # CHECK-TRAP: ori $1, $1, 42405 # encoding: [0xa5,0xa5,0x21,0x34]
91 # CHECK-TRAP: div $zero, $4, $1 # encoding: [0x1a,0x00,0x81,0x00]
92 # CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
94 rem $4,$5,$6
95 # CHECK-NOTRAP: bnez $6, $tmp2 # encoding: [A,A,0xc0,0x14]
96 # CHECK-NOTRAP: div $zero, $5, $6 # encoding: [0x1a,0x00,0xa6,0x00]
97 # CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00]
98 # CHECk-NOTRAP: $tmp2
99 # CHECK-NOTRAP: addiu $1, $zero, -1 # encoding: [0xff,0xff,0x01,0x24]
100 # CHECK-NOTRAP: bne $6, $1, $tmp3 # encoding: [A,A,0xc1,0x14]
101 # CHECK-NOTRAP: lui $1, 32768 # encoding: [0x00,0x80,0x01,0x3c]
102 # CHECK-NOTRAP: bne $5, $1, $tmp3 # encoding: [A,A,0xa1,0x14]
103 # CHECK-NOTRAP: nop # encoding: [0x00,0x00,0x00,0x00]
104 # CHECK-NOTRAP: break 6 # encoding: [0x0d,0x00,0x06,0x00]
105 # CHECK-NOTRAP: $tmp3
106 # CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
107 # CHECK-TRAP: teq $6, $zero, 7 # encoding: [0xf4,0x01,0xc0,0x00]
108 # CHECK-TRAP: div $zero, $5, $6 # encoding: [0x1a,0x00,0xa6,0x00]
109 # CHECK-TRAP: addiu $1, $zero, -1 # encoding: [0xff,0xff,0x01,0x24]
110 # CHECK-TRAP: bne $6, $1, $tmp1 # encoding: [A,A,0xc1,0x14]
111 # CHECK-TRAP: lui $1, 32768 # encoding: [0x00,0x80,0x01,0x3c]
112 # CHECK-TRAP: teq $5, $1, 6 # encoding: [0xb4,0x01,0xa1,0x00]
113 # CHECK-TRAP: $tmp1
114 # CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
116 rem $4,$5,$0
117 # CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00]
118 # CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00]
120 rem $4,$0,$0
121 # CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00]
122 # CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00]
124 rem $0,$5,$4
125 # CHECK-NOTRAP: div $zero, $5, $4 # encoding: [0x1a,0x00,0xa4,0x00]
126 # CHECK-TRAP: div $zero, $5, $4 # encoding: [0x1a,0x00,0xa4,0x00]
128 rem $4,$5,0
129 # CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00]
130 # CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00]
132 rem $4,$0,0
133 # CHECK-NOTRAP: break 7 # encoding: [0x0d,0x00,0x07,0x00]
134 # CHECK-TRAP: teq $zero, $zero, 7 # encoding: [0xf4,0x01,0x00,0x00]
136 rem $4,$5,1
137 # CHECK-NOTRAP: move $4, $zero # encoding: [0x25,0x20,0x00,0x00]
138 # CHECK-TRAP: move $4, $zero # encoding: [0x25,0x20,0x00,0x00]
140 rem $4,$5,-1
141 # CHECK-NOTRAP: move $4, $zero # encoding: [0x25,0x20,0x00,0x00]
142 # CHECK-TRAP: move $4, $zero # encoding: [0x25,0x20,0x00,0x00]
144 rem $4,$5,2
145 # CHECK-NOTRAP: addiu $1, $zero, 2 # encoding: [0x02,0x00,0x01,0x24]
146 # CHECK-NOTRAP: div $zero, $5, $1 # encoding: [0x1a,0x00,0xa1,0x00]
147 # CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
148 # CHECK-TRAP: addiu $1, $zero, 2 # encoding: [0x02,0x00,0x01,0x24]
149 # CHECK-TRAP: div $zero, $5, $1 # encoding: [0x1a,0x00,0xa1,0x00]
150 # CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
152 rem $4,$5,0x8000
153 # CHECK-NOTRAP: ori $1, $zero, 32768 # encoding: [0x00,0x80,0x01,0x34]
154 # CHECK-NOTRAP: div $zero, $5, $1 # encoding: [0x1a,0x00,0xa1,0x00]
155 # CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
156 # CHECK-TRAP: ori $1, $zero, 32768 # encoding: [0x00,0x80,0x01,0x34]
157 # CHECK-TRAP: div $zero, $5, $1 # encoding: [0x1a,0x00,0xa1,0x00]
158 # CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
161 rem $4,$5,-0x8000
162 # CHECK-NOTRAP: addiu $1, $zero, -32768 # encoding: [0x00,0x80,0x01,0x24]
163 # CHECK-NOTRAP: div $zero, $5, $1 # encoding: [0x1a,0x00,0xa1,0x00]
164 # CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
165 # CHECK-TRAP: addiu $1, $zero, -32768 # encoding: [0x00,0x80,0x01,0x24]
166 # CHECK-TRAP: div $zero, $5, $1 # encoding: [0x1a,0x00,0xa1,0x00]
167 # CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
170 rem $4,$5,0x10000
171 # CHECK-NOTRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
172 # CHECK-NOTRAP: div $zero, $5, $1 # encoding: [0x1a,0x00,0xa1,0x00]
173 # CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
174 # CHECK-TRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
175 # CHECK-TRAP: div $zero, $5, $1 # encoding: [0x1a,0x00,0xa1,0x00]
176 # CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
179 rem $4,$5,0x1a5a5
180 # CHECK-NOTRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
181 # CHECK-NOTRAP: ori $1, $1, 42405 # encoding: [0xa5,0xa5,0x21,0x34]
182 # CHECK-NOTRAP: div $zero, $5, $1 # encoding: [0x1a,0x00,0xa1,0x00]
183 # CHECK-NOTRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]
184 # CHECK-TRAP: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
185 # CHECK-TRAP: ori $1, $1, 42405 # encoding: [0xa5,0xa5,0x21,0x34]
186 # CHECK-TRAP: div $zero, $5, $1 # encoding: [0x1a,0x00,0xa1,0x00]
187 # CHECK-TRAP: mfhi $4 # encoding: [0x10,0x20,0x00,0x00]