1# RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips32r2 | \
2# RUN:   FileCheck %s --check-prefixes=CHECK,CHECK-LE
3# RUN: llvm-mc %s -triple=mips-unknown-linux -show-encoding -mcpu=mips32r2 | \
4# RUN:   FileCheck %s --check-prefixes=CHECK,CHECK-BE
5
6# Check that the IAS expands macro instructions in the same way as GAS.
7
8# Load address, done by MipsAsmParser::expandLoadAddressReg()
9# and MipsAsmParser::expandLoadAddressImm():
10  la $8, 1f
11# CHECK-LE: lui     $8, %hi($tmp0)        # encoding: [A,A,0x08,0x3c]
12# CHECK-LE:                               #   fixup A - offset: 0, value: %hi($tmp0), kind: fixup_Mips_HI16
13# CHECK-LE: addiu   $8, $8, %lo($tmp0)    # encoding: [A,A,0x08,0x25]
14# CHECK-LE:                               #   fixup A - offset: 0, value: %lo($tmp0), kind: fixup_Mips_LO16
15
16  lb $4, 0x8000
17# CHECK-LE: lui     $4, 1                   # encoding: [0x01,0x00,0x04,0x3c]
18# CHECK-LE: lb      $4, -32768($4)          # encoding: [0x00,0x80,0x84,0x80]
19
20  lb  $4, 0x20004($3)
21# CHECK-LE: lui     $4, 2                   # encoding: [0x02,0x00,0x04,0x3c]
22# CHECK-LE: addu    $4, $4, $3              # encoding: [0x21,0x20,0x83,0x00]
23# CHECK-LE: lb      $4, 4($4)               # encoding: [0x04,0x00,0x84,0x80]
24
25  lbu $4, 0x8000
26# CHECK-LE: lui     $4, 1                   # encoding: [0x01,0x00,0x04,0x3c]
27# CHECK-LE: lbu     $4, -32768($4)          # encoding: [0x00,0x80,0x84,0x90]
28
29  lbu  $4, 0x20004($3)
30# CHECK-LE: lui     $4, 2                   # encoding: [0x02,0x00,0x04,0x3c]
31# CHECK-LE: addu    $4, $4, $3              # encoding: [0x21,0x20,0x83,0x00]
32# CHECK-LE: lbu     $4, 4($4)               # encoding: [0x04,0x00,0x84,0x90]
33
34  lh   $4, 0x8000
35# CHECK-LE: lui     $4, 1
36# CHECK-LE: lh      $4, -32768($4)
37
38  lh   $4, 0x20004($3)
39# CHECK-LE: lui     $4, 2
40# CHECK-LE: addu    $4, $4, $3
41# CHECK-LE: lh      $4, 4($4)
42
43  lhu  $4, 0x8000
44# CHECK-LE: lui     $4, 1
45# CHECK-LE: lhu     $4, -32768($4)
46
47  lhu  $4, 0x20004($3)
48# CHECK-LE: lui     $4, 2
49# CHECK-LE: addu    $4, $4, $3
50# CHECK-LE: lhu     $4, 4($4)
51
52# LW/SW and LDC1/SDC1 of symbol address, done by MipsAsmParser::expandMemInst():
53  .set noat
54  lw $10, symbol($4)
55# CHECK-LE: lui     $10, %hi(symbol)        # encoding: [A,A,0x0a,0x3c]
56# CHECK-LE:                                 #   fixup A - offset: 0, value: %hi(symbol), kind: fixup_Mips_HI16
57# CHECK-LE: addu    $10, $10, $4            # encoding: [0x21,0x50,0x44,0x01]
58# CHECK-LE: lw      $10, %lo(symbol)($10)   # encoding: [A,A,0x4a,0x8d]
59# CHECK-LE:                                 #   fixup A - offset: 0, value: %lo(symbol), kind: fixup_Mips_LO16
60  .set at
61  sw $10, symbol($9)
62# CHECK-LE: lui     $1, %hi(symbol)         # encoding: [A,A,0x01,0x3c]
63# CHECK-LE:                                 #   fixup A - offset: 0, value: %hi(symbol), kind: fixup_Mips_HI16
64# CHECK-LE: addu    $1, $1, $9              # encoding: [0x21,0x08,0x29,0x00]
65# CHECK-LE: sw      $10, %lo(symbol)($1)    # encoding: [A,A,0x2a,0xac]
66# CHECK-LE:                                 #   fixup A - offset: 0, value: %lo(symbol), kind: fixup_Mips_LO16
67
68  lw $8, 1f
69# CHECK-LE: lui $8, %hi($tmp0)              # encoding: [A,A,0x08,0x3c]
70# CHECK-LE:                                 #   fixup A - offset: 0, value: %hi($tmp0), kind: fixup_Mips_HI16
71# CHECK-LE: lw  $8, %lo($tmp0)($8)          # encoding: [A,A,0x08,0x8d]
72# CHECK-LE:                                 #   fixup A - offset: 0, value: %lo($tmp0), kind: fixup_Mips_LO16
73  sw $8, 1f
74# CHECK-LE: lui $1, %hi($tmp0)              # encoding: [A,A,0x01,0x3c]
75# CHECK-LE:                                 #   fixup A - offset: 0, value: %hi($tmp0), kind: fixup_Mips_HI16
76# CHECK-LE: sw  $8, %lo($tmp0)($1)          # encoding: [A,A,0x28,0xac]
77# CHECK-LE:                                 #   fixup A - offset: 0, value: %lo($tmp0), kind: fixup_Mips_LO16
78
79  lw $10, 655483($4)
80# CHECK-LE: lui     $10, 10                 # encoding: [0x0a,0x00,0x0a,0x3c]
81# CHECK-LE: addu    $10, $10, $4            # encoding: [0x21,0x50,0x44,0x01]
82# CHECK-LE: lw      $10, 123($10)           # encoding: [0x7b,0x00,0x4a,0x8d]
83  sw $10, 123456($9)
84# CHECK-LE: lui     $1, 2                   # encoding: [0x02,0x00,0x01,0x3c]
85# CHECK-LE: addu    $1, $1, $9              # encoding: [0x21,0x08,0x29,0x00]
86# CHECK-LE: sw      $10, -7616($1)          # encoding: [0x40,0xe2,0x2a,0xac]
87
88  lw $8, symbol
89# CHECK-LE:     lui     $8, %hi(symbol)     # encoding: [A,A,0x08,0x3c]
90# CHECK-LE:                                 #   fixup A - offset: 0, value: %hi(symbol), kind: fixup_Mips_HI16
91# CHECK-LE-NOT: move    $8, $8              # encoding: [0x21,0x40,0x00,0x01]
92# CHECK-LE:     lw      $8, %lo(symbol)($8) # encoding: [A,A,0x08,0x8d]
93# CHECK-LE:                                 #   fixup A - offset: 0, value: %lo(symbol), kind: fixup_Mips_LO16
94  sw $8, symbol
95# CHECK-LE:     lui     $1, %hi(symbol)     # encoding: [A,A,0x01,0x3c]
96# CHECK-LE:                                 #   fixup A - offset: 0, value: %hi(symbol), kind: fixup_Mips_HI16
97# CHECK-LE-NOT: move    $1, $1              # encoding: [0x21,0x08,0x20,0x00]
98# CHECK-LE:     sw      $8, %lo(symbol)($1) # encoding: [A,A,0x28,0xac]
99# CHECK-LE:                                 #   fixup A - offset: 0, value: %lo(symbol), kind: fixup_Mips_LO16
100
101  ldc1 $f0, symbol
102# CHECK-LE: lui     $1, %hi(symbol)
103# CHECK-LE: ldc1    $f0, %lo(symbol)($1)
104  sdc1 $f0, symbol
105# CHECK-LE: lui     $1, %hi(symbol)
106# CHECK-LE: sdc1    $f0, %lo(symbol)($1)
107
108# Test BNE with an immediate as the 2nd operand.
109  bne $2, 0, 1332
110# CHECK-LE: bnez  $2, 1332          # encoding: [0x4d,0x01,0x40,0x14]
111# CHECK-LE: nop                     # encoding: [0x00,0x00,0x00,0x00]
112
113  bne $2, 123, 1332
114# CHECK-LE: addiu $1, $zero, 123    # encoding: [0x7b,0x00,0x01,0x24]
115# CHECK-LE: bne   $2, $1, 1332      # encoding: [0x4d,0x01,0x41,0x14]
116# CHECK-LE: nop                     # encoding: [0x00,0x00,0x00,0x00]
117
118  bne $2, -2345, 1332
119# CHECK-LE: addiu $1, $zero, -2345  # encoding: [0xd7,0xf6,0x01,0x24]
120# CHECK-LE: bne   $2, $1, 1332      # encoding: [0x4d,0x01,0x41,0x14]
121# CHECK-LE: nop                     # encoding: [0x00,0x00,0x00,0x00]
122
123  bne $2, 65538, 1332
124# CHECK-LE: lui   $1, 1             # encoding: [0x01,0x00,0x01,0x3c]
125# CHECK-LE: ori   $1, $1, 2         # encoding: [0x02,0x00,0x21,0x34]
126# CHECK-LE: bne   $2, $1, 1332      # encoding: [0x4d,0x01,0x41,0x14]
127# CHECK-LE: nop                     # encoding: [0x00,0x00,0x00,0x00]
128
129  bne $2, ~7, 1332
130# CHECK-LE: addiu $1, $zero, -8     # encoding: [0xf8,0xff,0x01,0x24]
131# CHECK-LE: bne   $2, $1, 1332      # encoding: [0x4d,0x01,0x41,0x14]
132# CHECK-LE: nop                     # encoding: [0x00,0x00,0x00,0x00]
133
134  bne $2, 0x10000, 1332
135# CHECK-LE: lui   $1, 1             # encoding: [0x01,0x00,0x01,0x3c]
136# CHECK-LE: bne   $2, $1, 1332      # encoding: [0x4d,0x01,0x41,0x14]
137# CHECK-LE: nop                     # encoding: [0x00,0x00,0x00,0x00]
138
139# Test BEQ with an immediate as the 2nd operand.
140  beq $2, 0, 1332
141# CHECK-LE: beqz  $2, 1332          # encoding: [0x4d,0x01,0x40,0x10]
142# CHECK-LE: nop                     # encoding: [0x00,0x00,0x00,0x00]
143
144  beq $2, 123, 1332
145# CHECK-LE: addiu $1, $zero, 123    # encoding: [0x7b,0x00,0x01,0x24]
146# CHECK-LE: beq   $2, $1, 1332      # encoding: [0x4d,0x01,0x41,0x10]
147# CHECK-LE: nop                     # encoding: [0x00,0x00,0x00,0x00]
148
149  beq $2, -2345, 1332
150# CHECK-LE: addiu $1, $zero, -2345  # encoding: [0xd7,0xf6,0x01,0x24]
151# CHECK-LE: beq   $2, $1, 1332      # encoding: [0x4d,0x01,0x41,0x10]
152# CHECK-LE: nop                     # encoding: [0x00,0x00,0x00,0x00]
153
154  beq $2, 65538, 1332
155# CHECK-LE: lui   $1, 1             # encoding: [0x01,0x00,0x01,0x3c]
156# CHECK-LE: ori   $1, $1, 2         # encoding: [0x02,0x00,0x21,0x34]
157# CHECK-LE: beq   $2, $1, 1332      # encoding: [0x4d,0x01,0x41,0x10]
158# CHECK-LE: nop                     # encoding: [0x00,0x00,0x00,0x00]
159
160  beq $2, ~7, 1332
161# CHECK-LE: addiu $1, $zero, -8     # encoding: [0xf8,0xff,0x01,0x24]
162# CHECK-LE: beq   $2, $1, 1332      # encoding: [0x4d,0x01,0x41,0x10]
163# CHECK-LE: nop                     # encoding: [0x00,0x00,0x00,0x00]
164
165  beq $2, 0x10000, 1332
166# CHECK-LE: lui   $1, 1             # encoding: [0x01,0x00,0x01,0x3c]
167# CHECK-LE: beq   $2, $1, 1332      # encoding: [0x4d,0x01,0x41,0x10]
168# CHECK-LE: nop                     # encoding: [0x00,0x00,0x00,0x00]
169
170  beq $2, 65538, foo
171# CHECK-LE: lui   $1, 1             # encoding: [0x01,0x00,0x01,0x3c]
172# CHECK-LE: ori   $1, $1, 2         # encoding: [0x02,0x00,0x21,0x34]
173# CHECK-LE: beq   $2, $1, foo       # encoding: [A,A,0x41,0x10]
174# CHECK-LE: nop                     # encoding: [0x00,0x00,0x00,0x00]
175
176# Test ULH with immediate operand.
177ulh_imm: # CHECK-LABEL: ulh_imm:
178  ulh $8, 0
179# CHECK-BE: lb   $1, 0($zero)      # encoding: [0x80,0x01,0x00,0x00]
180# CHECK-BE: lbu  $8, 1($zero)      # encoding: [0x90,0x08,0x00,0x01]
181# CHECK-BE: sll  $1, $1, 8         # encoding: [0x00,0x01,0x0a,0x00]
182# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
183# CHECK-LE: lb   $1, 1($zero)      # encoding: [0x01,0x00,0x01,0x80]
184# CHECK-LE: lbu  $8, 0($zero)      # encoding: [0x00,0x00,0x08,0x90]
185# CHECK-LE: sll  $1, $1, 8         # encoding: [0x00,0x0a,0x01,0x00]
186# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
187
188  ulh $8, 2
189# CHECK-BE: lb   $1, 2($zero)      # encoding: [0x80,0x01,0x00,0x02]
190# CHECK-BE: lbu  $8, 3($zero)      # encoding: [0x90,0x08,0x00,0x03]
191# CHECK-BE: sll  $1, $1, 8         # encoding: [0x00,0x01,0x0a,0x00]
192# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
193# CHECK-LE: lb   $1, 3($zero)      # encoding: [0x03,0x00,0x01,0x80]
194# CHECK-LE: lbu  $8, 2($zero)      # encoding: [0x02,0x00,0x08,0x90]
195# CHECK-LE: sll  $1, $1, 8         # encoding: [0x00,0x0a,0x01,0x00]
196# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
197
198  ulh $8, 0x8000
199# CHECK-BE: ori  $1, $zero, 32768  # encoding: [0x34,0x01,0x80,0x00]
200# CHECK-BE: lb   $8, 0($1)         # encoding: [0x80,0x28,0x00,0x00]
201# CHECK-BE: lbu  $1, 1($1)         # encoding: [0x90,0x21,0x00,0x01]
202# CHECK-BE: sll  $8, $8, 8         # encoding: [0x00,0x08,0x42,0x00]
203# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
204# CHECK-LE: ori  $1, $zero, 32768  # encoding: [0x00,0x80,0x01,0x34]
205# CHECK-LE: lb   $8, 1($1)         # encoding: [0x01,0x00,0x28,0x80]
206# CHECK-LE: lbu  $1, 0($1)         # encoding: [0x00,0x00,0x21,0x90]
207# CHECK-LE: sll  $8, $8, 8         # encoding: [0x00,0x42,0x08,0x00]
208# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
209
210  ulh $8, -0x8000
211# CHECK-BE: lb   $1, -32768($zero) # encoding: [0x80,0x01,0x80,0x00]
212# CHECK-BE: lbu  $8, -32767($zero) # encoding: [0x90,0x08,0x80,0x01]
213# CHECK-BE: sll  $1, $1, 8         # encoding: [0x00,0x01,0x0a,0x00]
214# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
215# CHECK-LE: lb   $1, -32767($zero) # encoding: [0x01,0x80,0x01,0x80]
216# CHECK-LE: lbu  $8, -32768($zero) # encoding: [0x00,0x80,0x08,0x90]
217# CHECK-LE: sll  $1, $1, 8         # encoding: [0x00,0x0a,0x01,0x00]
218# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
219
220  ulh $8, 0x10000
221# CHECK-BE: lui  $1, 1             # encoding: [0x3c,0x01,0x00,0x01]
222# CHECK-BE: lb   $8, 0($1)         # encoding: [0x80,0x28,0x00,0x00]
223# CHECK-BE: lbu  $1, 1($1)         # encoding: [0x90,0x21,0x00,0x01]
224# CHECK-BE: sll  $8, $8, 8         # encoding: [0x00,0x08,0x42,0x00]
225# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
226# CHECK-LE: lui  $1, 1             # encoding: [0x01,0x00,0x01,0x3c]
227# CHECK-LE: lb   $8, 1($1)         # encoding: [0x01,0x00,0x28,0x80]
228# CHECK-LE: lbu  $1, 0($1)         # encoding: [0x00,0x00,0x21,0x90]
229# CHECK-LE: sll  $8, $8, 8         # encoding: [0x00,0x42,0x08,0x00]
230# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
231
232  ulh $8, 0x18888
233# CHECK-BE: lui  $1, 1             # encoding: [0x3c,0x01,0x00,0x01]
234# CHECK-BE: ori  $1, $1, 34952     # encoding: [0x34,0x21,0x88,0x88]
235# CHECK-BE: lb   $8, 0($1)         # encoding: [0x80,0x28,0x00,0x00]
236# CHECK-BE: lbu  $1, 1($1)         # encoding: [0x90,0x21,0x00,0x01]
237# CHECK-BE: sll  $8, $8, 8         # encoding: [0x00,0x08,0x42,0x00]
238# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
239# CHECK-LE: lui  $1, 1             # encoding: [0x01,0x00,0x01,0x3c]
240# CHECK-LE: ori  $1, $1, 34952     # encoding: [0x88,0x88,0x21,0x34]
241# CHECK-LE: lb   $8, 1($1)         # encoding: [0x01,0x00,0x28,0x80]
242# CHECK-LE: lbu  $1, 0($1)         # encoding: [0x00,0x00,0x21,0x90]
243# CHECK-LE: sll  $8, $8, 8         # encoding: [0x00,0x42,0x08,0x00]
244# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
245
246  ulh $8, -32769
247# CHECK-BE: lui  $1, 65535         # encoding: [0x3c,0x01,0xff,0xff]
248# CHECK-BE: ori  $1, $1, 32767     # encoding: [0x34,0x21,0x7f,0xff]
249# CHECK-BE: lb   $8, 0($1)         # encoding: [0x80,0x28,0x00,0x00]
250# CHECK-BE: lbu  $1, 1($1)         # encoding: [0x90,0x21,0x00,0x01]
251# CHECK-BE: sll  $8, $8, 8         # encoding: [0x00,0x08,0x42,0x00]
252# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
253# CHECK-LE: lui  $1, 65535         # encoding: [0xff,0xff,0x01,0x3c]
254# CHECK-LE: ori  $1, $1, 32767     # encoding: [0xff,0x7f,0x21,0x34]
255# CHECK-LE: lb   $8, 1($1)         # encoding: [0x01,0x00,0x28,0x80]
256# CHECK-LE: lbu  $1, 0($1)         # encoding: [0x00,0x00,0x21,0x90]
257# CHECK-LE: sll  $8, $8, 8         # encoding: [0x00,0x42,0x08,0x00]
258# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
259
260  ulh $8, 32767
261# CHECK-BE: addiu $1, $zero, 32767  # encoding: [0x24,0x01,0x7f,0xff]
262# CHECK-BE: lb   $8, 0($1)          # encoding: [0x80,0x28,0x00,0x00]
263# CHECK-BE: lbu  $1, 1($1)          # encoding: [0x90,0x21,0x00,0x01]
264# CHECK-BE: sll  $8, $8, 8          # encoding: [0x00,0x08,0x42,0x00]
265# CHECK-BE: or   $8, $8, $1         # encoding: [0x01,0x01,0x40,0x25]
266# CHECK-LE: addiu $1, $zero, 32767  # encoding: [0xff,0x7f,0x01,0x24]
267# CHECK-LE: lb   $8, 1($1)          # encoding: [0x01,0x00,0x28,0x80]
268# CHECK-LE: lbu  $1, 0($1)          # encoding: [0x00,0x00,0x21,0x90]
269# CHECK-LE: sll  $8, $8, 8          # encoding: [0x00,0x42,0x08,0x00]
270# CHECK-LE: or   $8, $8, $1         # encoding: [0x25,0x40,0x01,0x01]
271
272# Test ULH with immediate offset and a source register operand.
273ulh_reg: # CHECK-LABEL: ulh_reg:
274  ulh $8, 0($9)
275# CHECK-BE: lb   $1, 0($9)         # encoding: [0x81,0x21,0x00,0x00]
276# CHECK-BE: lbu  $8, 1($9)         # encoding: [0x91,0x28,0x00,0x01]
277# CHECK-BE: sll  $1, $1, 8         # encoding: [0x00,0x01,0x0a,0x00]
278# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
279# CHECK-LE: lb   $1, 1($9)         # encoding: [0x01,0x00,0x21,0x81]
280# CHECK-LE: lbu  $8, 0($9)         # encoding: [0x00,0x00,0x28,0x91]
281# CHECK-LE: sll  $1, $1, 8         # encoding: [0x00,0x0a,0x01,0x00]
282# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
283
284  ulh $8, 2($9)
285# CHECK-BE: lb   $1, 2($9)         # encoding: [0x81,0x21,0x00,0x02]
286# CHECK-BE: lbu  $8, 3($9)         # encoding: [0x91,0x28,0x00,0x03]
287# CHECK-BE: sll  $1, $1, 8         # encoding: [0x00,0x01,0x0a,0x00]
288# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
289# CHECK-LE: lb   $1, 3($9)         # encoding: [0x03,0x00,0x21,0x81]
290# CHECK-LE: lbu  $8, 2($9)         # encoding: [0x02,0x00,0x28,0x91]
291# CHECK-LE: sll  $1, $1, 8         # encoding: [0x00,0x0a,0x01,0x00]
292# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
293
294  ulh $8, 0x8000($9)
295# CHECK-BE: ori  $1, $zero, 32768  # encoding: [0x34,0x01,0x80,0x00]
296# CHECK-BE: addu $1, $1, $9        # encoding: [0x00,0x29,0x08,0x21]
297# CHECK-BE: lb   $8, 0($1)         # encoding: [0x80,0x28,0x00,0x00]
298# CHECK-BE: lbu  $1, 1($1)         # encoding: [0x90,0x21,0x00,0x01]
299# CHECK-BE: sll  $8, $8, 8         # encoding: [0x00,0x08,0x42,0x00]
300# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
301# CHECK-LE: ori  $1, $zero, 32768  # encoding: [0x00,0x80,0x01,0x34]
302# CHECK-LE: addu $1, $1, $9        # encoding: [0x21,0x08,0x29,0x00]
303# CHECK-LE: lb   $8, 1($1)         # encoding: [0x01,0x00,0x28,0x80]
304# CHECK-LE: lbu  $1, 0($1)         # encoding: [0x00,0x00,0x21,0x90]
305# CHECK-LE: sll  $8, $8, 8         # encoding: [0x00,0x42,0x08,0x00]
306# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
307
308  ulh $8, -0x8000($9)
309# CHECK-BE: lb   $1, -32768($9)    # encoding: [0x81,0x21,0x80,0x00]
310# CHECK-BE: lbu  $8, -32767($9)    # encoding: [0x91,0x28,0x80,0x01]
311# CHECK-BE: sll  $1, $1, 8         # encoding: [0x00,0x01,0x0a,0x00]
312# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
313# CHECK-LE: lb   $1, -32767($9)    # encoding: [0x01,0x80,0x21,0x81]
314# CHECK-LE: lbu  $8, -32768($9)    # encoding: [0x00,0x80,0x28,0x91]
315# CHECK-LE: sll  $1, $1, 8         # encoding: [0x00,0x0a,0x01,0x00]
316# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
317
318  ulh $8, 0x10000($9)
319# CHECK-BE: lui  $1, 1             # encoding: [0x3c,0x01,0x00,0x01]
320# CHECK-BE: addu $1, $1, $9        # encoding: [0x00,0x29,0x08,0x21]
321# CHECK-BE: lb   $8, 0($1)         # encoding: [0x80,0x28,0x00,0x00]
322# CHECK-BE: lbu  $1, 1($1)         # encoding: [0x90,0x21,0x00,0x01]
323# CHECK-BE: sll  $8, $8, 8         # encoding: [0x00,0x08,0x42,0x00]
324# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
325# CHECK-LE: lui  $1, 1             # encoding: [0x01,0x00,0x01,0x3c]
326# CHECK-LE: addu $1, $1, $9        # encoding: [0x21,0x08,0x29,0x00]
327# CHECK-LE: lb   $8, 1($1)         # encoding: [0x01,0x00,0x28,0x80]
328# CHECK-LE: lbu  $1, 0($1)         # encoding: [0x00,0x00,0x21,0x90]
329# CHECK-LE: sll  $8, $8, 8         # encoding: [0x00,0x42,0x08,0x00]
330# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
331
332  ulh $8, 0x18888($9)
333# CHECK-BE: lui  $1, 1             # encoding: [0x3c,0x01,0x00,0x01]
334# CHECK-BE: ori  $1, $1, 34952     # encoding: [0x34,0x21,0x88,0x88]
335# CHECK-BE: addu $1, $1, $9        # encoding: [0x00,0x29,0x08,0x21]
336# CHECK-BE: lb   $8, 0($1)         # encoding: [0x80,0x28,0x00,0x00]
337# CHECK-BE: lbu  $1, 1($1)         # encoding: [0x90,0x21,0x00,0x01]
338# CHECK-BE: sll  $8, $8, 8         # encoding: [0x00,0x08,0x42,0x00]
339# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
340# CHECK-LE: lui  $1, 1             # encoding: [0x01,0x00,0x01,0x3c]
341# CHECK-LE: ori  $1, $1, 34952     # encoding: [0x88,0x88,0x21,0x34]
342# CHECK-LE: addu $1, $1, $9        # encoding: [0x21,0x08,0x29,0x00]
343# CHECK-LE: lb   $8, 1($1)         # encoding: [0x01,0x00,0x28,0x80]
344# CHECK-LE: lbu  $1, 0($1)         # encoding: [0x00,0x00,0x21,0x90]
345# CHECK-LE: sll  $8, $8, 8         # encoding: [0x00,0x42,0x08,0x00]
346# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
347
348  ulh $8, -32769($9)
349# CHECK-BE: lui  $1, 65535         # encoding: [0x3c,0x01,0xff,0xff]
350# CHECK-BE: ori  $1, $1, 32767     # encoding: [0x34,0x21,0x7f,0xff]
351# CHECK-BE: addu $1, $1, $9        # encoding: [0x00,0x29,0x08,0x21]
352# CHECK-BE: lb   $8, 0($1)         # encoding: [0x80,0x28,0x00,0x00]
353# CHECK-BE: lbu  $1, 1($1)         # encoding: [0x90,0x21,0x00,0x01]
354# CHECK-BE: sll  $8, $8, 8         # encoding: [0x00,0x08,0x42,0x00]
355# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
356# CHECK-LE: lui  $1, 65535         # encoding: [0xff,0xff,0x01,0x3c]
357# CHECK-LE: ori  $1, $1, 32767     # encoding: [0xff,0x7f,0x21,0x34]
358# CHECK-LE: addu $1, $1, $9        # encoding: [0x21,0x08,0x29,0x00]
359# CHECK-LE: lb   $8, 1($1)         # encoding: [0x01,0x00,0x28,0x80]
360# CHECK-LE: lbu  $1, 0($1)         # encoding: [0x00,0x00,0x21,0x90]
361# CHECK-LE: sll  $8, $8, 8         # encoding: [0x00,0x42,0x08,0x00]
362# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
363
364  ulh $8, 32767($9)
365# CHECK-BE: addiu $1, $9, 32767    # encoding: [0x25,0x21,0x7f,0xff]
366# CHECK-BE: lb   $8, 0($1)         # encoding: [0x80,0x28,0x00,0x00]
367# CHECK-BE: lbu  $1, 1($1)         # encoding: [0x90,0x21,0x00,0x01]
368# CHECK-BE: sll  $8, $8, 8         # encoding: [0x00,0x08,0x42,0x00]
369# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
370# CHECK-LE: addiu $1, $9, 32767    # encoding: [0xff,0x7f,0x21,0x25]
371# CHECK-LE: lb   $8, 1($1)         # encoding: [0x01,0x00,0x28,0x80]
372# CHECK-LE: lbu  $1, 0($1)         # encoding: [0x00,0x00,0x21,0x90]
373# CHECK-LE: sll  $8, $8, 8         # encoding: [0x00,0x42,0x08,0x00]
374# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
375
376# Test ULHU with immediate operand.
377ulhu_imm: # CHECK-LABEL: ulhu_imm:
378  ulhu $8, 0
379# CHECK-BE: lbu  $1, 0($zero)      # encoding: [0x90,0x01,0x00,0x00]
380# CHECK-BE: lbu  $8, 1($zero)      # encoding: [0x90,0x08,0x00,0x01]
381# CHECK-BE: sll  $1, $1, 8         # encoding: [0x00,0x01,0x0a,0x00]
382# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
383# CHECK-LE: lbu  $1, 1($zero)      # encoding: [0x01,0x00,0x01,0x90]
384# CHECK-LE: lbu  $8, 0($zero)      # encoding: [0x00,0x00,0x08,0x90]
385# CHECK-LE: sll  $1, $1, 8         # encoding: [0x00,0x0a,0x01,0x00]
386# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
387
388  ulhu $8, 2
389# CHECK-BE: lbu  $1, 2($zero)      # encoding: [0x90,0x01,0x00,0x02]
390# CHECK-BE: lbu  $8, 3($zero)      # encoding: [0x90,0x08,0x00,0x03]
391# CHECK-BE: sll  $1, $1, 8         # encoding: [0x00,0x01,0x0a,0x00]
392# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
393# CHECK-LE: lbu  $1, 3($zero)      # encoding: [0x03,0x00,0x01,0x90]
394# CHECK-LE: lbu  $8, 2($zero)      # encoding: [0x02,0x00,0x08,0x90]
395# CHECK-LE: sll  $1, $1, 8         # encoding: [0x00,0x0a,0x01,0x00]
396# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
397
398  ulhu $8, 0x8000
399# CHECK-BE: ori  $1, $zero, 32768  # encoding: [0x34,0x01,0x80,0x00]
400# CHECK-BE: lbu  $8, 0($1)         # encoding: [0x90,0x28,0x00,0x00]
401# CHECK-BE: lbu  $1, 1($1)         # encoding: [0x90,0x21,0x00,0x01]
402# CHECK-BE: sll  $8, $8, 8         # encoding: [0x00,0x08,0x42,0x00]
403# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
404# CHECK-LE: ori  $1, $zero, 32768  # encoding: [0x00,0x80,0x01,0x34]
405# CHECK-LE: lbu  $8, 1($1)         # encoding: [0x01,0x00,0x28,0x90]
406# CHECK-LE: lbu  $1, 0($1)         # encoding: [0x00,0x00,0x21,0x90]
407# CHECK-LE: sll  $8, $8, 8         # encoding: [0x00,0x42,0x08,0x00]
408# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
409
410  ulhu $8, -0x8000
411# CHECK-BE: lbu  $1, -32768($zero) # encoding: [0x90,0x01,0x80,0x00]
412# CHECK-BE: lbu  $8, -32767($zero) # encoding: [0x90,0x08,0x80,0x01]
413# CHECK-BE: sll  $1, $1, 8         # encoding: [0x00,0x01,0x0a,0x00]
414# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
415# CHECK-LE: lbu  $1, -32767($zero) # encoding: [0x01,0x80,0x01,0x90]
416# CHECK-LE: lbu  $8, -32768($zero) # encoding: [0x00,0x80,0x08,0x90]
417# CHECK-LE: sll  $1, $1, 8         # encoding: [0x00,0x0a,0x01,0x00]
418# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
419
420  ulhu $8, 0x10000
421# CHECK-BE: lui  $1, 1             # encoding: [0x3c,0x01,0x00,0x01]
422# CHECK-BE: lbu  $8, 0($1)         # encoding: [0x90,0x28,0x00,0x00]
423# CHECK-BE: lbu  $1, 1($1)         # encoding: [0x90,0x21,0x00,0x01]
424# CHECK-BE: sll  $8, $8, 8         # encoding: [0x00,0x08,0x42,0x00]
425# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
426# CHECK-LE: lui  $1, 1             # encoding: [0x01,0x00,0x01,0x3c]
427# CHECK-LE: lbu  $8, 1($1)         # encoding: [0x01,0x00,0x28,0x90]
428# CHECK-LE: lbu  $1, 0($1)         # encoding: [0x00,0x00,0x21,0x90]
429# CHECK-LE: sll  $8, $8, 8         # encoding: [0x00,0x42,0x08,0x00]
430# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
431
432  ulhu $8, 0x18888
433# CHECK-BE: lui  $1, 1             # encoding: [0x3c,0x01,0x00,0x01]
434# CHECK-BE: ori  $1, $1, 34952     # encoding: [0x34,0x21,0x88,0x88]
435# CHECK-BE: lbu  $8, 0($1)         # encoding: [0x90,0x28,0x00,0x00]
436# CHECK-BE: lbu  $1, 1($1)         # encoding: [0x90,0x21,0x00,0x01]
437# CHECK-BE: sll  $8, $8, 8         # encoding: [0x00,0x08,0x42,0x00]
438# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
439# CHECK-LE: lui  $1, 1             # encoding: [0x01,0x00,0x01,0x3c]
440# CHECK-LE: ori  $1, $1, 34952     # encoding: [0x88,0x88,0x21,0x34]
441# CHECK-LE: lbu  $8, 1($1)         # encoding: [0x01,0x00,0x28,0x90]
442# CHECK-LE: lbu  $1, 0($1)         # encoding: [0x00,0x00,0x21,0x90]
443# CHECK-LE: sll  $8, $8, 8         # encoding: [0x00,0x42,0x08,0x00]
444# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
445
446  ulhu $8, -32769
447# CHECK-BE: lui  $1, 65535         # encoding: [0x3c,0x01,0xff,0xff]
448# CHECK-BE: ori  $1, $1, 32767     # encoding: [0x34,0x21,0x7f,0xff]
449# CHECK-BE: lbu  $8, 0($1)         # encoding: [0x90,0x28,0x00,0x00]
450# CHECK-BE: lbu  $1, 1($1)         # encoding: [0x90,0x21,0x00,0x01]
451# CHECK-BE: sll  $8, $8, 8         # encoding: [0x00,0x08,0x42,0x00]
452# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
453# CHECK-LE: lui  $1, 65535         # encoding: [0xff,0xff,0x01,0x3c]
454# CHECK-LE: ori  $1, $1, 32767     # encoding: [0xff,0x7f,0x21,0x34]
455# CHECK-LE: lbu  $8, 1($1)         # encoding: [0x01,0x00,0x28,0x90]
456# CHECK-LE: lbu  $1, 0($1)         # encoding: [0x00,0x00,0x21,0x90]
457# CHECK-LE: sll  $8, $8, 8         # encoding: [0x00,0x42,0x08,0x00]
458# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
459
460  ulhu $8, 32767
461# CHECK-BE: addiu $1, $zero, 32767  # encoding: [0x24,0x01,0x7f,0xff]
462# CHECK-BE: lbu  $8, 0($1)          # encoding: [0x90,0x28,0x00,0x00]
463# CHECK-BE: lbu  $1, 1($1)          # encoding: [0x90,0x21,0x00,0x01]
464# CHECK-BE: sll  $8, $8, 8          # encoding: [0x00,0x08,0x42,0x00]
465# CHECK-BE: or   $8, $8, $1         # encoding: [0x01,0x01,0x40,0x25]
466# CHECK-LE: addiu $1, $zero, 32767  # encoding: [0xff,0x7f,0x01,0x24]
467# CHECK-LE: lbu  $8, 1($1)          # encoding: [0x01,0x00,0x28,0x90]
468# CHECK-LE: lbu  $1, 0($1)          # encoding: [0x00,0x00,0x21,0x90]
469# CHECK-LE: sll  $8, $8, 8          # encoding: [0x00,0x42,0x08,0x00]
470# CHECK-LE: or   $8, $8, $1         # encoding: [0x25,0x40,0x01,0x01]
471
472# Test ULHU with immediate offset and a source register operand.
473  ulhu $8, 0($9)
474# CHECK-BE: lbu  $1, 0($9)         # encoding: [0x91,0x21,0x00,0x00]
475# CHECK-BE: lbu  $8, 1($9)         # encoding: [0x91,0x28,0x00,0x01]
476# CHECK-BE: sll  $1, $1, 8         # encoding: [0x00,0x01,0x0a,0x00]
477# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
478# CHECK-LE: lbu  $1, 1($9)         # encoding: [0x01,0x00,0x21,0x91]
479# CHECK-LE: lbu  $8, 0($9)         # encoding: [0x00,0x00,0x28,0x91]
480# CHECK-LE: sll  $1, $1, 8         # encoding: [0x00,0x0a,0x01,0x00]
481# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
482
483  ulhu $8, 2($9)
484# CHECK-BE: lbu  $1, 2($9)         # encoding: [0x91,0x21,0x00,0x02]
485# CHECK-BE: lbu  $8, 3($9)         # encoding: [0x91,0x28,0x00,0x03]
486# CHECK-BE: sll  $1, $1, 8         # encoding: [0x00,0x01,0x0a,0x00]
487# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
488# CHECK-LE: lbu  $1, 3($9)         # encoding: [0x03,0x00,0x21,0x91]
489# CHECK-LE: lbu  $8, 2($9)         # encoding: [0x02,0x00,0x28,0x91]
490# CHECK-LE: sll  $1, $1, 8         # encoding: [0x00,0x0a,0x01,0x00]
491# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
492
493  ulhu $8, 0x8000($9)
494# CHECK-BE: ori  $1, $zero, 32768  # encoding: [0x34,0x01,0x80,0x00]
495# CHECK-BE: addu $1, $1, $9        # encoding: [0x00,0x29,0x08,0x21]
496# CHECK-BE: lbu  $8, 0($1)         # encoding: [0x90,0x28,0x00,0x00]
497# CHECK-BE: lbu  $1, 1($1)         # encoding: [0x90,0x21,0x00,0x01]
498# CHECK-BE: sll  $8, $8, 8         # encoding: [0x00,0x08,0x42,0x00]
499# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
500# CHECK-LE: ori  $1, $zero, 32768  # encoding: [0x00,0x80,0x01,0x34]
501# CHECK-LE: addu $1, $1, $9        # encoding: [0x21,0x08,0x29,0x00]
502# CHECK-LE: lbu  $8, 1($1)         # encoding: [0x01,0x00,0x28,0x90]
503# CHECK-LE: lbu  $1, 0($1)         # encoding: [0x00,0x00,0x21,0x90]
504# CHECK-LE: sll  $8, $8, 8         # encoding: [0x00,0x42,0x08,0x00]
505# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
506
507  ulhu $8, -0x8000($9)
508# CHECK-BE: lbu  $1, -32768($9)    # encoding: [0x91,0x21,0x80,0x00]
509# CHECK-BE: lbu  $8, -32767($9)    # encoding: [0x91,0x28,0x80,0x01]
510# CHECK-BE: sll  $1, $1, 8         # encoding: [0x00,0x01,0x0a,0x00]
511# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
512# CHECK-LE: lbu  $1, -32767($9)    # encoding: [0x01,0x80,0x21,0x91]
513# CHECK-LE: lbu  $8, -32768($9)    # encoding: [0x00,0x80,0x28,0x91]
514# CHECK-LE: sll  $1, $1, 8         # encoding: [0x00,0x0a,0x01,0x00]
515# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
516
517  ulhu $8, 0x10000($9)
518# CHECK-BE: lui  $1, 1             # encoding: [0x3c,0x01,0x00,0x01]
519# CHECK-BE: addu $1, $1, $9        # encoding: [0x00,0x29,0x08,0x21]
520# CHECK-BE: lbu  $8, 0($1)         # encoding: [0x90,0x28,0x00,0x00]
521# CHECK-BE: lbu  $1, 1($1)         # encoding: [0x90,0x21,0x00,0x01]
522# CHECK-BE: sll  $8, $8, 8         # encoding: [0x00,0x08,0x42,0x00]
523# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
524# CHECK-LE: lui  $1, 1             # encoding: [0x01,0x00,0x01,0x3c]
525# CHECK-LE: addu $1, $1, $9        # encoding: [0x21,0x08,0x29,0x00]
526# CHECK-LE: lbu  $8, 1($1)         # encoding: [0x01,0x00,0x28,0x90]
527# CHECK-LE: lbu  $1, 0($1)         # encoding: [0x00,0x00,0x21,0x90]
528# CHECK-LE: sll  $8, $8, 8         # encoding: [0x00,0x42,0x08,0x00]
529# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
530
531  ulhu $8, 0x18888($9)
532# CHECK-BE: lui  $1, 1             # encoding: [0x3c,0x01,0x00,0x01]
533# CHECK-BE: ori  $1, $1, 34952     # encoding: [0x34,0x21,0x88,0x88]
534# CHECK-BE: addu $1, $1, $9        # encoding: [0x00,0x29,0x08,0x21]
535# CHECK-BE: lbu  $8, 0($1)         # encoding: [0x90,0x28,0x00,0x00]
536# CHECK-BE: lbu  $1, 1($1)         # encoding: [0x90,0x21,0x00,0x01]
537# CHECK-BE: sll  $8, $8, 8         # encoding: [0x00,0x08,0x42,0x00]
538# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
539# CHECK-LE: lui  $1, 1             # encoding: [0x01,0x00,0x01,0x3c]
540# CHECK-LE: ori  $1, $1, 34952     # encoding: [0x88,0x88,0x21,0x34]
541# CHECK-LE: addu $1, $1, $9        # encoding: [0x21,0x08,0x29,0x00]
542# CHECK-LE: lbu  $8, 1($1)         # encoding: [0x01,0x00,0x28,0x90]
543# CHECK-LE: lbu  $1, 0($1)         # encoding: [0x00,0x00,0x21,0x90]
544# CHECK-LE: sll  $8, $8, 8         # encoding: [0x00,0x42,0x08,0x00]
545# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
546
547  ulhu $8, -32769($9)
548# CHECK-BE: lui  $1, 65535         # encoding: [0x3c,0x01,0xff,0xff]
549# CHECK-BE: ori  $1, $1, 32767     # encoding: [0x34,0x21,0x7f,0xff]
550# CHECK-BE: addu $1, $1, $9        # encoding: [0x00,0x29,0x08,0x21]
551# CHECK-BE: lbu  $8, 0($1)         # encoding: [0x90,0x28,0x00,0x00]
552# CHECK-BE: lbu  $1, 1($1)         # encoding: [0x90,0x21,0x00,0x01]
553# CHECK-BE: sll  $8, $8, 8         # encoding: [0x00,0x08,0x42,0x00]
554# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
555# CHECK-LE: lui  $1, 65535         # encoding: [0xff,0xff,0x01,0x3c]
556# CHECK-LE: ori  $1, $1, 32767     # encoding: [0xff,0x7f,0x21,0x34]
557# CHECK-LE: addu $1, $1, $9        # encoding: [0x21,0x08,0x29,0x00]
558# CHECK-LE: lbu  $8, 1($1)         # encoding: [0x01,0x00,0x28,0x90]
559# CHECK-LE: lbu  $1, 0($1)         # encoding: [0x00,0x00,0x21,0x90]
560# CHECK-LE: sll  $8, $8, 8         # encoding: [0x00,0x42,0x08,0x00]
561# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
562
563  ulhu $8, 32767($9)
564# CHECK-BE: addiu   $1, $9, 32767  # encoding: [0x25,0x21,0x7f,0xff]
565# CHECK-BE: lbu  $8, 0($1)         # encoding: [0x90,0x28,0x00,0x00]
566# CHECK-BE: lbu  $1, 1($1)         # encoding: [0x90,0x21,0x00,0x01]
567# CHECK-BE: sll  $8, $8, 8         # encoding: [0x00,0x08,0x42,0x00]
568# CHECK-BE: or   $8, $8, $1        # encoding: [0x01,0x01,0x40,0x25]
569# CHECK-LE: addiu $1, $9, 32767    # encoding: [0xff,0x7f,0x21,0x25]
570# CHECK-LE: lbu  $8, 1($1)         # encoding: [0x01,0x00,0x28,0x90]
571# CHECK-LE: lbu  $1, 0($1)         # encoding: [0x00,0x00,0x21,0x90]
572# CHECK-LE: sll  $8, $8, 8         # encoding: [0x00,0x42,0x08,0x00]
573# CHECK-LE: or   $8, $8, $1        # encoding: [0x25,0x40,0x01,0x01]
574
575# Test ULW with immediate operand.
576  ulw $8, 0
577# CHECK-BE: lwl  $8, 0($zero)      # encoding: [0x88,0x08,0x00,0x00]
578# CHECK-BE: lwr  $8, 3($zero)      # encoding: [0x98,0x08,0x00,0x03]
579# CHECK-LE: lwl $8, 3($zero)       # encoding: [0x03,0x00,0x08,0x88]
580# CHECK-LE: lwr $8, 0($zero)       # encoding: [0x00,0x00,0x08,0x98]
581
582  ulw $8, 2
583# CHECK-BE: lwl  $8, 2($zero)      # encoding: [0x88,0x08,0x00,0x02]
584# CHECK-BE: lwr  $8, 5($zero)      # encoding: [0x98,0x08,0x00,0x05]
585# CHECK-LE: lwl $8, 5($zero)       # encoding: [0x05,0x00,0x08,0x88]
586# CHECK-LE: lwr $8, 2($zero)       # encoding: [0x02,0x00,0x08,0x98]
587
588  ulw $8, 0x8000
589# CHECK-BE: ori  $1, $zero, 32768  # encoding: [0x34,0x01,0x80,0x00]
590# CHECK-BE: lwl  $8, 0($1)         # encoding: [0x88,0x28,0x00,0x00]
591# CHECK-BE: lwr  $8, 3($1)         # encoding: [0x98,0x28,0x00,0x03]
592# CHECK-LE: ori $1, $zero, 32768   # encoding: [0x00,0x80,0x01,0x34]
593# CHECK-LE: lwl $8, 3($1)          # encoding: [0x03,0x00,0x28,0x88]
594# CHECK-LE: lwr $8, 0($1)          # encoding: [0x00,0x00,0x28,0x98]
595
596  ulw $8, -0x8000
597# CHECK-BE: lwl  $8, -32768($zero) # encoding: [0x88,0x08,0x80,0x00]
598# CHECK-BE: lwr  $8, -32765($zero) # encoding: [0x98,0x08,0x80,0x03]
599# CHECK-LE: lwl $8, -32765($zero)  # encoding: [0x03,0x80,0x08,0x88]
600# CHECK-LE: lwr $8, -32768($zero)  # encoding: [0x00,0x80,0x08,0x98]
601
602  ulw $8, 0x10000
603# CHECK-BE: lui  $1, 1             # encoding: [0x3c,0x01,0x00,0x01]
604# CHECK-BE: lwl  $8, 0($1)         # encoding: [0x88,0x28,0x00,0x00]
605# CHECK-BE: lwr  $8, 3($1)         # encoding: [0x98,0x28,0x00,0x03]
606# CHECK-LE: lui $1, 1              # encoding: [0x01,0x00,0x01,0x3c]
607# CHECK-LE: lwl $8, 3($1)          # encoding: [0x03,0x00,0x28,0x88]
608# CHECK-LE: lwr $8, 0($1)          # encoding: [0x00,0x00,0x28,0x98]
609
610  ulw $8, 0x18888
611# CHECK-BE: lui  $1, 1             # encoding: [0x3c,0x01,0x00,0x01]
612# CHECK-BE: ori  $1, $1, 34952     # encoding: [0x34,0x21,0x88,0x88]
613# CHECK-BE: lwl  $8, 0($1)         # encoding: [0x88,0x28,0x00,0x00]
614# CHECK-BE: lwr  $8, 3($1)         # encoding: [0x98,0x28,0x00,0x03]
615# CHECK-LE: lui $1, 1              # encoding: [0x01,0x00,0x01,0x3c]
616# CHECK-LE: ori $1, $1, 34952      # encoding: [0x88,0x88,0x21,0x34]
617# CHECK-LE: lwl $8, 3($1)          # encoding: [0x03,0x00,0x28,0x88]
618# CHECK-LE: lwr $8, 0($1)          # encoding: [0x00,0x00,0x28,0x98]
619
620  ulw $8, -32771
621# CHECK-BE: lui  $1, 65535         # encoding: [0x3c,0x01,0xff,0xff]
622# CHECK-BE: ori  $1, $1, 32765     # encoding: [0x34,0x21,0x7f,0xfd]
623# CHECK-BE: lwl  $8, 0($1)         # encoding: [0x88,0x28,0x00,0x00]
624# CHECK-BE: lwr  $8, 3($1)         # encoding: [0x98,0x28,0x00,0x03]
625# CHECK-LE: lui $1, 65535          # encoding: [0xff,0xff,0x01,0x3c]
626# CHECK-LE: ori $1, $1, 32765      # encoding: [0xfd,0x7f,0x21,0x34]
627# CHECK-LE: lwl $8, 3($1)          # encoding: [0x03,0x00,0x28,0x88]
628# CHECK-LE: lwr $8, 0($1)          # encoding: [0x00,0x00,0x28,0x98]
629
630  ulw $8, 32765
631# CHECK-BE: addiu $1, $zero, 32765 # encoding: [0x24,0x01,0x7f,0xfd]
632# CHECK-BE: lwl  $8, 0($1)         # encoding: [0x88,0x28,0x00,0x00]
633# CHECK-BE: lwr  $8, 3($1)         # encoding: [0x98,0x28,0x00,0x03]
634# CHECK-LE: addiu $1, $zero, 32765 # encoding: [0xfd,0x7f,0x01,0x24]
635# CHECK-LE: lwl $8, 3($1)          # encoding: [0x03,0x00,0x28,0x88]
636# CHECK-LE: lwr $8, 0($1)          # encoding: [0x00,0x00,0x28,0x98]
637
638# Test ULW with immediate offset and a source register operand.
639  ulw $8, 0($9)
640# CHECK-BE: lwl  $8, 0($9)         # encoding: [0x89,0x28,0x00,0x00]
641# CHECK-BE: lwr  $8, 3($9)         # encoding: [0x99,0x28,0x00,0x03]
642# CHECK-LE: lwl  $8, 3($9)         # encoding: [0x03,0x00,0x28,0x89]
643# CHECK-LE: lwr  $8, 0($9)         # encoding: [0x00,0x00,0x28,0x99]
644
645  ulw $8, 2($9)
646# CHECK-BE: lwl  $8, 2($9)         # encoding: [0x89,0x28,0x00,0x02]
647# CHECK-BE: lwr  $8, 5($9)         # encoding: [0x99,0x28,0x00,0x05]
648# CHECK-LE: lwl  $8, 5($9)         # encoding: [0x05,0x00,0x28,0x89]
649# CHECK-LE: lwr  $8, 2($9)         # encoding: [0x02,0x00,0x28,0x99]
650
651  ulw $8, 0x8000($9)
652# CHECK-BE: ori  $1, $zero, 32768  # encoding: [0x34,0x01,0x80,0x00]
653# CHECK-BE: addu $1, $1, $9        # encoding: [0x00,0x29,0x08,0x21]
654# CHECK-BE: lwl  $8, 0($1)         # encoding: [0x88,0x28,0x00,0x00]
655# CHECK-BE: lwr  $8, 3($1)         # encoding: [0x98,0x28,0x00,0x03]
656# CHECK-LE: ori  $1, $zero, 32768  # encoding: [0x00,0x80,0x01,0x34]
657# CHECK-LE: addu $1, $1, $9        # encoding: [0x21,0x08,0x29,0x00]
658# CHECK-LE: lwl  $8, 3($1)         # encoding: [0x03,0x00,0x28,0x88]
659# CHECK-LE: lwr  $8, 0($1)         # encoding: [0x00,0x00,0x28,0x98]
660
661  ulw $8, -0x8000($9)
662# CHECK-BE: lwl  $8, -32768($9)    # encoding: [0x89,0x28,0x80,0x00]
663# CHECK-BE: lwr  $8, -32765($9)    # encoding: [0x99,0x28,0x80,0x03]
664# CHECK-LE: lwl  $8, -32765($9)    # encoding: [0x03,0x80,0x28,0x89]
665# CHECK-LE: lwr  $8, -32768($9)    # encoding: [0x00,0x80,0x28,0x99]
666
667  ulw $8, 0x10000($9)
668# CHECK-BE: lui  $1, 1             # encoding: [0x3c,0x01,0x00,0x01]
669# CHECK-BE: addu $1, $1, $9        # encoding: [0x00,0x29,0x08,0x21]
670# CHECK-BE: lwl  $8, 0($1)         # encoding: [0x88,0x28,0x00,0x00]
671# CHECK-BE: lwr  $8, 3($1)         # encoding: [0x98,0x28,0x00,0x03]
672# CHECK-LE: lui  $1, 1             # encoding: [0x01,0x00,0x01,0x3c]
673# CHECK-LE: addu $1, $1, $9        # encoding: [0x21,0x08,0x29,0x00]
674# CHECK-LE: lwl  $8, 3($1)         # encoding: [0x03,0x00,0x28,0x88]
675# CHECK-LE: lwr  $8, 0($1)         # encoding: [0x00,0x00,0x28,0x98]
676
677  ulw $8, 0x18888($9)
678# CHECK-BE: lui  $1, 1             # encoding: [0x3c,0x01,0x00,0x01]
679# CHECK-BE: ori  $1, $1, 34952     # encoding: [0x34,0x21,0x88,0x88]
680# CHECK-BE: addu $1, $1, $9        # encoding: [0x00,0x29,0x08,0x21]
681# CHECK-BE: lwl  $8, 0($1)         # encoding: [0x88,0x28,0x00,0x00]
682# CHECK-BE: lwr  $8, 3($1)         # encoding: [0x98,0x28,0x00,0x03]
683# CHECK-LE: lui  $1, 1             # encoding: [0x01,0x00,0x01,0x3c]
684# CHECK-LE: ori  $1, $1, 34952     # encoding: [0x88,0x88,0x21,0x34]
685# CHECK-LE: addu $1, $1, $9        # encoding: [0x21,0x08,0x29,0x00]
686# CHECK-LE: lwl  $8, 3($1)         # encoding: [0x03,0x00,0x28,0x88]
687# CHECK-LE: lwr  $8, 0($1)         # encoding: [0x00,0x00,0x28,0x98]
688
689  ulw $8, -32771($9)
690# CHECK-BE: lui  $1, 65535         # encoding: [0x3c,0x01,0xff,0xff]
691# CHECK-BE: ori  $1, $1, 32765     # encoding: [0x34,0x21,0x7f,0xfd]
692# CHECK-BE: addu $1, $1, $9        # encoding: [0x00,0x29,0x08,0x21]
693# CHECK-BE: lwl  $8, 0($1)         # encoding: [0x88,0x28,0x00,0x00]
694# CHECK-BE: lwr  $8, 3($1)         # encoding: [0x98,0x28,0x00,0x03]
695# CHECK-LE: lui  $1, 65535         # encoding: [0xff,0xff,0x01,0x3c]
696# CHECK-LE: ori  $1, $1, 32765     # encoding: [0xfd,0x7f,0x21,0x34]
697# CHECK-LE: addu $1, $1, $9        # encoding: [0x21,0x08,0x29,0x00]
698# CHECK-LE: lwl  $8, 3($1)         # encoding: [0x03,0x00,0x28,0x88]
699# CHECK-LE: lwr  $8, 0($1)         # encoding: [0x00,0x00,0x28,0x98]
700
701  ulw $8, 32765($9)
702# CHECK-BE: addiu $1, $9, 32765    # encoding: [0x25,0x21,0x7f,0xfd]
703# CHECK-BE: lwl  $8, 0($1)         # encoding: [0x88,0x28,0x00,0x00]
704# CHECK-BE: lwr  $8, 3($1)         # encoding: [0x98,0x28,0x00,0x03]
705# CHECK-LE: addiu $1, $9, 32765    # encoding: [0xfd,0x7f,0x21,0x25]
706# CHECK-LE: lwl  $8, 3($1)         # encoding: [0x03,0x00,0x28,0x88]
707# CHECK-LE: lwr  $8, 0($1)         # encoding: [0x00,0x00,0x28,0x98]
708
709  ulw $8, 0($8)
710# CHECK-BE: lwl $1, 0($8)          # encoding: [0x89,0x01,0x00,0x00]
711# CHECK-BE: lwr $1, 3($8)          # encoding: [0x99,0x01,0x00,0x03]
712# CHECK-BE: move $8, $1            # encoding: [0x00,0x20,0x40,0x25]
713# CHECK-LE: lwl $1, 3($8)          # encoding: [0x03,0x00,0x01,0x89]
714# CHECK-LE: lwr $1, 0($8)          # encoding: [0x00,0x00,0x01,0x99]
715# CHECK-LE: move $8, $1            # encoding: [0x25,0x40,0x20,0x00]
716
717  ulw $8, 2($8)
718# CHECK-BE: lwl $1, 2($8)          # encoding: [0x89,0x01,0x00,0x02]
719# CHECK-BE: lwr $1, 5($8)          # encoding: [0x99,0x01,0x00,0x05]
720# CHECK-BE: move $8, $1            # encoding: [0x00,0x20,0x40,0x25]
721# CHECK-LE: lwl $1, 5($8)          # encoding: [0x05,0x00,0x01,0x89]
722# CHECK-LE: lwr $1, 2($8)          # encoding: [0x02,0x00,0x01,0x99]
723# CHECK-LE: move $8, $1            # encoding: [0x25,0x40,0x20,0x00]
724
725  ulw $8, 0x8000($8)
726# CHECK-BE: ori $1, $zero, 32768   # encoding: [0x34,0x01,0x80,0x00]
727# CHECK-BE: addu $1, $1, $8        # encoding: [0x00,0x28,0x08,0x21]
728# CHECK-BE: lwl $8, 0($1)          # encoding: [0x88,0x28,0x00,0x00]
729# CHECK-BE: lwr $8, 3($1)          # encoding: [0x98,0x28,0x00,0x03]
730# CHECK-LE: ori $1, $zero, 32768   # encoding: [0x00,0x80,0x01,0x34]
731# CHECK-LE: addu $1, $1, $8        # encoding: [0x21,0x08,0x28,0x00]
732# CHECK-LE: lwl $8, 3($1)          # encoding: [0x03,0x00,0x28,0x88]
733# CHECK-LE: lwr $8, 0($1)          # encoding: [0x00,0x00,0x28,0x98]
734
735  ulw $8, -0x8000($8)
736# CHECK-BE: lwl $1, -32768($8)     # encoding: [0x89,0x01,0x80,0x00]
737# CHECK-BE: lwr $1, -32765($8)     # encoding: [0x99,0x01,0x80,0x03]
738# CHECK-BE: move $8, $1            # encoding: [0x00,0x20,0x40,0x25]
739# CHECK-LE: lwl $1, -32765($8)     # encoding: [0x03,0x80,0x01,0x89]
740# CHECK-LE: lwr $1, -32768($8)     # encoding: [0x00,0x80,0x01,0x99]
741# CHECK-LE: move $8, $1            # encoding: [0x25,0x40,0x20,0x00]
742
743  ulw $8, 0x10000($8)
744# CHECK-BE: lui $1, 1              # encoding: [0x3c,0x01,0x00,0x01]
745# CHECK-BE: addu $1, $1, $8        # encoding: [0x00,0x28,0x08,0x21]
746# CHECK-BE: lwl $8, 0($1)          # encoding: [0x88,0x28,0x00,0x00]
747# CHECK-BE: lwr $8, 3($1)          # encoding: [0x98,0x28,0x00,0x03]
748# CHECK-LE: lui $1, 1              # encoding: [0x01,0x00,0x01,0x3c]
749# CHECK-LE: addu $1, $1, $8        # encoding: [0x21,0x08,0x28,0x00]
750# CHECK-LE: lwl $8, 3($1)          # encoding: [0x03,0x00,0x28,0x88]
751# CHECK-LE: lwr $8, 0($1)          # encoding: [0x00,0x00,0x28,0x98]
752
753  ulw $8, 0x18888($8)
754# CHECK-BE: lui $1, 1              # encoding: [0x3c,0x01,0x00,0x01]
755# CHECK-BE: ori $1, $1, 34952      # encoding: [0x34,0x21,0x88,0x88]
756# CHECK-BE: addu $1, $1, $8        # encoding: [0x00,0x28,0x08,0x21]
757# CHECK-BE: lwl $8, 0($1)          # encoding: [0x88,0x28,0x00,0x00]
758# CHECK-BE: lwr $8, 3($1)          # encoding: [0x98,0x28,0x00,0x03]
759# CHECK-LE: lui $1, 1              # encoding: [0x01,0x00,0x01,0x3c]
760# CHECK-LE: ori $1, $1, 34952      # encoding: [0x88,0x88,0x21,0x34]
761# CHECK-LE: addu $1, $1, $8        # encoding: [0x21,0x08,0x28,0x00]
762# CHECK-LE: lwl $8, 3($1)          # encoding: [0x03,0x00,0x28,0x88]
763# CHECK-LE: lwr $8, 0($1)          # encoding: [0x00,0x00,0x28,0x98]
764
765  ulw $8, -32771($8)
766# CHECK-BE: lui $1, 65535          # encoding: [0x3c,0x01,0xff,0xff]
767# CHECK-BE: ori $1, $1, 32765      # encoding: [0x34,0x21,0x7f,0xfd]
768# CHECK-BE: addu $1, $1, $8        # encoding: [0x00,0x28,0x08,0x21]
769# CHECK-BE: lwl $8, 0($1)          # encoding: [0x88,0x28,0x00,0x00]
770# CHECK-BE: lwr $8, 3($1)          # encoding: [0x98,0x28,0x00,0x03]
771# CHECK-LE: lui $1, 65535          # encoding: [0xff,0xff,0x01,0x3c]
772# CHECK-LE: ori $1, $1, 32765      # encoding: [0xfd,0x7f,0x21,0x34]
773# CHECK-LE: addu $1, $1, $8        # encoding: [0x21,0x08,0x28,0x00]
774# CHECK-LE: lwl $8, 3($1)          # encoding: [0x03,0x00,0x28,0x88]
775# CHECK-LE: lwr $8, 0($1)          # encoding: [0x00,0x00,0x28,0x98]
776
777  ulw $8, 32765($8)
778# CHECK-BE: addiu $1, $8, 32765    # encoding: [0x25,0x01,0x7f,0xfd]
779# CHECK-BE: lwl $8, 0($1)          # encoding: [0x88,0x28,0x00,0x00]
780# CHECK-BE: lwr $8, 3($1)          # encoding: [0x98,0x28,0x00,0x03]
781# CHECK-LE: addiu $1, $8, 32765    # encoding: [0xfd,0x7f,0x01,0x25]
782# CHECK-LE: lwl $8, 3($1)          # encoding: [0x03,0x00,0x28,0x88]
783# CHECK-LE: lwr $8, 0($1)          # encoding: [0x00,0x00,0x28,0x98]
784
785ush_imm: # CHECK-LABEL: ush_imm
786  ush $8, 0
787  # CHECK-BE: sb        $8, 1($zero)            # encoding: [0xa0,0x08,0x00,0x01]
788  # CHECK-BE: srl       $1, $8, 8               # encoding: [0x00,0x08,0x0a,0x02]
789  # CHECK-BE: sb        $1, 0($zero)            # encoding: [0xa0,0x01,0x00,0x00]
790  # CHECK-LE: sb        $8, 0($zero)            # encoding: [0x00,0x00,0x08,0xa0]
791  # CHECK-LE: srl       $1, $8, 8               # encoding: [0x02,0x0a,0x08,0x00]
792  # CHECK-LE: sb        $1, 1($zero)            # encoding: [0x01,0x00,0x01,0xa0]
793
794  ush $8, 2
795  # CHECK-BE: sb        $8, 3($zero)            # encoding: [0xa0,0x08,0x00,0x03]
796  # CHECK-BE: srl       $1, $8, 8               # encoding: [0x00,0x08,0x0a,0x02]
797  # CHECK-BE: sb        $1, 2($zero)            # encoding: [0xa0,0x01,0x00,0x02]
798  # CHECK-LE: sb        $8, 2($zero)            # encoding: [0x02,0x00,0x08,0xa0]
799  # CHECK-LE: srl       $1, $8, 8               # encoding: [0x02,0x0a,0x08,0x00]
800  # CHECK-LE: sb        $1, 3($zero)            # encoding: [0x03,0x00,0x01,0xa0]
801
802  # FIXME: Remove the identity moves (move $1, $1) coming from loadImmediate
803  ush $8, 0x8000
804  # CHECK-BE: ori       $1, $zero, 32768        # encoding: [0x34,0x01,0x80,0x00]
805  # CHECK-BE: move      $1, $1                  # encoding: [0x00,0x20,0x08,0x21]
806  # CHECK-BE: sb        $8, 1($1)               # encoding: [0xa0,0x28,0x00,0x01]
807  # CHECK-BE: srl       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x02]
808  # CHECK-BE: sb        $8, 0($1)               # encoding: [0xa0,0x28,0x00,0x00]
809  # CHECK-BE: lbu       $1, 0($1)               # encoding: [0x90,0x21,0x00,0x00]
810  # CHECK-BE: sll       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x00]
811  # CHECK-BE: or        $8, $8, $1              # encoding: [0x01,0x01,0x40,0x25]
812  # CHECK-LE: ori       $1, $zero, 32768        # encoding: [0x00,0x80,0x01,0x34]
813  # CHECK-LE: move      $1, $1                  # encoding: [0x21,0x08,0x20,0x00]
814  # CHECK-LE: sb        $8, 0($1)               # encoding: [0x00,0x00,0x28,0xa0]
815  # CHECK-LE: srl       $8, $8, 8               # encoding: [0x02,0x42,0x08,0x00]
816  # CHECK-LE: sb        $8, 1($1)               # encoding: [0x01,0x00,0x28,0xa0]
817  # CHECK-LE: lbu       $1, 0($1)               # encoding: [0x00,0x00,0x21,0x90]
818  # CHECK-LE: sll       $8, $8, 8               # encoding: [0x00,0x42,0x08,0x00]
819  # CHECK-LE: or        $8, $8, $1              # encoding: [0x25,0x40,0x01,0x01]
820
821  ush $8, -0x8000
822  # CHECK-BE: sb        $8, -32767($zero)       # encoding: [0xa0,0x08,0x80,0x01]
823  # CHECK-BE: srl       $1, $8, 8               # encoding: [0x00,0x08,0x0a,0x02]
824  # CHECK-BE: sb        $1, -32768($zero)       # encoding: [0xa0,0x01,0x80,0x00]
825  # CHECK-LE: sb        $8, -32768($zero)       # encoding: [0x00,0x80,0x08,0xa0]
826  # CHECK-LE: srl       $1, $8, 8               # encoding: [0x02,0x0a,0x08,0x00]
827  # CHECK-LE: sb        $1, -32767($zero)       # encoding: [0x01,0x80,0x01,0xa0]
828
829  # FIXME: Remove the identity moves (move $1, $1) coming from loadImmediate
830  ush $8, 0x10000
831  # CHECK-BE: lui       $1, 1                   # encoding: [0x3c,0x01,0x00,0x01]
832  # CHECK-BE: move      $1, $1                  # encoding: [0x00,0x20,0x08,0x21]
833  # CHECK-BE: sb        $8, 1($1)               # encoding: [0xa0,0x28,0x00,0x01]
834  # CHECK-BE: srl       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x02]
835  # CHECK-BE: sb        $8, 0($1)               # encoding: [0xa0,0x28,0x00,0x00]
836  # CHECK-BE: lbu       $1, 0($1)               # encoding: [0x90,0x21,0x00,0x00]
837  # CHECK-BE: sll       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x00]
838  # CHECK-BE: or        $8, $8, $1              # encoding: [0x01,0x01,0x40,0x25]
839  # CHECK-LE: lui       $1, 1                   # encoding: [0x01,0x00,0x01,0x3c]
840  # CHECK-LE: move      $1, $1                  # encoding: [0x21,0x08,0x20,0x00]
841  # CHECK-LE: sb        $8, 0($1)               # encoding: [0x00,0x00,0x28,0xa0]
842  # CHECK-LE: srl       $8, $8, 8               # encoding: [0x02,0x42,0x08,0x00]
843  # CHECK-LE: sb        $8, 1($1)               # encoding: [0x01,0x00,0x28,0xa0]
844  # CHECK-LE: lbu       $1, 0($1)               # encoding: [0x00,0x00,0x21,0x90]
845  # CHECK-LE: sll       $8, $8, 8               # encoding: [0x00,0x42,0x08,0x00]
846  # CHECK-LE: or        $8, $8, $1              # encoding: [0x25,0x40,0x01,0x01]
847
848  # FIXME: Remove the identity moves (move $1, $1) coming from loadImmediate
849  ush $8, 0x18888
850  # CHECK-BE: lui       $1, 1                   # encoding: [0x3c,0x01,0x00,0x01]
851  # CHECK-BE: ori       $1, $1, 34952           # encoding: [0x34,0x21,0x88,0x88]
852  # CHECK-BE: move      $1, $1                  # encoding: [0x00,0x20,0x08,0x21]
853  # CHECK-BE: sb        $8, 1($1)               # encoding: [0xa0,0x28,0x00,0x01]
854  # CHECK-BE: srl       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x02]
855  # CHECK-BE: sb        $8, 0($1)               # encoding: [0xa0,0x28,0x00,0x00]
856  # CHECK-BE: lbu       $1, 0($1)               # encoding: [0x90,0x21,0x00,0x00]
857  # CHECK-BE: sll       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x00]
858  # CHECK-BE: or        $8, $8, $1              # encoding: [0x01,0x01,0x40,0x25]
859  # CHECK-LE: lui       $1, 1                   # encoding: [0x01,0x00,0x01,0x3c]
860  # CHECK-LE: ori       $1, $1, 34952           # encoding: [0x88,0x88,0x21,0x34]
861  # CHECK-LE: move      $1, $1                  # encoding: [0x21,0x08,0x20,0x00]
862  # CHECK-LE: sb        $8, 0($1)               # encoding: [0x00,0x00,0x28,0xa0]
863  # CHECK-LE: srl       $8, $8, 8               # encoding: [0x02,0x42,0x08,0x00]
864  # CHECK-LE: sb        $8, 1($1)               # encoding: [0x01,0x00,0x28,0xa0]
865  # CHECK-LE: lbu       $1, 0($1)               # encoding: [0x00,0x00,0x21,0x90]
866  # CHECK-LE: sll       $8, $8, 8               # encoding: [0x00,0x42,0x08,0x00]
867  # CHECK-LE: or        $8, $8, $1              # encoding: [0x25,0x40,0x01,0x01]
868
869  # FIXME: Remove the identity moves (move $1, $1) coming from loadImmediate
870  ush $8, -32769
871  # CHECK-BE: lui       $1, 65535               # encoding: [0x3c,0x01,0xff,0xff]
872  # CHECK-BE: ori       $1, $1, 32767           # encoding: [0x34,0x21,0x7f,0xff]
873  # CHECK-BE: move      $1, $1                  # encoding: [0x00,0x20,0x08,0x21]
874  # CHECK-BE: sb        $8, 1($1)               # encoding: [0xa0,0x28,0x00,0x01]
875  # CHECK-BE: srl       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x02]
876  # CHECK-BE: sb        $8, 0($1)               # encoding: [0xa0,0x28,0x00,0x00]
877  # CHECK-BE: lbu       $1, 0($1)               # encoding: [0x90,0x21,0x00,0x00]
878  # CHECK-BE: sll       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x00]
879  # CHECK-BE: or        $8, $8, $1              # encoding: [0x01,0x01,0x40,0x25]
880  # CHECK-LE: lui       $1, 65535               # encoding: [0xff,0xff,0x01,0x3c]
881  # CHECK-LE: ori       $1, $1, 32767           # encoding: [0xff,0x7f,0x21,0x34]
882  # CHECK-LE: move      $1, $1                  # encoding: [0x21,0x08,0x20,0x00]
883  # CHECK-LE: sb        $8, 0($1)               # encoding: [0x00,0x00,0x28,0xa0]
884  # CHECK-LE: srl       $8, $8, 8               # encoding: [0x02,0x42,0x08,0x00]
885  # CHECK-LE: sb        $8, 1($1)               # encoding: [0x01,0x00,0x28,0xa0]
886  # CHECK-LE: lbu       $1, 0($1)               # encoding: [0x00,0x00,0x21,0x90]
887  # CHECK-LE: sll       $8, $8, 8               # encoding: [0x00,0x42,0x08,0x00]
888  # CHECK-LE: or        $8, $8, $1              # encoding: [0x25,0x40,0x01,0x01]
889
890  ush $8, 32767
891  # CHECK-BE: addiu     $1, $zero, 32767        # encoding: [0x24,0x01,0x7f,0xff]
892  # CHECK-BE: sb        $8, 1($1)               # encoding: [0xa0,0x28,0x00,0x01]
893  # CHECK-BE: srl       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x02]
894  # CHECK-BE: sb        $8, 0($1)               # encoding: [0xa0,0x28,0x00,0x00]
895  # CHECK-BE: lbu       $1, 0($1)               # encoding: [0x90,0x21,0x00,0x00]
896  # CHECK-BE: sll       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x00]
897  # CHECK-BE: or        $8, $8, $1              # encoding: [0x01,0x01,0x40,0x25]
898  # CHECK-LE: addiu     $1, $zero, 32767        # encoding: [0xff,0x7f,0x01,0x24]
899  # CHECK-LE: sb        $8, 0($1)               # encoding: [0x00,0x00,0x28,0xa0]
900  # CHECK-LE: srl       $8, $8, 8               # encoding: [0x02,0x42,0x08,0x00]
901  # CHECK-LE: sb        $8, 1($1)               # encoding: [0x01,0x00,0x28,0xa0]
902  # CHECK-LE: lbu       $1, 0($1)               # encoding: [0x00,0x00,0x21,0x90]
903  # CHECK-LE: sll       $8, $8, 8               # encoding: [0x00,0x42,0x08,0x00]
904  # CHECK-LE: or        $8, $8, $1              # encoding: [0x25,0x40,0x01,0x01]
905
906ush_reg: # CHECK-LABEL: ush_reg
907  ush $8, 0($9)
908  # CHECK-BE: sb        $8, 1($9)               # encoding: [0xa1,0x28,0x00,0x01]
909  # CHECK-BE: srl       $1, $8, 8               # encoding: [0x00,0x08,0x0a,0x02]
910  # CHECK-BE: sb        $1, 0($9)               # encoding: [0xa1,0x21,0x00,0x00]
911  # CHECK-LE: sb        $8, 0($9)               # encoding: [0x00,0x00,0x28,0xa1]
912  # CHECK-LE: srl       $1, $8, 8               # encoding: [0x02,0x0a,0x08,0x00]
913  # CHECK-LE: sb        $1, 1($9)               # encoding: [0x01,0x00,0x21,0xa1]
914
915  ush $8, 2($9)
916  # CHECK-BE: sb        $8, 3($9)               # encoding: [0xa1,0x28,0x00,0x03]
917  # CHECK-BE: srl       $1, $8, 8               # encoding: [0x00,0x08,0x0a,0x02]
918  # CHECK-BE: sb        $1, 2($9)               # encoding: [0xa1,0x21,0x00,0x02]
919  # CHECK-LE: sb        $8, 2($9)               # encoding: [0x02,0x00,0x28,0xa1]
920  # CHECK-LE: srl       $1, $8, 8               # encoding: [0x02,0x0a,0x08,0x00]
921  # CHECK-LE: sb        $1, 3($9)               # encoding: [0x03,0x00,0x21,0xa1]
922
923  ush $8, 0x8000($9)
924  # CHECK-BE: ori       $1, $zero, 32768        # encoding: [0x34,0x01,0x80,0x00]
925  # CHECK-BE: addu      $1, $1, $9              # encoding: [0x00,0x29,0x08,0x21]
926  # CHECK-BE: sb        $8, 1($1)               # encoding: [0xa0,0x28,0x00,0x01]
927  # CHECK-BE: srl       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x02]
928  # CHECK-BE: sb        $8, 0($1)               # encoding: [0xa0,0x28,0x00,0x00]
929  # CHECK-BE: lbu       $1, 0($1)               # encoding: [0x90,0x21,0x00,0x00]
930  # CHECK-BE: sll       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x00]
931  # CHECK-BE: or        $8, $8, $1              # encoding: [0x01,0x01,0x40,0x25]
932  # CHECK-LE: ori       $1, $zero, 32768        # encoding: [0x00,0x80,0x01,0x34]
933  # CHECK-LE: addu      $1, $1, $9              # encoding: [0x21,0x08,0x29,0x00]
934  # CHECK-LE: sb        $8, 0($1)               # encoding: [0x00,0x00,0x28,0xa0]
935  # CHECK-LE: srl       $8, $8, 8               # encoding: [0x02,0x42,0x08,0x00]
936  # CHECK-LE: sb        $8, 1($1)               # encoding: [0x01,0x00,0x28,0xa0]
937  # CHECK-LE: lbu       $1, 0($1)               # encoding: [0x00,0x00,0x21,0x90]
938  # CHECK-LE: sll       $8, $8, 8               # encoding: [0x00,0x42,0x08,0x00]
939  # CHECK-LE: or        $8, $8, $1              # encoding: [0x25,0x40,0x01,0x01]
940
941  ush $8, -0x8000($9)
942  # CHECK-BE: sb        $8, -32767($9)          # encoding: [0xa1,0x28,0x80,0x01]
943  # CHECK-BE: srl       $1, $8, 8               # encoding: [0x00,0x08,0x0a,0x02]
944  # CHECK-BE: sb        $1, -32768($9)          # encoding: [0xa1,0x21,0x80,0x00]
945  # CHECK-LE: sb        $8, -32768($9)          # encoding: [0x00,0x80,0x28,0xa1]
946  # CHECK-LE: srl       $1, $8, 8               # encoding: [0x02,0x0a,0x08,0x00]
947  # CHECK-LE: sb        $1, -32767($9)          # encoding: [0x01,0x80,0x21,0xa1]
948
949  ush $8, 0x10000($9)
950  # CHECK-BE: lui       $1, 1                   # encoding: [0x3c,0x01,0x00,0x01]
951  # CHECK-BE: addu      $1, $1, $9              # encoding: [0x00,0x29,0x08,0x21]
952  # CHECK-BE: sb        $8, 1($1)               # encoding: [0xa0,0x28,0x00,0x01]
953  # CHECK-BE: srl       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x02]
954  # CHECK-BE: sb        $8, 0($1)               # encoding: [0xa0,0x28,0x00,0x00]
955  # CHECK-BE: lbu       $1, 0($1)               # encoding: [0x90,0x21,0x00,0x00]
956  # CHECK-BE: sll       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x00]
957  # CHECK-BE: or        $8, $8, $1              # encoding: [0x01,0x01,0x40,0x25]
958  # CHECK-LE: lui       $1, 1                   # encoding: [0x01,0x00,0x01,0x3c]
959  # CHECK-LE: addu      $1, $1, $9              # encoding: [0x21,0x08,0x29,0x00]
960  # CHECK-LE: sb        $8, 0($1)               # encoding: [0x00,0x00,0x28,0xa0]
961  # CHECK-LE: srl       $8, $8, 8               # encoding: [0x02,0x42,0x08,0x00]
962  # CHECK-LE: sb        $8, 1($1)               # encoding: [0x01,0x00,0x28,0xa0]
963  # CHECK-LE: lbu       $1, 0($1)               # encoding: [0x00,0x00,0x21,0x90]
964  # CHECK-LE: sll       $8, $8, 8               # encoding: [0x00,0x42,0x08,0x00]
965  # CHECK-LE: or        $8, $8, $1              # encoding: [0x25,0x40,0x01,0x01]
966
967  ush $8, 0x18888($9)
968  # CHECK-BE: lui       $1, 1                   # encoding: [0x3c,0x01,0x00,0x01]
969  # CHECK-BE: ori       $1, $1, 34952           # encoding: [0x34,0x21,0x88,0x88]
970  # CHECK-BE: addu      $1, $1, $9              # encoding: [0x00,0x29,0x08,0x21]
971  # CHECK-BE: sb        $8, 1($1)               # encoding: [0xa0,0x28,0x00,0x01]
972  # CHECK-BE: srl       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x02]
973  # CHECK-BE: sb        $8, 0($1)               # encoding: [0xa0,0x28,0x00,0x00]
974  # CHECK-BE: lbu       $1, 0($1)               # encoding: [0x90,0x21,0x00,0x00]
975  # CHECK-BE: sll       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x00]
976  # CHECK-BE: or        $8, $8, $1              # encoding: [0x01,0x01,0x40,0x25]
977  # CHECK-LE: lui       $1, 1                   # encoding: [0x01,0x00,0x01,0x3c]
978  # CHECK-LE: ori       $1, $1, 34952           # encoding: [0x88,0x88,0x21,0x34]
979  # CHECK-LE: addu      $1, $1, $9              # encoding: [0x21,0x08,0x29,0x00]
980  # CHECK-LE: sb        $8, 0($1)               # encoding: [0x00,0x00,0x28,0xa0]
981  # CHECK-LE: srl       $8, $8, 8               # encoding: [0x02,0x42,0x08,0x00]
982  # CHECK-LE: sb        $8, 1($1)               # encoding: [0x01,0x00,0x28,0xa0]
983  # CHECK-LE: lbu       $1, 0($1)               # encoding: [0x00,0x00,0x21,0x90]
984  # CHECK-LE: sll       $8, $8, 8               # encoding: [0x00,0x42,0x08,0x00]
985  # CHECK-LE: or        $8, $8, $1              # encoding: [0x25,0x40,0x01,0x01]
986
987  ush $8, -32769($9)
988  # CHECK-BE: lui       $1, 65535               # encoding: [0x3c,0x01,0xff,0xff]
989  # CHECK-BE: ori       $1, $1, 32767           # encoding: [0x34,0x21,0x7f,0xff]
990  # CHECK-BE: addu      $1, $1, $9              # encoding: [0x00,0x29,0x08,0x21]
991  # CHECK-BE: sb        $8, 1($1)               # encoding: [0xa0,0x28,0x00,0x01]
992  # CHECK-BE: srl       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x02]
993  # CHECK-BE: sb        $8, 0($1)               # encoding: [0xa0,0x28,0x00,0x00]
994  # CHECK-BE: lbu       $1, 0($1)               # encoding: [0x90,0x21,0x00,0x00]
995  # CHECK-BE: sll       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x00]
996  # CHECK-BE: or        $8, $8, $1              # encoding: [0x01,0x01,0x40,0x25]
997  # CHECK-LE: lui       $1, 65535               # encoding: [0xff,0xff,0x01,0x3c]
998  # CHECK-LE: ori       $1, $1, 32767           # encoding: [0xff,0x7f,0x21,0x34]
999  # CHECK-LE: addu      $1, $1, $9              # encoding: [0x21,0x08,0x29,0x00]
1000  # CHECK-LE: sb        $8, 0($1)               # encoding: [0x00,0x00,0x28,0xa0]
1001  # CHECK-LE: srl       $8, $8, 8               # encoding: [0x02,0x42,0x08,0x00]
1002  # CHECK-LE: sb        $8, 1($1)               # encoding: [0x01,0x00,0x28,0xa0]
1003  # CHECK-LE: lbu       $1, 0($1)               # encoding: [0x00,0x00,0x21,0x90]
1004  # CHECK-LE: sll       $8, $8, 8               # encoding: [0x00,0x42,0x08,0x00]
1005  # CHECK-LE: or        $8, $8, $1              # encoding: [0x25,0x40,0x01,0x01]
1006
1007  ush $8, 32767($9)
1008  # CHECK-BE: addiu     $1, $9, 32767           # encoding: [0x25,0x21,0x7f,0xff]
1009  # CHECK-BE: sb        $8, 1($1)               # encoding: [0xa0,0x28,0x00,0x01]
1010  # CHECK-BE: srl       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x02]
1011  # CHECK-BE: sb        $8, 0($1)               # encoding: [0xa0,0x28,0x00,0x00]
1012  # CHECK-BE: lbu       $1, 0($1)               # encoding: [0x90,0x21,0x00,0x00]
1013  # CHECK-BE: sll       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x00]
1014  # CHECK-BE: or        $8, $8, $1              # encoding: [0x01,0x01,0x40,0x25]
1015  # CHECK-LE: addiu     $1, $9, 32767           # encoding: [0xff,0x7f,0x21,0x25]
1016  # CHECK-LE: sb        $8, 0($1)               # encoding: [0x00,0x00,0x28,0xa0]
1017  # CHECK-LE: srl       $8, $8, 8               # encoding: [0x02,0x42,0x08,0x00]
1018  # CHECK-LE: sb        $8, 1($1)               # encoding: [0x01,0x00,0x28,0xa0]
1019  # CHECK-LE: lbu       $1, 0($1)               # encoding: [0x00,0x00,0x21,0x90]
1020  # CHECK-LE: sll       $8, $8, 8               # encoding: [0x00,0x42,0x08,0x00]
1021  # CHECK-LE: or        $8, $8, $1              # encoding: [0x25,0x40,0x01,0x01]
1022
1023  ush $8, 0($8)
1024  # CHECK-BE: sb        $8, 1($8)               # encoding: [0xa1,0x08,0x00,0x01]
1025  # CHECK-BE: srl       $1, $8, 8               # encoding: [0x00,0x08,0x0a,0x02]
1026  # CHECK-BE: sb        $1, 0($8)               # encoding: [0xa1,0x01,0x00,0x00]
1027  # CHECK-LE: sb        $8, 0($8)               # encoding: [0x00,0x00,0x08,0xa1]
1028  # CHECK-LE: srl       $1, $8, 8               # encoding: [0x02,0x0a,0x08,0x00]
1029  # CHECK-LE: sb        $1, 1($8)               # encoding: [0x01,0x00,0x01,0xa1]
1030
1031  ush $8, 2($8)
1032  # CHECK-BE: sb        $8, 3($8)               # encoding: [0xa1,0x08,0x00,0x03]
1033  # CHECK-BE: srl       $1, $8, 8               # encoding: [0x00,0x08,0x0a,0x02]
1034  # CHECK-BE: sb        $1, 2($8)               # encoding: [0xa1,0x01,0x00,0x02]
1035  # CHECK-LE: sb        $8, 2($8)               # encoding: [0x02,0x00,0x08,0xa1]
1036  # CHECK-LE: srl       $1, $8, 8               # encoding: [0x02,0x0a,0x08,0x00]
1037  # CHECK-LE: sb        $1, 3($8)               # encoding: [0x03,0x00,0x01,0xa1]
1038
1039  ush $8, 0x8000($8)
1040  # CHECK-BE: ori       $1, $zero, 32768        # encoding: [0x34,0x01,0x80,0x00]
1041  # CHECK-BE: addu      $1, $1, $8              # encoding: [0x00,0x28,0x08,0x21]
1042  # CHECK-BE: sb        $8, 1($1)               # encoding: [0xa0,0x28,0x00,0x01]
1043  # CHECK-BE: srl       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x02]
1044  # CHECK-BE: sb        $8, 0($1)               # encoding: [0xa0,0x28,0x00,0x00]
1045  # CHECK-BE: lbu       $1, 0($1)               # encoding: [0x90,0x21,0x00,0x00]
1046  # CHECK-BE: sll       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x00]
1047  # CHECK-BE: or        $8, $8, $1              # encoding: [0x01,0x01,0x40,0x25]
1048  # CHECK-LE: ori       $1, $zero, 32768        # encoding: [0x00,0x80,0x01,0x34]
1049  # CHECK-LE: addu      $1, $1, $8              # encoding: [0x21,0x08,0x28,0x00]
1050  # CHECK-LE: sb        $8, 0($1)               # encoding: [0x00,0x00,0x28,0xa0]
1051  # CHECK-LE: srl       $8, $8, 8               # encoding: [0x02,0x42,0x08,0x00]
1052  # CHECK-LE: sb        $8, 1($1)               # encoding: [0x01,0x00,0x28,0xa0]
1053  # CHECK-LE: lbu       $1, 0($1)               # encoding: [0x00,0x00,0x21,0x90]
1054  # CHECK-LE: sll       $8, $8, 8               # encoding: [0x00,0x42,0x08,0x00]
1055  # CHECK-LE: or        $8, $8, $1              # encoding: [0x25,0x40,0x01,0x01]
1056
1057  ush $8, -0x8000($8)
1058  # CHECK-BE: sb        $8, -32767($8)          # encoding: [0xa1,0x08,0x80,0x01]
1059  # CHECK-BE: srl       $1, $8, 8               # encoding: [0x00,0x08,0x0a,0x02]
1060  # CHECK-BE: sb        $1, -32768($8)          # encoding: [0xa1,0x01,0x80,0x00]
1061  # CHECK-LE: sb        $8, -32768($8)          # encoding: [0x00,0x80,0x08,0xa1]
1062  # CHECK-LE: srl       $1, $8, 8               # encoding: [0x02,0x0a,0x08,0x00]
1063  # CHECK-LE: sb        $1, -32767($8)          # encoding: [0x01,0x80,0x01,0xa1]
1064
1065  ush $8, 0x10000($8)
1066  # CHECK-BE: lui       $1, 1                   # encoding: [0x3c,0x01,0x00,0x01]
1067  # CHECK-BE: addu      $1, $1, $8              # encoding: [0x00,0x28,0x08,0x21]
1068  # CHECK-BE: sb        $8, 1($1)               # encoding: [0xa0,0x28,0x00,0x01]
1069  # CHECK-BE: srl       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x02]
1070  # CHECK-BE: sb        $8, 0($1)               # encoding: [0xa0,0x28,0x00,0x00]
1071  # CHECK-BE: lbu       $1, 0($1)               # encoding: [0x90,0x21,0x00,0x00]
1072  # CHECK-BE: sll       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x00]
1073  # CHECK-BE: or        $8, $8, $1              # encoding: [0x01,0x01,0x40,0x25]
1074  # CHECK-LE: lui       $1, 1                   # encoding: [0x01,0x00,0x01,0x3c]
1075  # CHECK-LE: addu      $1, $1, $8              # encoding: [0x21,0x08,0x28,0x00]
1076  # CHECK-LE: sb        $8, 0($1)               # encoding: [0x00,0x00,0x28,0xa0]
1077  # CHECK-LE: srl       $8, $8, 8               # encoding: [0x02,0x42,0x08,0x00]
1078  # CHECK-LE: sb        $8, 1($1)               # encoding: [0x01,0x00,0x28,0xa0]
1079  # CHECK-LE: lbu       $1, 0($1)               # encoding: [0x00,0x00,0x21,0x90]
1080  # CHECK-LE: sll       $8, $8, 8               # encoding: [0x00,0x42,0x08,0x00]
1081  # CHECK-LE: or        $8, $8, $1              # encoding: [0x25,0x40,0x01,0x01]
1082
1083  ush $8, 0x18888($8)
1084  # CHECK-BE: lui       $1, 1                   # encoding: [0x3c,0x01,0x00,0x01]
1085  # CHECK-BE: ori       $1, $1, 34952           # encoding: [0x34,0x21,0x88,0x88]
1086  # CHECK-BE: addu      $1, $1, $8              # encoding: [0x00,0x28,0x08,0x21]
1087  # CHECK-BE: sb        $8, 1($1)               # encoding: [0xa0,0x28,0x00,0x01]
1088  # CHECK-BE: srl       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x02]
1089  # CHECK-BE: sb        $8, 0($1)               # encoding: [0xa0,0x28,0x00,0x00]
1090  # CHECK-BE: lbu       $1, 0($1)               # encoding: [0x90,0x21,0x00,0x00]
1091  # CHECK-BE: sll       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x00]
1092  # CHECK-BE: or        $8, $8, $1              # encoding: [0x01,0x01,0x40,0x25]
1093  # CHECK-LE: lui       $1, 1                   # encoding: [0x01,0x00,0x01,0x3c]
1094  # CHECK-LE: ori       $1, $1, 34952           # encoding: [0x88,0x88,0x21,0x34]
1095  # CHECK-LE: addu      $1, $1, $8              # encoding: [0x21,0x08,0x28,0x00]
1096  # CHECK-LE: sb        $8, 0($1)               # encoding: [0x00,0x00,0x28,0xa0]
1097  # CHECK-LE: srl       $8, $8, 8               # encoding: [0x02,0x42,0x08,0x00]
1098  # CHECK-LE: sb        $8, 1($1)               # encoding: [0x01,0x00,0x28,0xa0]
1099  # CHECK-LE: lbu       $1, 0($1)               # encoding: [0x00,0x00,0x21,0x90]
1100  # CHECK-LE: sll       $8, $8, 8               # encoding: [0x00,0x42,0x08,0x00]
1101  # CHECK-LE: or        $8, $8, $1              # encoding: [0x25,0x40,0x01,0x01]
1102
1103  ush $8, -32769($8)
1104  # CHECK-BE: lui       $1, 65535               # encoding: [0x3c,0x01,0xff,0xff]
1105  # CHECK-BE: ori       $1, $1, 32767           # encoding: [0x34,0x21,0x7f,0xff]
1106  # CHECK-BE: addu      $1, $1, $8              # encoding: [0x00,0x28,0x08,0x21]
1107  # CHECK-BE: sb        $8, 1($1)               # encoding: [0xa0,0x28,0x00,0x01]
1108  # CHECK-BE: srl       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x02]
1109  # CHECK-BE: sb        $8, 0($1)               # encoding: [0xa0,0x28,0x00,0x00]
1110  # CHECK-BE: lbu       $1, 0($1)               # encoding: [0x90,0x21,0x00,0x00]
1111  # CHECK-BE: sll       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x00]
1112  # CHECK-BE: or        $8, $8, $1              # encoding: [0x01,0x01,0x40,0x25]
1113  # CHECK-LE: lui       $1, 65535               # encoding: [0xff,0xff,0x01,0x3c]
1114  # CHECK-LE: ori       $1, $1, 32767           # encoding: [0xff,0x7f,0x21,0x34]
1115  # CHECK-LE: addu      $1, $1, $8              # encoding: [0x21,0x08,0x28,0x00]
1116  # CHECK-LE: sb        $8, 0($1)               # encoding: [0x00,0x00,0x28,0xa0]
1117  # CHECK-LE: srl       $8, $8, 8               # encoding: [0x02,0x42,0x08,0x00]
1118  # CHECK-LE: sb        $8, 1($1)               # encoding: [0x01,0x00,0x28,0xa0]
1119  # CHECK-LE: lbu       $1, 0($1)               # encoding: [0x00,0x00,0x21,0x90]
1120  # CHECK-LE: sll       $8, $8, 8               # encoding: [0x00,0x42,0x08,0x00]
1121  # CHECK-LE: or        $8, $8, $1              # encoding: [0x25,0x40,0x01,0x01]
1122
1123  ush $8, 32767($8)
1124  # CHECK-BE: addiu     $1, $8, 32767           # encoding: [0x25,0x01,0x7f,0xff]
1125  # CHECK-BE: sb        $8, 1($1)               # encoding: [0xa0,0x28,0x00,0x01]
1126  # CHECK-BE: srl       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x02]
1127  # CHECK-BE: sb        $8, 0($1)               # encoding: [0xa0,0x28,0x00,0x00]
1128  # CHECK-BE: lbu       $1, 0($1)               # encoding: [0x90,0x21,0x00,0x00]
1129  # CHECK-BE: sll       $8, $8, 8               # encoding: [0x00,0x08,0x42,0x00]
1130  # CHECK-BE: or        $8, $8, $1              # encoding: [0x01,0x01,0x40,0x25]
1131  # CHECK-LE: addiu     $1, $8, 32767           # encoding: [0xff,0x7f,0x01,0x25]
1132  # CHECK-LE: sb        $8, 0($1)               # encoding: [0x00,0x00,0x28,0xa0]
1133  # CHECK-LE: srl       $8, $8, 8               # encoding: [0x02,0x42,0x08,0x00]
1134  # CHECK-LE: sb        $8, 1($1)               # encoding: [0x01,0x00,0x28,0xa0]
1135  # CHECK-LE: lbu       $1, 0($1)               # encoding: [0x00,0x00,0x21,0x90]
1136  # CHECK-LE: sll       $8, $8, 8               # encoding: [0x00,0x42,0x08,0x00]
1137  # CHECK-LE: or        $8, $8, $1              # encoding: [0x25,0x40,0x01,0x01]
1138
1139usw_imm: # CHECK-LABEL: usw_imm:
1140  usw $8, 0
1141  # CHECK-BE:   swl     $8, 0($zero)            # encoding: [0xa8,0x08,0x00,0x00]
1142  # CHECK-BE:   swr     $8, 3($zero)            # encoding: [0xb8,0x08,0x00,0x03]
1143  # CHECK-LE:   swl     $8, 3($zero)            # encoding: [0x03,0x00,0x08,0xa8]
1144  # CHECK-LE:   swr     $8, 0($zero)            # encoding: [0x00,0x00,0x08,0xb8]
1145
1146  usw $8, 2
1147  # CHECK-BE:   swl     $8, 2($zero)            # encoding: [0xa8,0x08,0x00,0x02]
1148  # CHECK-BE:   swr     $8, 5($zero)            # encoding: [0xb8,0x08,0x00,0x05]
1149  # CHECK-LE:   swl     $8, 5($zero)            # encoding: [0x05,0x00,0x08,0xa8]
1150  # CHECK-LE:   swr     $8, 2($zero)            # encoding: [0x02,0x00,0x08,0xb8]
1151
1152  # FIXME: Remove the identity moves (move $1, $1) coming from loadImmediate
1153  usw $8, 0x8000
1154  # CHECK-BE:   ori     $1, $zero, 32768        # encoding: [0x34,0x01,0x80,0x00]
1155  # CHECK-BE:   move     $1, $1                 # encoding: [0x00,0x20,0x08,0x21]
1156  # CHECK-BE:   swl     $8, 0($1)               # encoding: [0xa8,0x28,0x00,0x00]
1157  # CHECK-BE:   swr     $8, 3($1)               # encoding: [0xb8,0x28,0x00,0x03]
1158  # CHECK-LE:   ori     $1, $zero, 32768        # encoding: [0x00,0x80,0x01,0x34]
1159  # CHECK-LE:   move     $1, $1                 # encoding: [0x21,0x08,0x20,0x00]
1160  # CHECK-LE:   swl     $8, 3($1)               # encoding: [0x03,0x00,0x28,0xa8]
1161  # CHECK-LE:   swr     $8, 0($1)               # encoding: [0x00,0x00,0x28,0xb8]
1162
1163  usw $8, -0x8000
1164  # CHECK-BE:   swl     $8, -32768($zero)       # encoding: [0xa8,0x08,0x80,0x00]
1165  # CHECK-BE:   swr     $8, -32765($zero)       # encoding: [0xb8,0x08,0x80,0x03]
1166  # CHECK-LE:   swl     $8, -32765($zero)       # encoding: [0x03,0x80,0x08,0xa8]
1167  # CHECK-LE:   swr     $8, -32768($zero)       # encoding: [0x00,0x80,0x08,0xb8]
1168
1169  # FIXME: Remove the identity moves (move $1, $1) coming from loadImmediate
1170  usw $8, 0x10000
1171  # CHECK-BE:   lui     $1, 1                   # encoding: [0x3c,0x01,0x00,0x01]
1172  # CHECK-BE:   move    $1, $1                  # encoding: [0x00,0x20,0x08,0x21]
1173  # CHECK-BE:   swl     $8, 0($1)               # encoding: [0xa8,0x28,0x00,0x00]
1174  # CHECK-BE:   swr     $8, 3($1)               # encoding: [0xb8,0x28,0x00,0x03]
1175  # CHECK-LE:   lui     $1, 1                   # encoding: [0x01,0x00,0x01,0x3c]
1176  # CHECK-LE:   move    $1, $1                  # encoding: [0x21,0x08,0x20,0x00]
1177  # CHECK-LE:   swl     $8, 3($1)               # encoding: [0x03,0x00,0x28,0xa8]
1178  # CHECK-LE:   swr     $8, 0($1)               # encoding: [0x00,0x00,0x28,0xb8]
1179
1180  # FIXME: Remove the identity moves (move $1, $1) coming from loadImmediate
1181  usw $8, 0x18888
1182  # CHECK-BE:   lui     $1, 1                   # encoding: [0x3c,0x01,0x00,0x01]
1183  # CHECK-BE:   ori     $1, $1, 34952           # encoding: [0x34,0x21,0x88,0x88]
1184  # CHECK-BE:   move    $1, $1                  # encoding: [0x00,0x20,0x08,0x21]
1185  # CHECK-BE:   swl     $8, 0($1)               # encoding: [0xa8,0x28,0x00,0x00]
1186  # CHECK-BE:   swr     $8, 3($1)               # encoding: [0xb8,0x28,0x00,0x03]
1187  # CHECK-LE:   lui     $1, 1                   # encoding: [0x01,0x00,0x01,0x3c]
1188  # CHECK-LE:   ori     $1, $1, 34952           # encoding: [0x88,0x88,0x21,0x34]
1189  # CHECK-LE:   move    $1, $1                  # encoding: [0x21,0x08,0x20,0x00]
1190  # CHECK-LE:   swl     $8, 3($1)               # encoding: [0x03,0x00,0x28,0xa8]
1191  # CHECK-LE:   swr     $8, 0($1)               # encoding: [0x00,0x00,0x28,0xb8]
1192
1193  # FIXME: Remove the identity moves (move $1, $1) coming from loadImmediate
1194  usw $8, -32769
1195  # CHECK-BE:   lui     $1, 65535               # encoding: [0x3c,0x01,0xff,0xff]
1196  # CHECK-BE:   ori     $1, $1, 32767           # encoding: [0x34,0x21,0x7f,0xff]
1197  # CHECK-BE:   move    $1, $1                  # encoding: [0x00,0x20,0x08,0x21]
1198  # CHECK-BE:   swl     $8, 0($1)               # encoding: [0xa8,0x28,0x00,0x00]
1199  # CHECK-BE:   swr     $8, 3($1)               # encoding: [0xb8,0x28,0x00,0x03]
1200  # CHECK-LE:   lui     $1, 65535               # encoding: [0xff,0xff,0x01,0x3c]
1201  # CHECK-LE:   ori     $1, $1, 32767           # encoding: [0xff,0x7f,0x21,0x34]
1202  # CHECK-LE:   move    $1, $1                  # encoding: [0x21,0x08,0x20,0x00]
1203  # CHECK-LE:   swl     $8, 3($1)               # encoding: [0x03,0x00,0x28,0xa8]
1204  # CHECK-LE:   swr     $8, 0($1)               # encoding: [0x00,0x00,0x28,0xb8]
1205
1206  usw $8, 32767
1207  # CHECK-BE:   addiu   $1, $zero, 32767        # encoding: [0x24,0x01,0x7f,0xff]
1208  # CHECK-BE:   swl     $8, 0($1)               # encoding: [0xa8,0x28,0x00,0x00]
1209  # CHECK-BE:   swr     $8, 3($1)               # encoding: [0xb8,0x28,0x00,0x03]
1210  # CHECK-LE:   addiu   $1, $zero, 32767        # encoding: [0xff,0x7f,0x01,0x24]
1211  # CHECK-LE:   swl     $8, 3($1)               # encoding: [0x03,0x00,0x28,0xa8]
1212  # CHECK-LE:   swr     $8, 0($1)               # encoding: [0x00,0x00,0x28,0xb8]
1213
1214usw_reg: # CHECK-LABEL: usw_reg:
1215  usw $8, 0($9)
1216  # CHECK-BE:   swl     $8, 0($9)               # encoding: [0xa9,0x28,0x00,0x00]
1217  # CHECK-BE:   swr     $8, 3($9)               # encoding: [0xb9,0x28,0x00,0x03]
1218  # CHECK-LE:   swl     $8, 3($9)               # encoding: [0x03,0x00,0x28,0xa9]
1219  # CHECK-LE:   swr     $8, 0($9)               # encoding: [0x00,0x00,0x28,0xb9]
1220
1221  usw $8, 2($9)
1222  # CHECK-BE:   swl     $8, 2($9)               # encoding: [0xa9,0x28,0x00,0x02]
1223  # CHECK-BE:   swr     $8, 5($9)               # encoding: [0xb9,0x28,0x00,0x05]
1224  # CHECK-LE:   swl     $8, 5($9)               # encoding: [0x05,0x00,0x28,0xa9]
1225  # CHECK-LE:   swr     $8, 2($9)               # encoding: [0x02,0x00,0x28,0xb9]
1226
1227  usw $8, 0x8000($9)
1228  # CHECK-BE:   ori     $1, $zero, 32768        # encoding: [0x34,0x01,0x80,0x00]
1229  # CHECK-BE:   addu    $1, $1, $9              # encoding: [0x00,0x29,0x08,0x21]
1230  # CHECK-BE:   swl     $8, 0($1)               # encoding: [0xa8,0x28,0x00,0x00]
1231  # CHECK-BE:   swr     $8, 3($1)               # encoding: [0xb8,0x28,0x00,0x03]
1232  # CHECK-LE:   ori     $1, $zero, 32768        # encoding: [0x00,0x80,0x01,0x34]
1233  # CHECK-LE:   addu    $1, $1, $9              # encoding: [0x21,0x08,0x29,0x00]
1234  # CHECK-LE:   swl     $8, 3($1)               # encoding: [0x03,0x00,0x28,0xa8]
1235  # CHECK-LE:   swr     $8, 0($1)               # encoding: [0x00,0x00,0x28,0xb8]
1236
1237  usw $8, -0x8000($9)
1238  # CHECK-BE:   swl     $8, -32768($9)          # encoding: [0xa9,0x28,0x80,0x00]
1239  # CHECK-BE:   swr     $8, -32765($9)          # encoding: [0xb9,0x28,0x80,0x03]
1240  # CHECK-LE:   swl     $8, -32765($9)          # encoding: [0x03,0x80,0x28,0xa9]
1241  # CHECK-LE:   swr     $8, -32768($9)          # encoding: [0x00,0x80,0x28,0xb9]
1242
1243  usw $8, 0x10000($9)
1244  # CHECK-BE:   lui     $1, 1                   # encoding: [0x3c,0x01,0x00,0x01]
1245  # CHECK-BE:   addu    $1, $1, $9              # encoding: [0x00,0x29,0x08,0x21]
1246  # CHECK-BE:   swl     $8, 0($1)               # encoding: [0xa8,0x28,0x00,0x00]
1247  # CHECK-BE:   swr     $8, 3($1)               # encoding: [0xb8,0x28,0x00,0x03]
1248  # CHECK-LE:   lui     $1, 1                   # encoding: [0x01,0x00,0x01,0x3c]
1249  # CHECK-LE:   addu    $1, $1, $9              # encoding: [0x21,0x08,0x29,0x00]
1250  # CHECK-LE:   swl     $8, 3($1)               # encoding: [0x03,0x00,0x28,0xa8]
1251  # CHECK-LE:   swr     $8, 0($1)               # encoding: [0x00,0x00,0x28,0xb8]
1252
1253  usw $8, 0x18888($9)
1254  # CHECK-BE:   lui     $1, 1                   # encoding: [0x3c,0x01,0x00,0x01]
1255  # CHECK-BE:   ori     $1, $1, 34952           # encoding: [0x34,0x21,0x88,0x88]
1256  # CHECK-BE:   addu    $1, $1, $9              # encoding: [0x00,0x29,0x08,0x21]
1257  # CHECK-BE:   swl     $8, 0($1)               # encoding: [0xa8,0x28,0x00,0x00]
1258  # CHECK-BE:   swr     $8, 3($1)               # encoding: [0xb8,0x28,0x00,0x03]
1259  # CHECK-LE:   lui     $1, 1                   # encoding: [0x01,0x00,0x01,0x3c]
1260  # CHECK-LE:   ori     $1, $1, 34952           # encoding: [0x88,0x88,0x21,0x34]
1261  # CHECK-LE:   addu    $1, $1, $9              # encoding: [0x21,0x08,0x29,0x00]
1262  # CHECK-LE:   swl     $8, 3($1)               # encoding: [0x03,0x00,0x28,0xa8]
1263  # CHECK-LE:   swr     $8, 0($1)               # encoding: [0x00,0x00,0x28,0xb8]
1264
1265  usw $8, -32769($9)
1266  # CHECK-BE:   lui     $1, 65535               # encoding: [0x3c,0x01,0xff,0xff]
1267  # CHECK-BE:   ori     $1, $1, 32767           # encoding: [0x34,0x21,0x7f,0xff]
1268  # CHECK-BE:   addu    $1, $1, $9              # encoding: [0x00,0x29,0x08,0x21]
1269  # CHECK-BE:   swl     $8, 0($1)               # encoding: [0xa8,0x28,0x00,0x00]
1270  # CHECK-BE:   swr     $8, 3($1)               # encoding: [0xb8,0x28,0x00,0x03]
1271  # CHECK-LE:   lui     $1, 65535               # encoding: [0xff,0xff,0x01,0x3c]
1272  # CHECK-LE:   ori     $1, $1, 32767           # encoding: [0xff,0x7f,0x21,0x34]
1273  # CHECK-LE:   addu    $1, $1, $9              # encoding: [0x21,0x08,0x29,0x00]
1274  # CHECK-LE:   swl     $8, 3($1)               # encoding: [0x03,0x00,0x28,0xa8]
1275  # CHECK-LE:   swr     $8, 0($1)               # encoding: [0x00,0x00,0x28,0xb8]
1276
1277  usw $8, 32767($9)
1278  # CHECK-BE:   addiu   $1, $9, 32767           # encoding: [0x25,0x21,0x7f,0xff]
1279  # CHECK-BE:   swl     $8, 0($1)               # encoding: [0xa8,0x28,0x00,0x00]
1280  # CHECK-BE:   swr     $8, 3($1)               # encoding: [0xb8,0x28,0x00,0x03]
1281  # CHECK-LE:   addiu   $1, $9, 32767           # encoding: [0xff,0x7f,0x21,0x25]
1282  # CHECK-LE:   swl     $8, 3($1)               # encoding: [0x03,0x00,0x28,0xa8]
1283  # CHECK-LE:   swr     $8, 0($1)               # encoding: [0x00,0x00,0x28,0xb8]
1284
1285  usw $8, 0($8)
1286  # CHECK-BE:   swl     $8, 0($8)               # encoding: [0xa9,0x08,0x00,0x00]
1287  # CHECK-BE:   swr     $8, 3($8)               # encoding: [0xb9,0x08,0x00,0x03]
1288  # CHECK-LE:   swl     $8, 3($8)               # encoding: [0x03,0x00,0x08,0xa9]
1289  # CHECK-LE:   swr     $8, 0($8)               # encoding: [0x00,0x00,0x08,0xb9]
1290
1291  usw $8, 2($8)
1292  # CHECK-BE:   swl     $8, 2($8)               # encoding: [0xa9,0x08,0x00,0x02]
1293  # CHECK-BE:   swr     $8, 5($8)               # encoding: [0xb9,0x08,0x00,0x05]
1294  # CHECK-LE:   swl     $8, 5($8)               # encoding: [0x05,0x00,0x08,0xa9]
1295  # CHECK-LE:   swr     $8, 2($8)               # encoding: [0x02,0x00,0x08,0xb9]
1296
1297  usw $8, 0x8000($8)
1298  # CHECK-BE:   ori     $1, $zero, 32768        # encoding: [0x34,0x01,0x80,0x00]
1299  # CHECK-BE:   addu    $1, $1, $8              # encoding: [0x00,0x28,0x08,0x21]
1300  # CHECK-BE:   swl     $8, 0($1)               # encoding: [0xa8,0x28,0x00,0x00]
1301  # CHECK-BE:   swr     $8, 3($1)               # encoding: [0xb8,0x28,0x00,0x03]
1302  # CHECK-LE:   ori     $1, $zero, 32768        # encoding: [0x00,0x80,0x01,0x34]
1303  # CHECK-LE:   addu    $1, $1, $8              # encoding: [0x21,0x08,0x28,0x00]
1304  # CHECK-LE:   swl     $8, 3($1)               # encoding: [0x03,0x00,0x28,0xa8]
1305  # CHECK-LE:   swr     $8, 0($1)               # encoding: [0x00,0x00,0x28,0xb8]
1306
1307  usw $8, -0x8000($8)
1308  # CHECK-BE:   swl     $8, -32768($8)          # encoding: [0xa9,0x08,0x80,0x00]
1309  # CHECK-BE:   swr     $8, -32765($8)          # encoding: [0xb9,0x08,0x80,0x03]
1310  # CHECK-LE:   swl     $8, -32765($8)          # encoding: [0x03,0x80,0x08,0xa9]
1311  # CHECK-LE:   swr     $8, -32768($8)          # encoding: [0x00,0x80,0x08,0xb9]
1312
1313  usw $8, 0x10000($8)
1314  # CHECK-BE:   lui     $1, 1                   # encoding: [0x3c,0x01,0x00,0x01]
1315  # CHECK-BE:   addu    $1, $1, $8              # encoding: [0x00,0x28,0x08,0x21]
1316  # CHECK-BE:   swl     $8, 0($1)               # encoding: [0xa8,0x28,0x00,0x00]
1317  # CHECK-BE:   swr     $8, 3($1)               # encoding: [0xb8,0x28,0x00,0x03]
1318  # CHECK-LE:   lui     $1, 1                   # encoding: [0x01,0x00,0x01,0x3c]
1319  # CHECK-LE:   addu    $1, $1, $8              # encoding: [0x21,0x08,0x28,0x00]
1320  # CHECK-LE:   swl     $8, 3($1)               # encoding: [0x03,0x00,0x28,0xa8]
1321  # CHECK-LE:   swr     $8, 0($1)               # encoding: [0x00,0x00,0x28,0xb8]
1322
1323  usw $8, 0x18888($8)
1324  # CHECK-BE:   lui     $1, 1                   # encoding: [0x3c,0x01,0x00,0x01]
1325  # CHECK-BE:   ori     $1, $1, 34952           # encoding: [0x34,0x21,0x88,0x88]
1326  # CHECK-BE:   addu    $1, $1, $8              # encoding: [0x00,0x28,0x08,0x21]
1327  # CHECK-BE:   swl     $8, 0($1)               # encoding: [0xa8,0x28,0x00,0x00]
1328  # CHECK-BE:   swr     $8, 3($1)               # encoding: [0xb8,0x28,0x00,0x03]
1329  # CHECK-LE:   lui     $1, 1                   # encoding: [0x01,0x00,0x01,0x3c]
1330  # CHECK-LE:   ori     $1, $1, 34952           # encoding: [0x88,0x88,0x21,0x34]
1331  # CHECK-LE:   addu    $1, $1, $8              # encoding: [0x21,0x08,0x28,0x00]
1332  # CHECK-LE:   swl     $8, 3($1)               # encoding: [0x03,0x00,0x28,0xa8]
1333  # CHECK-LE:   swr     $8, 0($1)               # encoding: [0x00,0x00,0x28,0xb8]
1334
1335  usw $8, -32769($8)
1336  # CHECK-BE:   lui     $1, 65535               # encoding: [0x3c,0x01,0xff,0xff]
1337  # CHECK-BE:   ori     $1, $1, 32767           # encoding: [0x34,0x21,0x7f,0xff]
1338  # CHECK-BE:   addu    $1, $1, $8              # encoding: [0x00,0x28,0x08,0x21]
1339  # CHECK-BE:   swl     $8, 0($1)               # encoding: [0xa8,0x28,0x00,0x00]
1340  # CHECK-BE:   swr     $8, 3($1)               # encoding: [0xb8,0x28,0x00,0x03]
1341  # CHECK-LE:   lui     $1, 65535               # encoding: [0xff,0xff,0x01,0x3c]
1342  # CHECK-LE:   ori     $1, $1, 32767           # encoding: [0xff,0x7f,0x21,0x34]
1343  # CHECK-LE:   addu    $1, $1, $8              # encoding: [0x21,0x08,0x28,0x00]
1344  # CHECK-LE:   swl     $8, 3($1)               # encoding: [0x03,0x00,0x28,0xa8]
1345  # CHECK-LE:   swr     $8, 0($1)               # encoding: [0x00,0x00,0x28,0xb8]
1346
1347  usw $8, 32767($8)
1348  # CHECK-BE:   addiu   $1, $8, 32767           # encoding: [0x25,0x01,0x7f,0xff]
1349  # CHECK-BE:   swl     $8, 0($1)               # encoding: [0xa8,0x28,0x00,0x00]
1350  # CHECK-BE:   swr     $8, 3($1)               # encoding: [0xb8,0x28,0x00,0x03]
1351  # CHECK-LE:   addiu   $1, $8, 32767           # encoding: [0xff,0x7f,0x01,0x25]
1352  # CHECK-LE:   swl     $8, 3($1)               # encoding: [0x03,0x00,0x28,0xa8]
1353  # CHECK-LE:   swr     $8, 0($1)               # encoding: [0x00,0x00,0x28,0xb8]
1354
13551:
1356  add $4, $4, $4
1357