[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / llvm / test / MC / Mips / mips64-expansions.s
blobc586c81aa6e8e4dc8cd9c8a7b9a83dc0ba8305b5
1 # RUN: llvm-mc %s -triple=mips64el-unknown-linux -mcpu=mips64r2 -mattr=-xgot \
2 # RUN: -show-encoding | FileCheck --check-prefixes=CHECK,GOT %s
3 # RUN: llvm-mc %s -triple=mips64el-unknown-linux -mcpu=mips64r2 -mattr=+xgot \
4 # RUN: -show-encoding | FileCheck --check-prefixes=CHECK,XGOT %s
6 # Check that signed negative 32-bit immediates are loaded correctly:
7 li $10, ~(0x101010)
8 # CHECK: lui $10, 65519 # encoding: [0xef,0xff,0x0a,0x3c]
9 # CHECK: ori $10, $10, 61423 # encoding: [0xef,0xef,0x4a,0x35]
10 # CHECK-NOT: dsll
12 # Test bne with an immediate as the 2nd operand.
13 bne $2, 0x100010001, 1332
14 # CHECK: addiu $1, $zero, 1 # encoding: [0x01,0x00,0x01,0x24]
15 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
16 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
17 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
18 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
19 # CHECK: bne $2, $1, 1332 # encoding: [0x4d,0x01,0x41,0x14]
20 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
22 bne $2, 0x1000100010001, 1332
23 # CHECK: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
24 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
25 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
26 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
27 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
28 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
29 # CHECK: bne $2, $1, 1332 # encoding: [0x4d,0x01,0x41,0x14]
30 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
32 bne $2, -0x100010001, 1332
33 # CHECK: addiu $1, $zero, -2 # encoding: [0xfe,0xff,0x01,0x24]
34 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
35 # CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34]
36 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
37 # CHECK: ori $1, $1, 65535 # encoding: [0xff,0xff,0x21,0x34]
38 # CHECK: bne $2, $1, 1332 # encoding: [0x4d,0x01,0x41,0x14]
39 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
41 bne $2, -0x1000100010001, 1332
42 # CHECK: lui $1, 65534 # encoding: [0xfe,0xff,0x01,0x3c]
43 # CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34]
44 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
45 # CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34]
46 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
47 # CHECK: ori $1, $1, 65535 # encoding: [0xff,0xff,0x21,0x34]
48 # CHECK: bne $2, $1, 1332 # encoding: [0x4d,0x01,0x41,0x14]
49 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
51 # Test beq with an immediate as the 2nd operand.
52 beq $2, 0x100010001, 1332
53 # CHECK: addiu $1, $zero, 1 # encoding: [0x01,0x00,0x01,0x24]
54 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
55 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
56 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
57 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
58 # CHECK: beq $2, $1, 1332 # encoding: [0x4d,0x01,0x41,0x10]
59 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
61 beq $2, 0x1000100010001, 1332
62 # CHECK: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
63 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
64 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
65 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
66 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
67 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
68 # CHECK: beq $2, $1, 1332 # encoding: [0x4d,0x01,0x41,0x10]
69 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
71 beq $2, -0x100010001, 1332
72 # CHECK: addiu $1, $zero, -2 # encoding: [0xfe,0xff,0x01,0x24]
73 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
74 # CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34]
75 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
76 # CHECK: ori $1, $1, 65535 # encoding: [0xff,0xff,0x21,0x34]
77 # CHECK: beq $2, $1, 1332 # encoding: [0x4d,0x01,0x41,0x10]
78 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
80 beq $2, -0x1000100010001, 1332
81 # CHECK: lui $1, 65534 # encoding: [0xfe,0xff,0x01,0x3c]
82 # CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34]
83 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
84 # CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34]
85 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
86 # CHECK: ori $1, $1, 65535 # encoding: [0xff,0xff,0x21,0x34]
87 # CHECK: beq $2, $1, 1332 # encoding: [0x4d,0x01,0x41,0x10]
88 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
90 # Test one with a symbol in the third operand.
91 sym:
92 bne $2, 0x100010001, sym
93 # CHECK: addiu $1, $zero, 1 # encoding: [0x01,0x00,0x01,0x24]
94 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
95 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
96 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
97 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
98 # CHECK: bne $2, $1, sym # encoding: [A,A,0x41,0x14]
99 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
101 # Test ulhu with 64-bit immediate addresses.
102 ulhu $8, 0x100010001
103 # CHECK: addiu $1, $zero, 1 # encoding: [0x01,0x00,0x01,0x24]
104 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
105 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
106 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
107 # CHECK: lbu $8, 1($1) # encoding: [0x01,0x00,0x28,0x90]
108 # CHECK: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90]
109 # CHECK: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00]
110 # CHECK: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01]
112 ulhu $8, 0x1000100010001
113 # CHECK: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
114 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
115 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
116 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
117 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
118 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
119 # CHECK: lbu $8, 1($1) # encoding: [0x01,0x00,0x28,0x90]
120 # CHECK: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90]
121 # CHECK: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00]
122 # CHECK: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01]
124 ulhu $8, -0x100010001
125 # CHECK: addiu $1, $zero, -2 # encoding: [0xfe,0xff,0x01,0x24]
126 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
127 # CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34]
128 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
129 # CHECK: ori $1, $1, 65535 # encoding: [0xff,0xff,0x21,0x34]
130 # CHECK: lbu $8, 1($1) # encoding: [0x01,0x00,0x28,0x90]
131 # CHECK: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90]
132 # CHECK: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00]
133 # CHECK: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01]
135 ulhu $8, -0x1000100010001
136 # CHECK: lui $1, 65534 # encoding: [0xfe,0xff,0x01,0x3c]
137 # CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34]
138 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
139 # CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34]
140 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
141 # CHECK: ori $1, $1, 65535 # encoding: [0xff,0xff,0x21,0x34]
142 # CHECK: lbu $8, 1($1) # encoding: [0x01,0x00,0x28,0x90]
143 # CHECK: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90]
144 # CHECK: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00]
145 # CHECK: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01]
147 # Test ulhu with source register and 64-bit immediate offset.
148 ulhu $8, 0x100010001($9)
149 # CHECK: addiu $1, $zero, 1 # encoding: [0x01,0x00,0x01,0x24]
150 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
151 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
152 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
153 # CHECK: daddu $1, $1, $9 # encoding: [0x2d,0x08,0x29,0x00]
154 # CHECK: lbu $8, 1($1) # encoding: [0x01,0x00,0x28,0x90]
155 # CHECK: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90]
156 # CHECK: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00]
157 # CHECK: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01]
159 ulhu $8, 0x1000100010001($9)
160 # CHECK: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
161 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
162 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
163 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
164 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
165 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
166 # CHECK: daddu $1, $1, $9 # encoding: [0x2d,0x08,0x29,0x00]
167 # CHECK: lbu $8, 1($1) # encoding: [0x01,0x00,0x28,0x90]
168 # CHECK: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90]
169 # CHECK: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00]
170 # CHECK: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01]
172 ulhu $8, -0x100010001($9)
173 # CHECK: addiu $1, $zero, -2 # encoding: [0xfe,0xff,0x01,0x24]
174 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
175 # CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34]
176 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
177 # CHECK: daddu $1, $1, $9 # encoding: [0x2d,0x08,0x29,0x00]
178 # CHECK: lbu $8, 1($1) # encoding: [0x01,0x00,0x28,0x90]
179 # CHECK: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90]
180 # CHECK: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00]
181 # CHECK: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01]
183 ulhu $8, -0x1000100010001($9)
184 # CHECK: lui $1, 65534 # encoding: [0xfe,0xff,0x01,0x3c]
185 # CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34]
186 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
187 # CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34]
188 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
189 # CHECK: ori $1, $1, 65535 # encoding: [0xff,0xff,0x21,0x34]
190 # CHECK: daddu $1, $1, $9 # encoding: [0x2d,0x08,0x29,0x00]
191 # CHECK: lbu $8, 1($1) # encoding: [0x01,0x00,0x28,0x90]
192 # CHECK: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90]
193 # CHECK: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00]
194 # CHECK: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01]
196 # Test ulw with 64-bit immediate addresses.
197 ulw $8, 0x100010001
198 # CHECK: addiu $1, $zero, 1 # encoding: [0x01,0x00,0x01,0x24]
199 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
200 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
201 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
202 # CHECK: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88]
203 # CHECK: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98]
205 ulw $8, 0x1000100010001
206 # CHECK: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
207 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
208 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
209 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
210 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
211 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
212 # CHECK: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88]
213 # CHECK: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98]
215 ulw $8, -0x100010001
216 # CHECK: addiu $1, $zero, -2 # encoding: [0xfe,0xff,0x01,0x24]
217 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
218 # CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34]
219 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
220 # CHECK: ori $1, $1, 65535 # encoding: [0xff,0xff,0x21,0x34]
221 # CHECK: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88]
222 # CHECK: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98]
224 ulw $8, -0x1000100010001
225 # CHECK: lui $1, 65534 # encoding: [0xfe,0xff,0x01,0x3c]
226 # CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34]
227 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
228 # CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34]
229 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
230 # CHECK: ori $1, $1, 65535 # encoding: [0xff,0xff,0x21,0x34]
231 # CHECK: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88]
232 # CHECK: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98]
234 # Test ulw with source register and 64-bit immediate offset.
235 ulw $8, 0x100010001($9)
236 # CHECK: addiu $1, $zero, 1 # encoding: [0x01,0x00,0x01,0x24]
237 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
238 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
239 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
240 # CHECK: daddu $1, $1, $9 # encoding: [0x2d,0x08,0x29,0x00]
241 # CHECK: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88]
242 # CHECK: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98]
244 ulw $8, 0x1000100010001($9)
245 # CHECK: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
246 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
247 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
248 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
249 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
250 # CHECK: ori $1, $1, 1 # encoding: [0x01,0x00,0x21,0x34]
251 # CHECK: daddu $1, $1, $9 # encoding: [0x2d,0x08,0x29,0x00]
252 # CHECK: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88]
253 # CHECK: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98]
255 ulw $8, -0x100010001($9)
256 # CHECK: addiu $1, $zero, -2 # encoding: [0xfe,0xff,0x01,0x24]
257 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
258 # CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34]
259 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
260 # CHECK: ori $1, $1, 65535 # encoding: [0xff,0xff,0x21,0x34]
261 # CHECK: daddu $1, $1, $9 # encoding: [0x2d,0x08,0x29,0x00]
262 # CHECK: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88]
263 # CHECK: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98]
265 ulw $8, -0x1000100010001($9)
266 # CHECK: lui $1, 65534 # encoding: [0xfe,0xff,0x01,0x3c]
267 # CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34]
268 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
269 # CHECK: ori $1, $1, 65534 # encoding: [0xfe,0xff,0x21,0x34]
270 # CHECK: dsll $1, $1, 16 # encoding: [0x38,0x0c,0x01,0x00]
271 # CHECK: ori $1, $1, 65535 # encoding: [0xff,0xff,0x21,0x34]
272 # CHECK: daddu $1, $1, $9 # encoding: [0x2d,0x08,0x29,0x00]
273 # CHECK: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88]
274 # CHECK: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98]
276 # Test lb/sb/ld/sd/lld with offsets exceeding 16-bits in size.
278 ld $4, 0x8000
279 # CHECK: lui $4, 1
280 # CHECK-NEXT: ld $4, -32768($4)
282 ld $4, 0x20008($3)
283 # CHECK: lui $4, 2
284 # CHECK-NEXT: addu $4, $4, $3
285 # CHECK-NEXT: ld $4, 8($4)
287 ld $4,0x100010004
288 # CHECK: addiu $4, $zero, 1
289 # CHECK-NEXT: dsll $4, $4, 16
290 # CHECK-NEXT: ori $4, $4, 1
291 # CHECK-NEXT: dsll $4, $4, 16
292 # CHECK-NEXT: ld $4, 4($4)
294 ld $4,0x1800180018004
295 # CHECK: lui $4, 1
296 # CHECK-NEXT: ori $4, $4, 32769
297 # CHECK-NEXT: dsll $4, $4, 16
298 # CHECK-NEXT: ori $4, $4, 32770
299 # CHECK-NEXT: dsll $4, $4, 16
300 # CHECK-NEXT: ld $4, -32764($4)
302 ld $4,0x1800180018004($3)
303 # CHECK: lui $4, 1
304 # CHECK-NEXT: ori $4, $4, 32769
305 # CHECK-NEXT: dsll $4, $4, 16
306 # CHECK-NEXT: ori $4, $4, 32770
307 # CHECK-NEXT: dsll $4, $4, 16
308 # CHECK-NEXT: daddu $4, $4, $3
309 # CHECK-NEXT: ld $4, -32764($4)
311 sd $4, 0x8000
312 # CHECK: lui $1, 1
313 # CHECK-NEXT: sd $4, -32768($1)
315 sd $4, 0x20008($3)
316 # CHECK: lui $1, 2
317 # CHECK-NEXT: addu $1, $1, $3
318 # CHECK-NEXT: sd $4, 8($1)
320 sd $4,0x100010004
321 # CHECK: addiu $1, $zero, 1
322 # CHECK-NEXT: dsll $1, $1, 16
323 # CHECK-NEXT: ori $1, $1, 1
324 # CHECK-NEXT: dsll $1, $1, 16
325 # CHECK-NEXT: sd $4, 4($1)
327 sd $4,0x1800180018004
328 # CHECK: lui $1, 1
329 # CHECK-NEXT: ori $1, $1, 32769
330 # CHECK-NEXT: dsll $1, $1, 16
331 # CHECK-NEXT: ori $1, $1, 32770
332 # CHECK-NEXT: dsll $1, $1, 16
333 # CHECK-NEXT: sd $4, -32764($1)
335 sd $4,0x1800180018004($3)
336 # CHECK: lui $1, 1
337 # CHECK-NEXT: ori $1, $1, 32769
338 # CHECK-NEXT: dsll $1, $1, 16
339 # CHECK-NEXT: ori $1, $1, 32770
340 # CHECK-NEXT: dsll $1, $1, 16
341 # CHECK-NEXT: daddu $1, $1, $3
342 # CHECK-NEXT: sd $4, -32764($1)
344 lld $4, 0x8000
345 # CHECK: lui $4, 1
346 # CHECK-NEXT: lld $4, -32768($4)
348 lld $4, 0x20008($3)
349 # CHECK: lui $4, 2
350 # CHECK-NEXT: addu $4, $4, $3
351 # CHECK-NEXT: lld $4, 8($4)
353 lld $4,0x100010004
354 # CHECK: addiu $4, $zero, 1
355 # CHECK-NEXT: dsll $4, $4, 16
356 # CHECK-NEXT: ori $4, $4, 1
357 # CHECK-NEXT: dsll $4, $4, 16
358 # CHECK-NEXT: lld $4, 4($4)
360 lld $4,0x1800180018004
361 # CHECK: lui $4, 1
362 # CHECK-NEXT: ori $4, $4, 32769
363 # CHECK-NEXT: dsll $4, $4, 16
364 # CHECK-NEXT: ori $4, $4, 32770
365 # CHECK-NEXT: dsll $4, $4, 16
366 # CHECK-NEXT: lld $4, -32764($4)
368 lld $4,0x1800180018004($3)
369 # CHECK: lui $4, 1
370 # CHECK-NEXT: ori $4, $4, 32769
371 # CHECK-NEXT: dsll $4, $4, 16
372 # CHECK-NEXT: ori $4, $4, 32770
373 # CHECK-NEXT: dsll $4, $4, 16
374 # CHECK-NEXT: daddu $4, $4, $3
375 # CHECK-NEXT: lld $4, -32764($4)
377 lb $4,0x100010004
378 # CHECK: addiu $4, $zero, 1
379 # CHECK-NEXT: dsll $4, $4, 16
380 # CHECK-NEXT: ori $4, $4, 1
381 # CHECK-NEXT: dsll $4, $4, 16
382 # CHECK-NEXT: lb $4, 4($4)
384 lb $4,0x1800180018004
385 # CHECK: lui $4, 1
386 # CHECK-NEXT: ori $4, $4, 32769
387 # CHECK-NEXT: dsll $4, $4, 16
388 # CHECK-NEXT: ori $4, $4, 32770
389 # CHECK-NEXT: dsll $4, $4, 16
390 # CHECK-NEXT: lb $4, -32764($4)
392 lb $4,0x1800180018004($3)
393 # CHECK: lui $4, 1
394 # CHECK-NEXT: ori $4, $4, 32769
395 # CHECK-NEXT: dsll $4, $4, 16
396 # CHECK-NEXT: ori $4, $4, 32770
397 # CHECK-NEXT: dsll $4, $4, 16
398 # CHECK-NEXT: daddu $4, $4, $3
399 # CHECK-NEXT: lb $4, -32764($4)
401 sb $4,0x100010004
402 # CHECK: addiu $1, $zero, 1
403 # CHECK-NEXT: dsll $1, $1, 16
404 # CHECK-NEXT: ori $1, $1, 1
405 # CHECK-NEXT: dsll $1, $1, 16
406 # CHECK-NEXT: sb $4, 4($1)
408 sb $4,0x1800180018004
409 # CHECK: lui $1, 1
410 # CHECK-NEXT: ori $1, $1, 32769
411 # CHECK-NEXT: dsll $1, $1, 16
412 # CHECK-NEXT: ori $1, $1, 32770
413 # CHECK-NEXT: dsll $1, $1, 16
414 # CHECK-NEXT: sb $4, -32764($1)
416 sb $4,0x1800180018004($3)
417 # CHECK: lui $1, 1
418 # CHECK-NEXT: ori $1, $1, 32769
419 # CHECK-NEXT: dsll $1, $1, 16
420 # CHECK-NEXT: ori $1, $1, 32770
421 # CHECK-NEXT: dsll $1, $1, 16
422 # CHECK-NEXT: daddu $1, $1, $3
423 # CHECK-NEXT: sb $4, -32764($1)
425 lh $4,0x100010004
426 # CHECK: addiu $4, $zero, 1
427 # CHECK-NEXT: dsll $4, $4, 16
428 # CHECK-NEXT: ori $4, $4, 1
429 # CHECK-NEXT: dsll $4, $4, 16
430 # CHECK-NEXT: lh $4, 4($4)
432 lh $4,0x1800180018004
433 # CHECK: lui $4, 1
434 # CHECK-NEXT: ori $4, $4, 32769
435 # CHECK-NEXT: dsll $4, $4, 16
436 # CHECK-NEXT: ori $4, $4, 32770
437 # CHECK-NEXT: dsll $4, $4, 16
438 # CHECK-NEXT: lh $4, -32764($4)
440 lh $4,0x1800180018004($3)
441 # CHECK: lui $4, 1
442 # CHECK-NEXT: ori $4, $4, 32769
443 # CHECK-NEXT: dsll $4, $4, 16
444 # CHECK-NEXT: ori $4, $4, 32770
445 # CHECK-NEXT: dsll $4, $4, 16
446 # CHECK-NEXT: daddu $4, $4, $3
447 # CHECK-NEXT: lh $4, -32764($4)
449 lhu $4,0x100010004
450 # CHECK: addiu $4, $zero, 1
451 # CHECK-NEXT: dsll $4, $4, 16
452 # CHECK-NEXT: ori $4, $4, 1
453 # CHECK-NEXT: dsll $4, $4, 16
454 # CHECK-NEXT: lhu $4, 4($4)
456 lhu $4,0x1800180018004
457 # CHECK: lui $4, 1
458 # CHECK-NEXT: ori $4, $4, 32769
459 # CHECK-NEXT: dsll $4, $4, 16
460 # CHECK-NEXT: ori $4, $4, 32770
461 # CHECK-NEXT: dsll $4, $4, 16
462 # CHECK-NEXT: lhu $4, -32764($4)
464 lhu $4,0x1800180018004($3)
465 # CHECK: lui $4, 1
466 # CHECK-NEXT: ori $4, $4, 32769
467 # CHECK-NEXT: dsll $4, $4, 16
468 # CHECK-NEXT: ori $4, $4, 32770
469 # CHECK-NEXT: dsll $4, $4, 16
470 # CHECK-NEXT: daddu $4, $4, $3
471 # CHECK-NEXT: lhu $4, -32764($4)
473 # LW/SW and LDC1/SDC1 of symbol address, done by MipsAsmParser::expandMemInst():
474 .option pic2
475 lw $10, symbol($4)
476 # GOT: ld $10, %got_disp(symbol)($gp) # encoding: [A,A,0x8a,0xdf]
477 # GOT-NEXT: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP
478 # GOT-NEXT: daddu $10, $10, $4 # encoding: [0x2d,0x50,0x44,0x01]
479 # GOT-NEXT: lw $10, 0($10) # encoding: [0x00,0x00,0x4a,0x8d]
481 # XGOT: lui $10, %got_hi(symbol) # encoding: [A,A,0x0a,0x3c]
482 # XGOT-NEXT: # fixup A - offset: 0, value: %got_hi(symbol), kind: fixup_Mips_GOT_HI16
483 # XGOT-NEXT: daddu $10, $10, $gp # encoding: [0x2d,0x50,0x5c,0x01]
484 # XGOT-NEXT: ld $10, %got_lo(symbol)($10) # encoding: [A,A,0x4a,0xdd]
485 # XGOT-NEXT: # fixup A - offset: 0, value: %got_lo(symbol), kind: fixup_Mips_GOT_LO16
486 # XGOT-NEXT: daddu $10, $10, $4 # encoding: [0x2d,0x50,0x44,0x01]
487 # XGOT-NEXT: lw $10, 0($10) # encoding: [0x00,0x00,0x4a,0x8d]
489 sw $10, symbol($9)
490 # GOT: ld $1, %got_disp(symbol)($gp) # encoding: [A,A,0x81,0xdf]
491 # GOT-NEXT: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP
492 # GOT-NEXT: daddu $1, $1, $9 # encoding: [0x2d,0x08,0x29,0x00]
493 # GOT-NEXT: sw $10, 0($1) # encoding: [0x00,0x00,0x2a,0xac]
495 # XGOT: lui $1, %got_hi(symbol) # encoding: [A,A,0x01,0x3c]
496 # XGOT-NEXT: # fixup A - offset: 0, value: %got_hi(symbol), kind: fixup_Mips_GOT_HI16
497 # XGOT-NEXT: daddu $1, $1, $gp # encoding: [0x2d,0x08,0x3c,0x00]
498 # XGOT-NEXT: ld $1, %got_lo(symbol)($1) # encoding: [A,A,0x21,0xdc]
499 # XGOT-NEXT: # fixup A - offset: 0, value: %got_lo(symbol), kind: fixup_Mips_GOT_LO16
500 # XGOT-NEXT: daddu $1, $1, $9 # encoding: [0x2d,0x08,0x29,0x00]
501 # XGOT-NEXT: sw $10, 0($1) # encoding: [0x00,0x00,0x2a,0xac]
503 lw $8, sym+8
504 # GOT: ld $8, %got_disp(sym)($gp) # encoding: [A,A,0x88,0xdf]
505 # GOT-NEXT: # fixup A - offset: 0, value: %got_disp(sym), kind: fixup_Mips_GOT_DISP
506 # GOT-NEXT: lw $8, 8($8) # encoding: [0x08,0x00,0x08,0x8d]
508 # XGOT: ld $8, %got_disp(sym)($gp) # encoding: [A,A,0x88,0xdf]
509 # XGOT-NEXT: # fixup A - offset: 0, value: %got_disp(sym), kind: fixup_Mips_GOT_DISP
510 # XGOT-NEXT: lw $8, 8($8) # encoding: [0x08,0x00,0x08,0x8d]
512 sw $8, sym+8
513 # GOT: ld $1, %got_disp(sym)($gp) # encoding: [A,A,0x81,0xdf]
514 # GOT-NEXT: # fixup A - offset: 0, value: %got_disp(sym), kind: fixup_Mips_GOT_DISP
515 # GOT-NEXT: sw $8, 8($1) # encoding: [0x08,0x00,0x28,0xac]
517 # XGOT: ld $1, %got_disp(sym)($gp) # encoding: [A,A,0x81,0xdf]
518 # XGOT-NEXT: # fixup A - offset: 0, value: %got_disp(sym), kind: fixup_Mips_GOT_DISP
519 # XGOT-NEXT: sw $8, 8($1) # encoding: [0x08,0x00,0x28,0xac]
521 lw $10, 655483($4)
522 # GOT: lui $10, 10 # encoding: [0x0a,0x00,0x0a,0x3c]
523 # GOT-NEXT: daddu $10, $10, $4 # encoding: [0x2d,0x50,0x44,0x01]
524 # GOT-NEXT: lw $10, 123($10) # encoding: [0x7b,0x00,0x4a,0x8d]
526 # XGOT: lui $10, 10 # encoding: [0x0a,0x00,0x0a,0x3c]
527 # XGOT-NEXT: daddu $10, $10, $4 # encoding: [0x2d,0x50,0x44,0x01]
528 # XGOT-NEXT: lw $10, 123($10) # encoding: [0x7b,0x00,0x4a,0x8d]
529 sw $10, 123456($9)
530 # GOT: lui $1, 2 # encoding: [0x02,0x00,0x01,0x3c]
531 # GOT-NEXT: daddu $1, $1, $9 # encoding: [0x2d,0x08,0x29,0x00]
532 # GOT-NEXT: sw $10, -7616($1) # encoding: [0x40,0xe2,0x2a,0xac]
534 # XGOT: lui $1, 2 # encoding: [0x02,0x00,0x01,0x3c]
535 # XGOT-NEXT: daddu $1, $1, $9 # encoding: [0x2d,0x08,0x29,0x00]
536 # XGOT-NEXT: sw $10, -7616($1) # encoding: [0x40,0xe2,0x2a,0xac]
538 lw $8, symbol+8
539 # GOT: ld $8, %got_disp(symbol)($gp) # encoding: [A,A,0x88,0xdf]
540 # GOT-NEXT: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP
541 # GOT-NEXT: lw $8, 8($8) # encoding: [0x08,0x00,0x08,0x8d]
543 # XGOT: lui $8, %got_hi(symbol) # encoding: [A,A,0x08,0x3c]
544 # XGOT-NEXT: # fixup A - offset: 0, value: %got_hi(symbol), kind: fixup_Mips_GOT_HI16
545 # XGOT-NEXT: daddu $8, $8, $gp # encoding: [0x2d,0x40,0x1c,0x01]
546 # XGOT-NEXT: ld $8, %got_lo(symbol)($8) # encoding: [A,A,0x08,0xdd]
547 # XGOT-NEXT: # fixup A - offset: 0, value: %got_lo(symbol), kind: fixup_Mips_GOT_LO16
548 # XGOT-NEXT: lw $8, 8($8) # encoding: [0x08,0x00,0x08,0x8d]
550 sw $8, symbol+8
551 # GOT: ld $1, %got_disp(symbol)($gp) # encoding: [A,A,0x81,0xdf]
552 # GOT-NEXT: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP
553 # GOT-NEXT: sw $8, 8($1) # encoding: [0x08,0x00,0x28,0xac]
555 # XGOT: lui $1, %got_hi(symbol) # encoding: [A,A,0x01,0x3c]
556 # XGOT-NEXT: # fixup A - offset: 0, value: %got_hi(symbol), kind: fixup_Mips_GOT_HI16
557 # XGOT-NEXT: daddu $1, $1, $gp # encoding: [0x2d,0x08,0x3c,0x00]
558 # XGOT-NEXT: ld $1, %got_lo(symbol)($1) # encoding: [A,A,0x21,0xdc]
559 # XGOT-NEXT: # fixup A - offset: 0, value: %got_lo(symbol), kind: fixup_Mips_GOT_LO16
560 # XGOT-NEXT: sw $8, 8($1) # encoding: [0x08,0x00,0x28,0xac]
562 ldc1 $f0, symbol
563 # GOT: ld $1, %got_disp(symbol)($gp) # encoding: [A,A,0x81,0xdf]
564 # GOT-NEXT: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP
565 # GOT-NEXT: ldc1 $f0, 0($1) # encoding: [0x00,0x00,0x20,0xd4]
567 # XGOT: lui $1, %got_hi(symbol) # encoding: [A,A,0x01,0x3c]
568 # XGOT-NEXT: # fixup A - offset: 0, value: %got_hi(symbol), kind: fixup_Mips_GOT_HI16
569 # XGOT-NEXT: daddu $1, $1, $gp # encoding: [0x2d,0x08,0x3c,0x00]
570 # XGOT-NEXT: ld $1, %got_lo(symbol)($1) # encoding: [A,A,0x21,0xdc]
571 # XGOT-NEXT: # fixup A - offset: 0, value: %got_lo(symbol), kind: fixup_Mips_GOT_LO16
572 # XGOT-NEXT: ldc1 $f0, 0($1) # encoding: [0x00,0x00,0x20,0xd4]
574 sdc1 $f0, symbol
575 # GOT: ld $1, %got_disp(symbol)($gp) # encoding: [A,A,0x81,0xdf]
576 # GOT-NEXT: # fixup A - offset: 0, value: %got_disp(symbol), kind: fixup_Mips_GOT_DISP
577 # GOT-NEXT: sdc1 $f0, 0($1) # encoding: [0x00,0x00,0x20,0xf4]
579 # XGOT: lui $1, %got_hi(symbol) # encoding: [A,A,0x01,0x3c]
580 # XGOT-NEXT: # fixup A - offset: 0, value: %got_hi(symbol), kind: fixup_Mips_GOT_HI16
581 # XGOT-NEXT: daddu $1, $1, $gp # encoding: [0x2d,0x08,0x3c,0x00]
582 # XGOT-NEXT: ld $1, %got_lo(symbol)($1) # encoding: [A,A,0x21,0xdc]
583 # XGOT-NEXT: # fixup A - offset: 0, value: %got_lo(symbol), kind: fixup_Mips_GOT_LO16
584 # XGOT-NEXT: sdc1 $f0, 0($1) # encoding: [0x00,0x00,0x20,0xf4]