xref: /llvm-project/llvm/test/CodeGen/Mips/load-store-left-right.ll (revision d8a5fae6913a0f6c7e3c814315c1a11fcfd609a1)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -mtriple=mipsel-elf   -mcpu=mips32              -relocation-model=pic < %s | FileCheck -check-prefixes=MIPS32,MIPS32-EL %s
3; RUN: llc -mtriple=mips-elf     -mcpu=mips32              -relocation-model=pic < %s | FileCheck -check-prefixes=MIPS32,MIPS32-EB %s
4; RUN: llc -mtriple=mipsel-elf   -mcpu=mips32r2            -relocation-model=pic < %s | FileCheck -check-prefixes=MIPS32,MIPS32-EL %s
5; RUN: llc -mtriple=mips-elf     -mcpu=mips32r2            -relocation-model=pic < %s | FileCheck -check-prefixes=MIPS32,MIPS32-EB %s
6; RUN: llc -mtriple=mipsel-elf   -mcpu=mips32r6            -relocation-model=pic < %s | FileCheck -check-prefixes=MIPS32R6,MIPS32R6-EL %s
7; RUN: llc -mtriple=mips-elf     -mcpu=mips32r6            -relocation-model=pic < %s | FileCheck -check-prefixes=MIPS32R6,MIPS32R6-EB %s
8; RUN: llc -mtriple=mips64el-elf -mcpu=mips4    -target-abi=n64 -relocation-model=pic < %s | FileCheck -check-prefixes=MIPS64,MIPS64-EL %s
9; RUN: llc -mtriple=mips64-elf   -mcpu=mips4    -target-abi=n64 -relocation-model=pic < %s | FileCheck -check-prefixes=MIPS64,MIPS64-EB %s
10; RUN: llc -mtriple=mips64el-elf -mcpu=mips64   -target-abi=n64 -relocation-model=pic < %s | FileCheck -check-prefixes=MIPS64,MIPS64-EL %s
11; RUN: llc -mtriple=mips64-elf   -mcpu=mips64   -target-abi=n64 -relocation-model=pic < %s | FileCheck -check-prefixes=MIPS64,MIPS64-EB %s
12; RUN: llc -mtriple=mips64el-elf -mcpu=mips64r2 -target-abi=n64 -relocation-model=pic < %s | FileCheck -check-prefixes=MIPS64,MIPS64R2-EL %s
13; RUN: llc -mtriple=mips64-elf   -mcpu=mips64r2 -target-abi=n64 -relocation-model=pic < %s | FileCheck -check-prefixes=MIPS64,MIPS64R2-EB %s
14; RUN: llc -mtriple=mips64el-elf -mcpu=mips64r6 -target-abi=n64 -relocation-model=pic < %s | FileCheck -check-prefixes=MIPS64R6 %s
15; RUN: llc -mtriple=mips64-elf   -mcpu=mips64r6 -target-abi=n64 -relocation-model=pic < %s | FileCheck -check-prefixes=MIPS64R6 %s
16
17%struct.SLL = type { i64 }
18%struct.SI = type { i32 }
19%struct.SUI = type { i32 }
20
21@sll = common global %struct.SLL zeroinitializer, align 1
22@si = common global %struct.SI zeroinitializer, align 1
23@sui = common global %struct.SUI zeroinitializer, align 1
24
25define i32 @load_SI() nounwind readonly {
26; MIPS32-EL-LABEL: load_SI:
27; MIPS32-EL:       # %bb.0: # %entry
28; MIPS32-EL-NEXT:    lui $2, %hi(_gp_disp)
29; MIPS32-EL-NEXT:    addiu $2, $2, %lo(_gp_disp)
30; MIPS32-EL-NEXT:    addu $1, $2, $25
31; MIPS32-EL-NEXT:    lw $1, %got(si)($1)
32; MIPS32-EL-NEXT:    lwl $2, 3($1)
33; MIPS32-EL-NEXT:    jr $ra
34; MIPS32-EL-NEXT:    lwr $2, 0($1)
35;
36; MIPS32-EB-LABEL: load_SI:
37; MIPS32-EB:       # %bb.0: # %entry
38; MIPS32-EB-NEXT:    lui $2, %hi(_gp_disp)
39; MIPS32-EB-NEXT:    addiu $2, $2, %lo(_gp_disp)
40; MIPS32-EB-NEXT:    addu $1, $2, $25
41; MIPS32-EB-NEXT:    lw $1, %got(si)($1)
42; MIPS32-EB-NEXT:    lwl $2, 0($1)
43; MIPS32-EB-NEXT:    jr $ra
44; MIPS32-EB-NEXT:    lwr $2, 3($1)
45;
46; MIPS32R6-LABEL: load_SI:
47; MIPS32R6:       # %bb.0: # %entry
48; MIPS32R6-NEXT:    lui $2, %hi(_gp_disp)
49; MIPS32R6-NEXT:    addiu $2, $2, %lo(_gp_disp)
50; MIPS32R6-NEXT:    addu $1, $2, $25
51; MIPS32R6-NEXT:    lw $1, %got(si)($1)
52; MIPS32R6-NEXT:    jr $ra
53; MIPS32R6-NEXT:    lw $2, 0($1)
54;
55; MIPS64-EL-LABEL: load_SI:
56; MIPS64-EL:       # %bb.0: # %entry
57; MIPS64-EL-NEXT:    lui $1, %hi(%neg(%gp_rel(load_SI)))
58; MIPS64-EL-NEXT:    daddu $1, $1, $25
59; MIPS64-EL-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(load_SI)))
60; MIPS64-EL-NEXT:    ld $1, %got_disp(si)($1)
61; MIPS64-EL-NEXT:    lwl $2, 3($1)
62; MIPS64-EL-NEXT:    jr $ra
63; MIPS64-EL-NEXT:    lwr $2, 0($1)
64;
65; MIPS64-EB-LABEL: load_SI:
66; MIPS64-EB:       # %bb.0: # %entry
67; MIPS64-EB-NEXT:    lui $1, %hi(%neg(%gp_rel(load_SI)))
68; MIPS64-EB-NEXT:    daddu $1, $1, $25
69; MIPS64-EB-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(load_SI)))
70; MIPS64-EB-NEXT:    ld $1, %got_disp(si)($1)
71; MIPS64-EB-NEXT:    lwl $2, 0($1)
72; MIPS64-EB-NEXT:    jr $ra
73; MIPS64-EB-NEXT:    lwr $2, 3($1)
74;
75; MIPS64R2-EL-LABEL: load_SI:
76; MIPS64R2-EL:       # %bb.0: # %entry
77; MIPS64R2-EL-NEXT:    lui $1, %hi(%neg(%gp_rel(load_SI)))
78; MIPS64R2-EL-NEXT:    daddu $1, $1, $25
79; MIPS64R2-EL-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(load_SI)))
80; MIPS64R2-EL-NEXT:    ld $1, %got_disp(si)($1)
81; MIPS64R2-EL-NEXT:    lwl $2, 3($1)
82; MIPS64R2-EL-NEXT:    jr $ra
83; MIPS64R2-EL-NEXT:    lwr $2, 0($1)
84;
85; MIPS64R2-EB-LABEL: load_SI:
86; MIPS64R2-EB:       # %bb.0: # %entry
87; MIPS64R2-EB-NEXT:    lui $1, %hi(%neg(%gp_rel(load_SI)))
88; MIPS64R2-EB-NEXT:    daddu $1, $1, $25
89; MIPS64R2-EB-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(load_SI)))
90; MIPS64R2-EB-NEXT:    ld $1, %got_disp(si)($1)
91; MIPS64R2-EB-NEXT:    lwl $2, 0($1)
92; MIPS64R2-EB-NEXT:    jr $ra
93; MIPS64R2-EB-NEXT:    lwr $2, 3($1)
94;
95; MIPS64R6-LABEL: load_SI:
96; MIPS64R6:       # %bb.0: # %entry
97; MIPS64R6-NEXT:    lui $1, %hi(%neg(%gp_rel(load_SI)))
98; MIPS64R6-NEXT:    daddu $1, $1, $25
99; MIPS64R6-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(load_SI)))
100; MIPS64R6-NEXT:    ld $1, %got_disp(si)($1)
101; MIPS64R6-NEXT:    jr $ra
102; MIPS64R6-NEXT:    lw $2, 0($1)
103entry:
104  %0 = load i32, ptr @si, align 1
105  ret i32 %0
106}
107
108define void @store_SI(i32 signext %a) nounwind {
109; MIPS32-EL-LABEL: store_SI:
110; MIPS32-EL:       # %bb.0: # %entry
111; MIPS32-EL-NEXT:    lui $2, %hi(_gp_disp)
112; MIPS32-EL-NEXT:    addiu $2, $2, %lo(_gp_disp)
113; MIPS32-EL-NEXT:    addu $1, $2, $25
114; MIPS32-EL-NEXT:    lw $1, %got(si)($1)
115; MIPS32-EL-NEXT:    swl $4, 3($1)
116; MIPS32-EL-NEXT:    jr $ra
117; MIPS32-EL-NEXT:    swr $4, 0($1)
118;
119; MIPS32-EB-LABEL: store_SI:
120; MIPS32-EB:       # %bb.0: # %entry
121; MIPS32-EB-NEXT:    lui $2, %hi(_gp_disp)
122; MIPS32-EB-NEXT:    addiu $2, $2, %lo(_gp_disp)
123; MIPS32-EB-NEXT:    addu $1, $2, $25
124; MIPS32-EB-NEXT:    lw $1, %got(si)($1)
125; MIPS32-EB-NEXT:    swl $4, 0($1)
126; MIPS32-EB-NEXT:    jr $ra
127; MIPS32-EB-NEXT:    swr $4, 3($1)
128;
129; MIPS32R6-LABEL: store_SI:
130; MIPS32R6:       # %bb.0: # %entry
131; MIPS32R6-NEXT:    lui $2, %hi(_gp_disp)
132; MIPS32R6-NEXT:    addiu $2, $2, %lo(_gp_disp)
133; MIPS32R6-NEXT:    addu $1, $2, $25
134; MIPS32R6-NEXT:    lw $1, %got(si)($1)
135; MIPS32R6-NEXT:    jr $ra
136; MIPS32R6-NEXT:    sw $4, 0($1)
137;
138; MIPS64-EL-LABEL: store_SI:
139; MIPS64-EL:       # %bb.0: # %entry
140; MIPS64-EL-NEXT:    lui $1, %hi(%neg(%gp_rel(store_SI)))
141; MIPS64-EL-NEXT:    daddu $1, $1, $25
142; MIPS64-EL-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(store_SI)))
143; MIPS64-EL-NEXT:    ld $1, %got_disp(si)($1)
144; MIPS64-EL-NEXT:    swl $4, 3($1)
145; MIPS64-EL-NEXT:    jr $ra
146; MIPS64-EL-NEXT:    swr $4, 0($1)
147;
148; MIPS64-EB-LABEL: store_SI:
149; MIPS64-EB:       # %bb.0: # %entry
150; MIPS64-EB-NEXT:    lui $1, %hi(%neg(%gp_rel(store_SI)))
151; MIPS64-EB-NEXT:    daddu $1, $1, $25
152; MIPS64-EB-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(store_SI)))
153; MIPS64-EB-NEXT:    ld $1, %got_disp(si)($1)
154; MIPS64-EB-NEXT:    swl $4, 0($1)
155; MIPS64-EB-NEXT:    jr $ra
156; MIPS64-EB-NEXT:    swr $4, 3($1)
157;
158; MIPS64R2-EL-LABEL: store_SI:
159; MIPS64R2-EL:       # %bb.0: # %entry
160; MIPS64R2-EL-NEXT:    lui $1, %hi(%neg(%gp_rel(store_SI)))
161; MIPS64R2-EL-NEXT:    daddu $1, $1, $25
162; MIPS64R2-EL-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(store_SI)))
163; MIPS64R2-EL-NEXT:    ld $1, %got_disp(si)($1)
164; MIPS64R2-EL-NEXT:    swl $4, 3($1)
165; MIPS64R2-EL-NEXT:    jr $ra
166; MIPS64R2-EL-NEXT:    swr $4, 0($1)
167;
168; MIPS64R2-EB-LABEL: store_SI:
169; MIPS64R2-EB:       # %bb.0: # %entry
170; MIPS64R2-EB-NEXT:    lui $1, %hi(%neg(%gp_rel(store_SI)))
171; MIPS64R2-EB-NEXT:    daddu $1, $1, $25
172; MIPS64R2-EB-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(store_SI)))
173; MIPS64R2-EB-NEXT:    ld $1, %got_disp(si)($1)
174; MIPS64R2-EB-NEXT:    swl $4, 0($1)
175; MIPS64R2-EB-NEXT:    jr $ra
176; MIPS64R2-EB-NEXT:    swr $4, 3($1)
177;
178; MIPS64R6-LABEL: store_SI:
179; MIPS64R6:       # %bb.0: # %entry
180; MIPS64R6-NEXT:    lui $1, %hi(%neg(%gp_rel(store_SI)))
181; MIPS64R6-NEXT:    daddu $1, $1, $25
182; MIPS64R6-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(store_SI)))
183; MIPS64R6-NEXT:    ld $1, %got_disp(si)($1)
184; MIPS64R6-NEXT:    jr $ra
185; MIPS64R6-NEXT:    sw $4, 0($1)
186entry:
187  store i32 %a, ptr @si, align 1
188  ret void
189}
190
191define i64 @load_SLL() nounwind readonly {
192; MIPS32-EL-LABEL: load_SLL:
193; MIPS32-EL:       # %bb.0: # %entry
194; MIPS32-EL-NEXT:    lui $2, %hi(_gp_disp)
195; MIPS32-EL-NEXT:    addiu $2, $2, %lo(_gp_disp)
196; MIPS32-EL-NEXT:    addu $1, $2, $25
197; MIPS32-EL-NEXT:    lw $1, %got(sll)($1)
198; MIPS32-EL-NEXT:    lwl $2, 3($1)
199; MIPS32-EL-NEXT:    lwr $2, 0($1)
200; MIPS32-EL-NEXT:    lwl $3, 7($1)
201; MIPS32-EL-NEXT:    jr $ra
202; MIPS32-EL-NEXT:    lwr $3, 4($1)
203;
204; MIPS32-EB-LABEL: load_SLL:
205; MIPS32-EB:       # %bb.0: # %entry
206; MIPS32-EB-NEXT:    lui $2, %hi(_gp_disp)
207; MIPS32-EB-NEXT:    addiu $2, $2, %lo(_gp_disp)
208; MIPS32-EB-NEXT:    addu $1, $2, $25
209; MIPS32-EB-NEXT:    lw $1, %got(sll)($1)
210; MIPS32-EB-NEXT:    lwl $2, 0($1)
211; MIPS32-EB-NEXT:    lwr $2, 3($1)
212; MIPS32-EB-NEXT:    lwl $3, 4($1)
213; MIPS32-EB-NEXT:    jr $ra
214; MIPS32-EB-NEXT:    lwr $3, 7($1)
215;
216; MIPS32R6-LABEL: load_SLL:
217; MIPS32R6:       # %bb.0: # %entry
218; MIPS32R6-NEXT:    lui $2, %hi(_gp_disp)
219; MIPS32R6-NEXT:    addiu $2, $2, %lo(_gp_disp)
220; MIPS32R6-NEXT:    addu $1, $2, $25
221; MIPS32R6-NEXT:    lw $1, %got(sll)($1)
222; MIPS32R6-NEXT:    lw $2, 0($1)
223; MIPS32R6-NEXT:    jr $ra
224; MIPS32R6-NEXT:    lw $3, 4($1)
225;
226; MIPS64-EL-LABEL: load_SLL:
227; MIPS64-EL:       # %bb.0: # %entry
228; MIPS64-EL-NEXT:    lui $1, %hi(%neg(%gp_rel(load_SLL)))
229; MIPS64-EL-NEXT:    daddu $1, $1, $25
230; MIPS64-EL-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(load_SLL)))
231; MIPS64-EL-NEXT:    ld $1, %got_disp(sll)($1)
232; MIPS64-EL-NEXT:    ldl $2, 7($1)
233; MIPS64-EL-NEXT:    jr $ra
234; MIPS64-EL-NEXT:    ldr $2, 0($1)
235;
236; MIPS64-EB-LABEL: load_SLL:
237; MIPS64-EB:       # %bb.0: # %entry
238; MIPS64-EB-NEXT:    lui $1, %hi(%neg(%gp_rel(load_SLL)))
239; MIPS64-EB-NEXT:    daddu $1, $1, $25
240; MIPS64-EB-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(load_SLL)))
241; MIPS64-EB-NEXT:    ld $1, %got_disp(sll)($1)
242; MIPS64-EB-NEXT:    ldl $2, 0($1)
243; MIPS64-EB-NEXT:    jr $ra
244; MIPS64-EB-NEXT:    ldr $2, 7($1)
245;
246; MIPS64R2-EL-LABEL: load_SLL:
247; MIPS64R2-EL:       # %bb.0: # %entry
248; MIPS64R2-EL-NEXT:    lui $1, %hi(%neg(%gp_rel(load_SLL)))
249; MIPS64R2-EL-NEXT:    daddu $1, $1, $25
250; MIPS64R2-EL-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(load_SLL)))
251; MIPS64R2-EL-NEXT:    ld $1, %got_disp(sll)($1)
252; MIPS64R2-EL-NEXT:    ldl $2, 7($1)
253; MIPS64R2-EL-NEXT:    jr $ra
254; MIPS64R2-EL-NEXT:    ldr $2, 0($1)
255;
256; MIPS64R2-EB-LABEL: load_SLL:
257; MIPS64R2-EB:       # %bb.0: # %entry
258; MIPS64R2-EB-NEXT:    lui $1, %hi(%neg(%gp_rel(load_SLL)))
259; MIPS64R2-EB-NEXT:    daddu $1, $1, $25
260; MIPS64R2-EB-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(load_SLL)))
261; MIPS64R2-EB-NEXT:    ld $1, %got_disp(sll)($1)
262; MIPS64R2-EB-NEXT:    ldl $2, 0($1)
263; MIPS64R2-EB-NEXT:    jr $ra
264; MIPS64R2-EB-NEXT:    ldr $2, 7($1)
265;
266; MIPS64R6-LABEL: load_SLL:
267; MIPS64R6:       # %bb.0: # %entry
268; MIPS64R6-NEXT:    lui $1, %hi(%neg(%gp_rel(load_SLL)))
269; MIPS64R6-NEXT:    daddu $1, $1, $25
270; MIPS64R6-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(load_SLL)))
271; MIPS64R6-NEXT:    ld $1, %got_disp(sll)($1)
272; MIPS64R6-NEXT:    jr $ra
273; MIPS64R6-NEXT:    ld $2, 0($1)
274entry:
275  %0 = load i64, ptr @sll, align 1
276  ret i64 %0
277}
278
279define i64 @load_SI_sext_to_i64() nounwind readonly {
280; MIPS32-EL-LABEL: load_SI_sext_to_i64:
281; MIPS32-EL:       # %bb.0: # %entry
282; MIPS32-EL-NEXT:    lui $2, %hi(_gp_disp)
283; MIPS32-EL-NEXT:    addiu $2, $2, %lo(_gp_disp)
284; MIPS32-EL-NEXT:    addu $1, $2, $25
285; MIPS32-EL-NEXT:    lw $1, %got(si)($1)
286; MIPS32-EL-NEXT:    lwl $2, 3($1)
287; MIPS32-EL-NEXT:    lwr $2, 0($1)
288; MIPS32-EL-NEXT:    jr $ra
289; MIPS32-EL-NEXT:    sra $3, $2, 31
290;
291; MIPS32-EB-LABEL: load_SI_sext_to_i64:
292; MIPS32-EB:       # %bb.0: # %entry
293; MIPS32-EB-NEXT:    lui $2, %hi(_gp_disp)
294; MIPS32-EB-NEXT:    addiu $2, $2, %lo(_gp_disp)
295; MIPS32-EB-NEXT:    addu $1, $2, $25
296; MIPS32-EB-NEXT:    lw $1, %got(si)($1)
297; MIPS32-EB-NEXT:    lwl $3, 0($1)
298; MIPS32-EB-NEXT:    lwr $3, 3($1)
299; MIPS32-EB-NEXT:    jr $ra
300; MIPS32-EB-NEXT:    sra $2, $3, 31
301;
302; MIPS32R6-EL-LABEL: load_SI_sext_to_i64:
303; MIPS32R6-EL:       # %bb.0: # %entry
304; MIPS32R6-EL-NEXT:    lui $2, %hi(_gp_disp)
305; MIPS32R6-EL-NEXT:    addiu $2, $2, %lo(_gp_disp)
306; MIPS32R6-EL-NEXT:    addu $1, $2, $25
307; MIPS32R6-EL-NEXT:    lw $1, %got(si)($1)
308; MIPS32R6-EL-NEXT:    lw $2, 0($1)
309; MIPS32R6-EL-NEXT:    jr $ra
310; MIPS32R6-EL-NEXT:    sra $3, $2, 31
311;
312; MIPS32R6-EB-LABEL: load_SI_sext_to_i64:
313; MIPS32R6-EB:       # %bb.0: # %entry
314; MIPS32R6-EB-NEXT:    lui $2, %hi(_gp_disp)
315; MIPS32R6-EB-NEXT:    addiu $2, $2, %lo(_gp_disp)
316; MIPS32R6-EB-NEXT:    addu $1, $2, $25
317; MIPS32R6-EB-NEXT:    lw $1, %got(si)($1)
318; MIPS32R6-EB-NEXT:    lw $3, 0($1)
319; MIPS32R6-EB-NEXT:    jr $ra
320; MIPS32R6-EB-NEXT:    sra $2, $3, 31
321;
322; MIPS64-EL-LABEL: load_SI_sext_to_i64:
323; MIPS64-EL:       # %bb.0: # %entry
324; MIPS64-EL-NEXT:    lui $1, %hi(%neg(%gp_rel(load_SI_sext_to_i64)))
325; MIPS64-EL-NEXT:    daddu $1, $1, $25
326; MIPS64-EL-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(load_SI_sext_to_i64)))
327; MIPS64-EL-NEXT:    ld $1, %got_disp(si)($1)
328; MIPS64-EL-NEXT:    lwl $2, 3($1)
329; MIPS64-EL-NEXT:    jr $ra
330; MIPS64-EL-NEXT:    lwr $2, 0($1)
331;
332; MIPS64-EB-LABEL: load_SI_sext_to_i64:
333; MIPS64-EB:       # %bb.0: # %entry
334; MIPS64-EB-NEXT:    lui $1, %hi(%neg(%gp_rel(load_SI_sext_to_i64)))
335; MIPS64-EB-NEXT:    daddu $1, $1, $25
336; MIPS64-EB-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(load_SI_sext_to_i64)))
337; MIPS64-EB-NEXT:    ld $1, %got_disp(si)($1)
338; MIPS64-EB-NEXT:    lwl $2, 0($1)
339; MIPS64-EB-NEXT:    jr $ra
340; MIPS64-EB-NEXT:    lwr $2, 3($1)
341;
342; MIPS64R2-EL-LABEL: load_SI_sext_to_i64:
343; MIPS64R2-EL:       # %bb.0: # %entry
344; MIPS64R2-EL-NEXT:    lui $1, %hi(%neg(%gp_rel(load_SI_sext_to_i64)))
345; MIPS64R2-EL-NEXT:    daddu $1, $1, $25
346; MIPS64R2-EL-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(load_SI_sext_to_i64)))
347; MIPS64R2-EL-NEXT:    ld $1, %got_disp(si)($1)
348; MIPS64R2-EL-NEXT:    lwl $2, 3($1)
349; MIPS64R2-EL-NEXT:    jr $ra
350; MIPS64R2-EL-NEXT:    lwr $2, 0($1)
351;
352; MIPS64R2-EB-LABEL: load_SI_sext_to_i64:
353; MIPS64R2-EB:       # %bb.0: # %entry
354; MIPS64R2-EB-NEXT:    lui $1, %hi(%neg(%gp_rel(load_SI_sext_to_i64)))
355; MIPS64R2-EB-NEXT:    daddu $1, $1, $25
356; MIPS64R2-EB-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(load_SI_sext_to_i64)))
357; MIPS64R2-EB-NEXT:    ld $1, %got_disp(si)($1)
358; MIPS64R2-EB-NEXT:    lwl $2, 0($1)
359; MIPS64R2-EB-NEXT:    jr $ra
360; MIPS64R2-EB-NEXT:    lwr $2, 3($1)
361;
362; MIPS64R6-LABEL: load_SI_sext_to_i64:
363; MIPS64R6:       # %bb.0: # %entry
364; MIPS64R6-NEXT:    lui $1, %hi(%neg(%gp_rel(load_SI_sext_to_i64)))
365; MIPS64R6-NEXT:    daddu $1, $1, $25
366; MIPS64R6-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(load_SI_sext_to_i64)))
367; MIPS64R6-NEXT:    ld $1, %got_disp(si)($1)
368; MIPS64R6-NEXT:    jr $ra
369; MIPS64R6-NEXT:    lw $2, 0($1)
370entry:
371  %0 = load i32, ptr @si, align 1
372  %conv = sext i32 %0 to i64
373  ret i64 %conv
374}
375
376define i64 @load_UI() nounwind readonly {
377; MIPS32-EL-LABEL: load_UI:
378; MIPS32-EL:       # %bb.0: # %entry
379; MIPS32-EL-NEXT:    lui $2, %hi(_gp_disp)
380; MIPS32-EL-NEXT:    addiu $2, $2, %lo(_gp_disp)
381; MIPS32-EL-NEXT:    addu $1, $2, $25
382; MIPS32-EL-NEXT:    lw $1, %got(sui)($1)
383; MIPS32-EL-NEXT:    lwl $2, 3($1)
384; MIPS32-EL-NEXT:    lwr $2, 0($1)
385; MIPS32-EL-NEXT:    jr $ra
386; MIPS32-EL-NEXT:    addiu $3, $zero, 0
387;
388; MIPS32-EB-LABEL: load_UI:
389; MIPS32-EB:       # %bb.0: # %entry
390; MIPS32-EB-NEXT:    lui $2, %hi(_gp_disp)
391; MIPS32-EB-NEXT:    addiu $2, $2, %lo(_gp_disp)
392; MIPS32-EB-NEXT:    addu $1, $2, $25
393; MIPS32-EB-NEXT:    lw $1, %got(sui)($1)
394; MIPS32-EB-NEXT:    lwl $3, 0($1)
395; MIPS32-EB-NEXT:    lwr $3, 3($1)
396; MIPS32-EB-NEXT:    jr $ra
397; MIPS32-EB-NEXT:    addiu $2, $zero, 0
398;
399; MIPS32R6-EL-LABEL: load_UI:
400; MIPS32R6-EL:       # %bb.0: # %entry
401; MIPS32R6-EL-NEXT:    lui $2, %hi(_gp_disp)
402; MIPS32R6-EL-NEXT:    addiu $2, $2, %lo(_gp_disp)
403; MIPS32R6-EL-NEXT:    addu $1, $2, $25
404; MIPS32R6-EL-NEXT:    lw $1, %got(sui)($1)
405; MIPS32R6-EL-NEXT:    lw $2, 0($1)
406; MIPS32R6-EL-NEXT:    jr $ra
407; MIPS32R6-EL-NEXT:    addiu $3, $zero, 0
408;
409; MIPS32R6-EB-LABEL: load_UI:
410; MIPS32R6-EB:       # %bb.0: # %entry
411; MIPS32R6-EB-NEXT:    lui $2, %hi(_gp_disp)
412; MIPS32R6-EB-NEXT:    addiu $2, $2, %lo(_gp_disp)
413; MIPS32R6-EB-NEXT:    addu $1, $2, $25
414; MIPS32R6-EB-NEXT:    lw $1, %got(sui)($1)
415; MIPS32R6-EB-NEXT:    lw $3, 0($1)
416; MIPS32R6-EB-NEXT:    jr $ra
417; MIPS32R6-EB-NEXT:    addiu $2, $zero, 0
418;
419; MIPS64-EL-LABEL: load_UI:
420; MIPS64-EL:       # %bb.0: # %entry
421; MIPS64-EL-NEXT:    lui $1, %hi(%neg(%gp_rel(load_UI)))
422; MIPS64-EL-NEXT:    daddu $1, $1, $25
423; MIPS64-EL-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(load_UI)))
424; MIPS64-EL-NEXT:    ld $1, %got_disp(sui)($1)
425; MIPS64-EL-NEXT:    lwl $2, 3($1)
426; MIPS64-EL-NEXT:    lwr $2, 0($1)
427; MIPS64-EL-NEXT:    daddiu $1, $zero, 1
428; MIPS64-EL-NEXT:    dsll $1, $1, 32
429; MIPS64-EL-NEXT:    daddiu $1, $1, -1
430; MIPS64-EL-NEXT:    jr $ra
431; MIPS64-EL-NEXT:    and $2, $2, $1
432;
433; MIPS64-EB-LABEL: load_UI:
434; MIPS64-EB:       # %bb.0: # %entry
435; MIPS64-EB-NEXT:    lui $1, %hi(%neg(%gp_rel(load_UI)))
436; MIPS64-EB-NEXT:    daddu $1, $1, $25
437; MIPS64-EB-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(load_UI)))
438; MIPS64-EB-NEXT:    ld $1, %got_disp(sui)($1)
439; MIPS64-EB-NEXT:    lwl $2, 0($1)
440; MIPS64-EB-NEXT:    lwr $2, 3($1)
441; MIPS64-EB-NEXT:    daddiu $1, $zero, 1
442; MIPS64-EB-NEXT:    dsll $1, $1, 32
443; MIPS64-EB-NEXT:    daddiu $1, $1, -1
444; MIPS64-EB-NEXT:    jr $ra
445; MIPS64-EB-NEXT:    and $2, $2, $1
446;
447; MIPS64R2-EL-LABEL: load_UI:
448; MIPS64R2-EL:       # %bb.0: # %entry
449; MIPS64R2-EL-NEXT:    lui $1, %hi(%neg(%gp_rel(load_UI)))
450; MIPS64R2-EL-NEXT:    daddu $1, $1, $25
451; MIPS64R2-EL-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(load_UI)))
452; MIPS64R2-EL-NEXT:    ld $1, %got_disp(sui)($1)
453; MIPS64R2-EL-NEXT:    lwl $2, 3($1)
454; MIPS64R2-EL-NEXT:    lwr $2, 0($1)
455; MIPS64R2-EL-NEXT:    jr $ra
456; MIPS64R2-EL-NEXT:    dext $2, $2, 0, 32
457;
458; MIPS64R2-EB-LABEL: load_UI:
459; MIPS64R2-EB:       # %bb.0: # %entry
460; MIPS64R2-EB-NEXT:    lui $1, %hi(%neg(%gp_rel(load_UI)))
461; MIPS64R2-EB-NEXT:    daddu $1, $1, $25
462; MIPS64R2-EB-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(load_UI)))
463; MIPS64R2-EB-NEXT:    ld $1, %got_disp(sui)($1)
464; MIPS64R2-EB-NEXT:    lwl $2, 0($1)
465; MIPS64R2-EB-NEXT:    lwr $2, 3($1)
466; MIPS64R2-EB-NEXT:    jr $ra
467; MIPS64R2-EB-NEXT:    dext $2, $2, 0, 32
468;
469; MIPS64R6-LABEL: load_UI:
470; MIPS64R6:       # %bb.0: # %entry
471; MIPS64R6-NEXT:    lui $1, %hi(%neg(%gp_rel(load_UI)))
472; MIPS64R6-NEXT:    daddu $1, $1, $25
473; MIPS64R6-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(load_UI)))
474; MIPS64R6-NEXT:    ld $1, %got_disp(sui)($1)
475; MIPS64R6-NEXT:    jr $ra
476; MIPS64R6-NEXT:    lwu $2, 0($1)
477entry:
478  %0 = load i32, ptr @sui, align 1
479  %conv = zext i32 %0 to i64
480  ret i64 %conv
481}
482
483define void @store_SLL(i64 %a) nounwind {
484; MIPS32-EL-LABEL: store_SLL:
485; MIPS32-EL:       # %bb.0: # %entry
486; MIPS32-EL-NEXT:    lui $2, %hi(_gp_disp)
487; MIPS32-EL-NEXT:    addiu $2, $2, %lo(_gp_disp)
488; MIPS32-EL-NEXT:    addu $1, $2, $25
489; MIPS32-EL-NEXT:    lw $1, %got(sll)($1)
490; MIPS32-EL-NEXT:    swl $5, 7($1)
491; MIPS32-EL-NEXT:    swl $4, 3($1)
492; MIPS32-EL-NEXT:    swr $5, 4($1)
493; MIPS32-EL-NEXT:    jr $ra
494; MIPS32-EL-NEXT:    swr $4, 0($1)
495;
496; MIPS32-EB-LABEL: store_SLL:
497; MIPS32-EB:       # %bb.0: # %entry
498; MIPS32-EB-NEXT:    lui $2, %hi(_gp_disp)
499; MIPS32-EB-NEXT:    addiu $2, $2, %lo(_gp_disp)
500; MIPS32-EB-NEXT:    addu $1, $2, $25
501; MIPS32-EB-NEXT:    lw $1, %got(sll)($1)
502; MIPS32-EB-NEXT:    swl $5, 4($1)
503; MIPS32-EB-NEXT:    swl $4, 0($1)
504; MIPS32-EB-NEXT:    swr $5, 7($1)
505; MIPS32-EB-NEXT:    jr $ra
506; MIPS32-EB-NEXT:    swr $4, 3($1)
507;
508; MIPS32R6-LABEL: store_SLL:
509; MIPS32R6:       # %bb.0: # %entry
510; MIPS32R6-NEXT:    lui $2, %hi(_gp_disp)
511; MIPS32R6-NEXT:    addiu $2, $2, %lo(_gp_disp)
512; MIPS32R6-NEXT:    addu $1, $2, $25
513; MIPS32R6-NEXT:    lw $1, %got(sll)($1)
514; MIPS32R6-NEXT:    sw $5, 4($1)
515; MIPS32R6-NEXT:    jr $ra
516; MIPS32R6-NEXT:    sw $4, 0($1)
517;
518; MIPS64-EL-LABEL: store_SLL:
519; MIPS64-EL:       # %bb.0: # %entry
520; MIPS64-EL-NEXT:    lui $1, %hi(%neg(%gp_rel(store_SLL)))
521; MIPS64-EL-NEXT:    daddu $1, $1, $25
522; MIPS64-EL-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(store_SLL)))
523; MIPS64-EL-NEXT:    ld $1, %got_disp(sll)($1)
524; MIPS64-EL-NEXT:    sdl $4, 7($1)
525; MIPS64-EL-NEXT:    jr $ra
526; MIPS64-EL-NEXT:    sdr $4, 0($1)
527;
528; MIPS64-EB-LABEL: store_SLL:
529; MIPS64-EB:       # %bb.0: # %entry
530; MIPS64-EB-NEXT:    lui $1, %hi(%neg(%gp_rel(store_SLL)))
531; MIPS64-EB-NEXT:    daddu $1, $1, $25
532; MIPS64-EB-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(store_SLL)))
533; MIPS64-EB-NEXT:    ld $1, %got_disp(sll)($1)
534; MIPS64-EB-NEXT:    sdl $4, 0($1)
535; MIPS64-EB-NEXT:    jr $ra
536; MIPS64-EB-NEXT:    sdr $4, 7($1)
537;
538; MIPS64R2-EL-LABEL: store_SLL:
539; MIPS64R2-EL:       # %bb.0: # %entry
540; MIPS64R2-EL-NEXT:    lui $1, %hi(%neg(%gp_rel(store_SLL)))
541; MIPS64R2-EL-NEXT:    daddu $1, $1, $25
542; MIPS64R2-EL-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(store_SLL)))
543; MIPS64R2-EL-NEXT:    ld $1, %got_disp(sll)($1)
544; MIPS64R2-EL-NEXT:    sdl $4, 7($1)
545; MIPS64R2-EL-NEXT:    jr $ra
546; MIPS64R2-EL-NEXT:    sdr $4, 0($1)
547;
548; MIPS64R2-EB-LABEL: store_SLL:
549; MIPS64R2-EB:       # %bb.0: # %entry
550; MIPS64R2-EB-NEXT:    lui $1, %hi(%neg(%gp_rel(store_SLL)))
551; MIPS64R2-EB-NEXT:    daddu $1, $1, $25
552; MIPS64R2-EB-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(store_SLL)))
553; MIPS64R2-EB-NEXT:    ld $1, %got_disp(sll)($1)
554; MIPS64R2-EB-NEXT:    sdl $4, 0($1)
555; MIPS64R2-EB-NEXT:    jr $ra
556; MIPS64R2-EB-NEXT:    sdr $4, 7($1)
557;
558; MIPS64R6-LABEL: store_SLL:
559; MIPS64R6:       # %bb.0: # %entry
560; MIPS64R6-NEXT:    lui $1, %hi(%neg(%gp_rel(store_SLL)))
561; MIPS64R6-NEXT:    daddu $1, $1, $25
562; MIPS64R6-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(store_SLL)))
563; MIPS64R6-NEXT:    ld $1, %got_disp(sll)($1)
564; MIPS64R6-NEXT:    jr $ra
565; MIPS64R6-NEXT:    sd $4, 0($1)
566entry:
567  store i64 %a, ptr @sll, align 1
568  ret void
569}
570
571define void @store_SI_trunc_from_i64(i32 signext %a) nounwind {
572; MIPS32-EL-LABEL: store_SI_trunc_from_i64:
573; MIPS32-EL:       # %bb.0: # %entry
574; MIPS32-EL-NEXT:    lui $2, %hi(_gp_disp)
575; MIPS32-EL-NEXT:    addiu $2, $2, %lo(_gp_disp)
576; MIPS32-EL-NEXT:    addu $1, $2, $25
577; MIPS32-EL-NEXT:    lw $1, %got(si)($1)
578; MIPS32-EL-NEXT:    swl $4, 3($1)
579; MIPS32-EL-NEXT:    jr $ra
580; MIPS32-EL-NEXT:    swr $4, 0($1)
581;
582; MIPS32-EB-LABEL: store_SI_trunc_from_i64:
583; MIPS32-EB:       # %bb.0: # %entry
584; MIPS32-EB-NEXT:    lui $2, %hi(_gp_disp)
585; MIPS32-EB-NEXT:    addiu $2, $2, %lo(_gp_disp)
586; MIPS32-EB-NEXT:    addu $1, $2, $25
587; MIPS32-EB-NEXT:    lw $1, %got(si)($1)
588; MIPS32-EB-NEXT:    swl $4, 0($1)
589; MIPS32-EB-NEXT:    jr $ra
590; MIPS32-EB-NEXT:    swr $4, 3($1)
591;
592; MIPS32R6-LABEL: store_SI_trunc_from_i64:
593; MIPS32R6:       # %bb.0: # %entry
594; MIPS32R6-NEXT:    lui $2, %hi(_gp_disp)
595; MIPS32R6-NEXT:    addiu $2, $2, %lo(_gp_disp)
596; MIPS32R6-NEXT:    addu $1, $2, $25
597; MIPS32R6-NEXT:    lw $1, %got(si)($1)
598; MIPS32R6-NEXT:    jr $ra
599; MIPS32R6-NEXT:    sw $4, 0($1)
600;
601; MIPS64-EL-LABEL: store_SI_trunc_from_i64:
602; MIPS64-EL:       # %bb.0: # %entry
603; MIPS64-EL-NEXT:    lui $1, %hi(%neg(%gp_rel(store_SI_trunc_from_i64)))
604; MIPS64-EL-NEXT:    daddu $1, $1, $25
605; MIPS64-EL-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(store_SI_trunc_from_i64)))
606; MIPS64-EL-NEXT:    ld $1, %got_disp(si)($1)
607; MIPS64-EL-NEXT:    swl $4, 3($1)
608; MIPS64-EL-NEXT:    jr $ra
609; MIPS64-EL-NEXT:    swr $4, 0($1)
610;
611; MIPS64-EB-LABEL: store_SI_trunc_from_i64:
612; MIPS64-EB:       # %bb.0: # %entry
613; MIPS64-EB-NEXT:    lui $1, %hi(%neg(%gp_rel(store_SI_trunc_from_i64)))
614; MIPS64-EB-NEXT:    daddu $1, $1, $25
615; MIPS64-EB-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(store_SI_trunc_from_i64)))
616; MIPS64-EB-NEXT:    ld $1, %got_disp(si)($1)
617; MIPS64-EB-NEXT:    swl $4, 0($1)
618; MIPS64-EB-NEXT:    jr $ra
619; MIPS64-EB-NEXT:    swr $4, 3($1)
620;
621; MIPS64R2-EL-LABEL: store_SI_trunc_from_i64:
622; MIPS64R2-EL:       # %bb.0: # %entry
623; MIPS64R2-EL-NEXT:    lui $1, %hi(%neg(%gp_rel(store_SI_trunc_from_i64)))
624; MIPS64R2-EL-NEXT:    daddu $1, $1, $25
625; MIPS64R2-EL-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(store_SI_trunc_from_i64)))
626; MIPS64R2-EL-NEXT:    ld $1, %got_disp(si)($1)
627; MIPS64R2-EL-NEXT:    swl $4, 3($1)
628; MIPS64R2-EL-NEXT:    jr $ra
629; MIPS64R2-EL-NEXT:    swr $4, 0($1)
630;
631; MIPS64R2-EB-LABEL: store_SI_trunc_from_i64:
632; MIPS64R2-EB:       # %bb.0: # %entry
633; MIPS64R2-EB-NEXT:    lui $1, %hi(%neg(%gp_rel(store_SI_trunc_from_i64)))
634; MIPS64R2-EB-NEXT:    daddu $1, $1, $25
635; MIPS64R2-EB-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(store_SI_trunc_from_i64)))
636; MIPS64R2-EB-NEXT:    ld $1, %got_disp(si)($1)
637; MIPS64R2-EB-NEXT:    swl $4, 0($1)
638; MIPS64R2-EB-NEXT:    jr $ra
639; MIPS64R2-EB-NEXT:    swr $4, 3($1)
640;
641; MIPS64R6-LABEL: store_SI_trunc_from_i64:
642; MIPS64R6:       # %bb.0: # %entry
643; MIPS64R6-NEXT:    lui $1, %hi(%neg(%gp_rel(store_SI_trunc_from_i64)))
644; MIPS64R6-NEXT:    daddu $1, $1, $25
645; MIPS64R6-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(store_SI_trunc_from_i64)))
646; MIPS64R6-NEXT:    ld $1, %got_disp(si)($1)
647; MIPS64R6-NEXT:    jr $ra
648; MIPS64R6-NEXT:    sw $4, 0($1)
649entry:
650  store i32 %a, ptr @si, align 1
651  ret void
652}
653
654;
655; Structures are simply concatenations of the members. They are unaffected by
656; endianness
657;
658
659%struct.S0 = type { i8, i8 }
660@struct_s0 = common global %struct.S0 zeroinitializer, align 1
661%struct.S1 = type { i16, i16 }
662@struct_s1 = common global %struct.S1 zeroinitializer, align 1
663%struct.S2 = type { i32, i32 }
664@struct_s2 = common global %struct.S2 zeroinitializer, align 1
665
666define void @copy_struct_S0() nounwind {
667; MIPS32-LABEL: copy_struct_S0:
668; MIPS32:       # %bb.0: # %entry
669; MIPS32-NEXT:    lui $2, %hi(_gp_disp)
670; MIPS32-NEXT:    addiu $2, $2, %lo(_gp_disp)
671; MIPS32-NEXT:    addu $1, $2, $25
672; MIPS32-NEXT:    lw $1, %got(struct_s0)($1)
673; MIPS32-NEXT:    lbu $2, 0($1)
674; MIPS32-NEXT:    sb $2, 2($1)
675; MIPS32-NEXT:    lbu $2, 1($1)
676; MIPS32-NEXT:    jr $ra
677; MIPS32-NEXT:    sb $2, 3($1)
678;
679; MIPS32R6-LABEL: copy_struct_S0:
680; MIPS32R6:       # %bb.0: # %entry
681; MIPS32R6-NEXT:    lui $2, %hi(_gp_disp)
682; MIPS32R6-NEXT:    addiu $2, $2, %lo(_gp_disp)
683; MIPS32R6-NEXT:    addu $1, $2, $25
684; MIPS32R6-NEXT:    lw $1, %got(struct_s0)($1)
685; MIPS32R6-NEXT:    lhu $2, 0($1)
686; MIPS32R6-NEXT:    jr $ra
687; MIPS32R6-NEXT:    sh $2, 2($1)
688;
689; MIPS64-LABEL: copy_struct_S0:
690; MIPS64:       # %bb.0: # %entry
691; MIPS64-NEXT:    lui $1, %hi(%neg(%gp_rel(copy_struct_S0)))
692; MIPS64-NEXT:    daddu $1, $1, $25
693; MIPS64-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(copy_struct_S0)))
694; MIPS64-NEXT:    ld $1, %got_disp(struct_s0)($1)
695; MIPS64-NEXT:    lbu $2, 0($1)
696; MIPS64-NEXT:    sb $2, 2($1)
697; MIPS64-NEXT:    lbu $2, 1($1)
698; MIPS64-NEXT:    jr $ra
699; MIPS64-NEXT:    sb $2, 3($1)
700;
701; MIPS64R6-LABEL: copy_struct_S0:
702; MIPS64R6:       # %bb.0: # %entry
703; MIPS64R6-NEXT:    lui $1, %hi(%neg(%gp_rel(copy_struct_S0)))
704; MIPS64R6-NEXT:    daddu $1, $1, $25
705; MIPS64R6-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(copy_struct_S0)))
706; MIPS64R6-NEXT:    ld $1, %got_disp(struct_s0)($1)
707; MIPS64R6-NEXT:    lhu $2, 0($1)
708; MIPS64R6-NEXT:    jr $ra
709; MIPS64R6-NEXT:    sh $2, 2($1)
710entry:
711  %0 = load %struct.S0, ptr @struct_s0, align 1
712  store %struct.S0 %0, ptr getelementptr inbounds (%struct.S0, ptr @struct_s0, i32 1), align 1
713  ret void
714}
715
716define void @copy_struct_S1() nounwind {
717; MIPS32-EL-LABEL: copy_struct_S1:
718; MIPS32-EL:       # %bb.0: # %entry
719; MIPS32-EL-NEXT:    lui $2, %hi(_gp_disp)
720; MIPS32-EL-NEXT:    addiu $2, $2, %lo(_gp_disp)
721; MIPS32-EL-NEXT:    addu $1, $2, $25
722; MIPS32-EL-NEXT:    lw $1, %got(struct_s1)($1)
723; MIPS32-EL-NEXT:    lwl $2, 3($1)
724; MIPS32-EL-NEXT:    lwr $2, 0($1)
725; MIPS32-EL-NEXT:    swl $2, 7($1)
726; MIPS32-EL-NEXT:    jr $ra
727; MIPS32-EL-NEXT:    swr $2, 4($1)
728;
729; MIPS32-EB-LABEL: copy_struct_S1:
730; MIPS32-EB:       # %bb.0: # %entry
731; MIPS32-EB-NEXT:    lui $2, %hi(_gp_disp)
732; MIPS32-EB-NEXT:    addiu $2, $2, %lo(_gp_disp)
733; MIPS32-EB-NEXT:    addu $1, $2, $25
734; MIPS32-EB-NEXT:    lw $1, %got(struct_s1)($1)
735; MIPS32-EB-NEXT:    lwl $2, 0($1)
736; MIPS32-EB-NEXT:    lwr $2, 3($1)
737; MIPS32-EB-NEXT:    swl $2, 4($1)
738; MIPS32-EB-NEXT:    jr $ra
739; MIPS32-EB-NEXT:    swr $2, 7($1)
740;
741; MIPS32R6-LABEL: copy_struct_S1:
742; MIPS32R6:       # %bb.0: # %entry
743; MIPS32R6-NEXT:    lui $2, %hi(_gp_disp)
744; MIPS32R6-NEXT:    addiu $2, $2, %lo(_gp_disp)
745; MIPS32R6-NEXT:    addu $1, $2, $25
746; MIPS32R6-NEXT:    lw $1, %got(struct_s1)($1)
747; MIPS32R6-NEXT:    lw $2, 0($1)
748; MIPS32R6-NEXT:    jr $ra
749; MIPS32R6-NEXT:    sw $2, 4($1)
750;
751; MIPS64-EL-LABEL: copy_struct_S1:
752; MIPS64-EL:       # %bb.0: # %entry
753; MIPS64-EL-NEXT:    lui $1, %hi(%neg(%gp_rel(copy_struct_S1)))
754; MIPS64-EL-NEXT:    daddu $1, $1, $25
755; MIPS64-EL-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(copy_struct_S1)))
756; MIPS64-EL-NEXT:    ld $1, %got_disp(struct_s1)($1)
757; MIPS64-EL-NEXT:    lwl $2, 3($1)
758; MIPS64-EL-NEXT:    lwr $2, 0($1)
759; MIPS64-EL-NEXT:    swl $2, 7($1)
760; MIPS64-EL-NEXT:    jr $ra
761; MIPS64-EL-NEXT:    swr $2, 4($1)
762;
763; MIPS64-EB-LABEL: copy_struct_S1:
764; MIPS64-EB:       # %bb.0: # %entry
765; MIPS64-EB-NEXT:    lui $1, %hi(%neg(%gp_rel(copy_struct_S1)))
766; MIPS64-EB-NEXT:    daddu $1, $1, $25
767; MIPS64-EB-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(copy_struct_S1)))
768; MIPS64-EB-NEXT:    ld $1, %got_disp(struct_s1)($1)
769; MIPS64-EB-NEXT:    lwl $2, 0($1)
770; MIPS64-EB-NEXT:    lwr $2, 3($1)
771; MIPS64-EB-NEXT:    swl $2, 4($1)
772; MIPS64-EB-NEXT:    jr $ra
773; MIPS64-EB-NEXT:    swr $2, 7($1)
774;
775; MIPS64R2-EL-LABEL: copy_struct_S1:
776; MIPS64R2-EL:       # %bb.0: # %entry
777; MIPS64R2-EL-NEXT:    lui $1, %hi(%neg(%gp_rel(copy_struct_S1)))
778; MIPS64R2-EL-NEXT:    daddu $1, $1, $25
779; MIPS64R2-EL-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(copy_struct_S1)))
780; MIPS64R2-EL-NEXT:    ld $1, %got_disp(struct_s1)($1)
781; MIPS64R2-EL-NEXT:    lwl $2, 3($1)
782; MIPS64R2-EL-NEXT:    lwr $2, 0($1)
783; MIPS64R2-EL-NEXT:    swl $2, 7($1)
784; MIPS64R2-EL-NEXT:    jr $ra
785; MIPS64R2-EL-NEXT:    swr $2, 4($1)
786;
787; MIPS64R2-EB-LABEL: copy_struct_S1:
788; MIPS64R2-EB:       # %bb.0: # %entry
789; MIPS64R2-EB-NEXT:    lui $1, %hi(%neg(%gp_rel(copy_struct_S1)))
790; MIPS64R2-EB-NEXT:    daddu $1, $1, $25
791; MIPS64R2-EB-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(copy_struct_S1)))
792; MIPS64R2-EB-NEXT:    ld $1, %got_disp(struct_s1)($1)
793; MIPS64R2-EB-NEXT:    lwl $2, 0($1)
794; MIPS64R2-EB-NEXT:    lwr $2, 3($1)
795; MIPS64R2-EB-NEXT:    swl $2, 4($1)
796; MIPS64R2-EB-NEXT:    jr $ra
797; MIPS64R2-EB-NEXT:    swr $2, 7($1)
798;
799; MIPS64R6-LABEL: copy_struct_S1:
800; MIPS64R6:       # %bb.0: # %entry
801; MIPS64R6-NEXT:    lui $1, %hi(%neg(%gp_rel(copy_struct_S1)))
802; MIPS64R6-NEXT:    daddu $1, $1, $25
803; MIPS64R6-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(copy_struct_S1)))
804; MIPS64R6-NEXT:    ld $1, %got_disp(struct_s1)($1)
805; MIPS64R6-NEXT:    lw $2, 0($1)
806; MIPS64R6-NEXT:    jr $ra
807; MIPS64R6-NEXT:    sw $2, 4($1)
808entry:
809  %0 = load %struct.S1, ptr @struct_s1, align 1
810  store %struct.S1 %0, ptr getelementptr inbounds (%struct.S1, ptr @struct_s1, i32 1), align 1
811  ret void
812}
813
814define void @copy_struct_S2() nounwind {
815; MIPS32-EL-LABEL: copy_struct_S2:
816; MIPS32-EL:       # %bb.0: # %entry
817; MIPS32-EL-NEXT:    lui $2, %hi(_gp_disp)
818; MIPS32-EL-NEXT:    addiu $2, $2, %lo(_gp_disp)
819; MIPS32-EL-NEXT:    addu $1, $2, $25
820; MIPS32-EL-NEXT:    lw $1, %got(struct_s2)($1)
821; MIPS32-EL-NEXT:    lwl $2, 3($1)
822; MIPS32-EL-NEXT:    lwr $2, 0($1)
823; MIPS32-EL-NEXT:    swl $2, 11($1)
824; MIPS32-EL-NEXT:    lwl $3, 7($1)
825; MIPS32-EL-NEXT:    lwr $3, 4($1)
826; MIPS32-EL-NEXT:    swl $3, 15($1)
827; MIPS32-EL-NEXT:    swr $2, 8($1)
828; MIPS32-EL-NEXT:    jr $ra
829; MIPS32-EL-NEXT:    swr $3, 12($1)
830;
831; MIPS32-EB-LABEL: copy_struct_S2:
832; MIPS32-EB:       # %bb.0: # %entry
833; MIPS32-EB-NEXT:    lui $2, %hi(_gp_disp)
834; MIPS32-EB-NEXT:    addiu $2, $2, %lo(_gp_disp)
835; MIPS32-EB-NEXT:    addu $1, $2, $25
836; MIPS32-EB-NEXT:    lw $1, %got(struct_s2)($1)
837; MIPS32-EB-NEXT:    lwl $2, 0($1)
838; MIPS32-EB-NEXT:    lwr $2, 3($1)
839; MIPS32-EB-NEXT:    swl $2, 8($1)
840; MIPS32-EB-NEXT:    lwl $3, 4($1)
841; MIPS32-EB-NEXT:    lwr $3, 7($1)
842; MIPS32-EB-NEXT:    swl $3, 12($1)
843; MIPS32-EB-NEXT:    swr $2, 11($1)
844; MIPS32-EB-NEXT:    jr $ra
845; MIPS32-EB-NEXT:    swr $3, 15($1)
846;
847; MIPS32R6-LABEL: copy_struct_S2:
848; MIPS32R6:       # %bb.0: # %entry
849; MIPS32R6-NEXT:    lui $2, %hi(_gp_disp)
850; MIPS32R6-NEXT:    addiu $2, $2, %lo(_gp_disp)
851; MIPS32R6-NEXT:    addu $1, $2, $25
852; MIPS32R6-NEXT:    lw $1, %got(struct_s2)($1)
853; MIPS32R6-NEXT:    lw $2, 0($1)
854; MIPS32R6-NEXT:    sw $2, 8($1)
855; MIPS32R6-NEXT:    lw $2, 4($1)
856; MIPS32R6-NEXT:    jr $ra
857; MIPS32R6-NEXT:    sw $2, 12($1)
858;
859; MIPS64-EL-LABEL: copy_struct_S2:
860; MIPS64-EL:       # %bb.0: # %entry
861; MIPS64-EL-NEXT:    lui $1, %hi(%neg(%gp_rel(copy_struct_S2)))
862; MIPS64-EL-NEXT:    daddu $1, $1, $25
863; MIPS64-EL-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(copy_struct_S2)))
864; MIPS64-EL-NEXT:    ld $1, %got_disp(struct_s2)($1)
865; MIPS64-EL-NEXT:    ldl $2, 7($1)
866; MIPS64-EL-NEXT:    ldr $2, 0($1)
867; MIPS64-EL-NEXT:    sdl $2, 15($1)
868; MIPS64-EL-NEXT:    jr $ra
869; MIPS64-EL-NEXT:    sdr $2, 8($1)
870;
871; MIPS64-EB-LABEL: copy_struct_S2:
872; MIPS64-EB:       # %bb.0: # %entry
873; MIPS64-EB-NEXT:    lui $1, %hi(%neg(%gp_rel(copy_struct_S2)))
874; MIPS64-EB-NEXT:    daddu $1, $1, $25
875; MIPS64-EB-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(copy_struct_S2)))
876; MIPS64-EB-NEXT:    ld $1, %got_disp(struct_s2)($1)
877; MIPS64-EB-NEXT:    ldl $2, 0($1)
878; MIPS64-EB-NEXT:    ldr $2, 7($1)
879; MIPS64-EB-NEXT:    sdl $2, 8($1)
880; MIPS64-EB-NEXT:    jr $ra
881; MIPS64-EB-NEXT:    sdr $2, 15($1)
882;
883; MIPS64R2-EL-LABEL: copy_struct_S2:
884; MIPS64R2-EL:       # %bb.0: # %entry
885; MIPS64R2-EL-NEXT:    lui $1, %hi(%neg(%gp_rel(copy_struct_S2)))
886; MIPS64R2-EL-NEXT:    daddu $1, $1, $25
887; MIPS64R2-EL-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(copy_struct_S2)))
888; MIPS64R2-EL-NEXT:    ld $1, %got_disp(struct_s2)($1)
889; MIPS64R2-EL-NEXT:    ldl $2, 7($1)
890; MIPS64R2-EL-NEXT:    ldr $2, 0($1)
891; MIPS64R2-EL-NEXT:    sdl $2, 15($1)
892; MIPS64R2-EL-NEXT:    jr $ra
893; MIPS64R2-EL-NEXT:    sdr $2, 8($1)
894;
895; MIPS64R2-EB-LABEL: copy_struct_S2:
896; MIPS64R2-EB:       # %bb.0: # %entry
897; MIPS64R2-EB-NEXT:    lui $1, %hi(%neg(%gp_rel(copy_struct_S2)))
898; MIPS64R2-EB-NEXT:    daddu $1, $1, $25
899; MIPS64R2-EB-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(copy_struct_S2)))
900; MIPS64R2-EB-NEXT:    ld $1, %got_disp(struct_s2)($1)
901; MIPS64R2-EB-NEXT:    ldl $2, 0($1)
902; MIPS64R2-EB-NEXT:    ldr $2, 7($1)
903; MIPS64R2-EB-NEXT:    sdl $2, 8($1)
904; MIPS64R2-EB-NEXT:    jr $ra
905; MIPS64R2-EB-NEXT:    sdr $2, 15($1)
906;
907; MIPS64R6-LABEL: copy_struct_S2:
908; MIPS64R6:       # %bb.0: # %entry
909; MIPS64R6-NEXT:    lui $1, %hi(%neg(%gp_rel(copy_struct_S2)))
910; MIPS64R6-NEXT:    daddu $1, $1, $25
911; MIPS64R6-NEXT:    daddiu $1, $1, %lo(%neg(%gp_rel(copy_struct_S2)))
912; MIPS64R6-NEXT:    ld $1, %got_disp(struct_s2)($1)
913; MIPS64R6-NEXT:    ld $2, 0($1)
914; MIPS64R6-NEXT:    jr $ra
915; MIPS64R6-NEXT:    sd $2, 8($1)
916entry:
917  %0 = load %struct.S2, ptr @struct_s2, align 1
918  store %struct.S2 %0, ptr getelementptr inbounds (%struct.S2, ptr @struct_s2, i32 1), align 1
919  ret void
920}
921
922;
923; Arrays are simply concatenations of the members. They are unaffected by
924; endianness
925;
926
927@arr = common global [7 x i8] zeroinitializer, align 1
928
929define void @pass_array_byval() nounwind {
930; MIPS32-EL-LABEL: pass_array_byval:
931; MIPS32-EL:       # %bb.0: # %entry
932; MIPS32-EL-NEXT:    lui $2, %hi(_gp_disp)
933; MIPS32-EL-NEXT:    addiu $2, $2, %lo(_gp_disp)
934; MIPS32-EL-NEXT:    addiu $sp, $sp, -24
935; MIPS32-EL-NEXT:    sw $ra, 20($sp) # 4-byte Folded Spill
936; MIPS32-EL-NEXT:    addu $gp, $2, $25
937; MIPS32-EL-NEXT:    lw $1, %got(arr)($gp)
938; MIPS32-EL-NEXT:    lwl $4, 3($1)
939; MIPS32-EL-NEXT:    lwr $4, 0($1)
940; MIPS32-EL-NEXT:    lbu $2, 4($1)
941; MIPS32-EL-NEXT:    lbu $3, 5($1)
942; MIPS32-EL-NEXT:    sll $3, $3, 8
943; MIPS32-EL-NEXT:    or $2, $3, $2
944; MIPS32-EL-NEXT:    lbu $1, 6($1)
945; MIPS32-EL-NEXT:    sll $1, $1, 16
946; MIPS32-EL-NEXT:    lw $25, %call16(extern_func)($gp)
947; MIPS32-EL-NEXT:    .reloc ($tmp0), R_MIPS_JALR, extern_func
948; MIPS32-EL-NEXT:  $tmp0:
949; MIPS32-EL-NEXT:    jalr $25
950; MIPS32-EL-NEXT:    or $5, $2, $1
951; MIPS32-EL-NEXT:    lw $ra, 20($sp) # 4-byte Folded Reload
952; MIPS32-EL-NEXT:    jr $ra
953; MIPS32-EL-NEXT:    addiu $sp, $sp, 24
954;
955; MIPS32-EB-LABEL: pass_array_byval:
956; MIPS32-EB:       # %bb.0: # %entry
957; MIPS32-EB-NEXT:    lui $2, %hi(_gp_disp)
958; MIPS32-EB-NEXT:    addiu $2, $2, %lo(_gp_disp)
959; MIPS32-EB-NEXT:    addiu $sp, $sp, -24
960; MIPS32-EB-NEXT:    sw $ra, 20($sp) # 4-byte Folded Spill
961; MIPS32-EB-NEXT:    addu $gp, $2, $25
962; MIPS32-EB-NEXT:    lw $1, %got(arr)($gp)
963; MIPS32-EB-NEXT:    lwl $4, 0($1)
964; MIPS32-EB-NEXT:    lbu $2, 5($1)
965; MIPS32-EB-NEXT:    lwr $4, 3($1)
966; MIPS32-EB-NEXT:    sll $2, $2, 16
967; MIPS32-EB-NEXT:    lbu $3, 4($1)
968; MIPS32-EB-NEXT:    sll $3, $3, 24
969; MIPS32-EB-NEXT:    or $2, $3, $2
970; MIPS32-EB-NEXT:    lbu $1, 6($1)
971; MIPS32-EB-NEXT:    sll $1, $1, 8
972; MIPS32-EB-NEXT:    lw $25, %call16(extern_func)($gp)
973; MIPS32-EB-NEXT:    .reloc ($tmp0), R_MIPS_JALR, extern_func
974; MIPS32-EB-NEXT:  $tmp0:
975; MIPS32-EB-NEXT:    jalr $25
976; MIPS32-EB-NEXT:    or $5, $2, $1
977; MIPS32-EB-NEXT:    lw $ra, 20($sp) # 4-byte Folded Reload
978; MIPS32-EB-NEXT:    jr $ra
979; MIPS32-EB-NEXT:    addiu $sp, $sp, 24
980;
981; MIPS32R6-EL-LABEL: pass_array_byval:
982; MIPS32R6-EL:       # %bb.0: # %entry
983; MIPS32R6-EL-NEXT:    lui $2, %hi(_gp_disp)
984; MIPS32R6-EL-NEXT:    addiu $2, $2, %lo(_gp_disp)
985; MIPS32R6-EL-NEXT:    addiu $sp, $sp, -24
986; MIPS32R6-EL-NEXT:    sw $ra, 20($sp) # 4-byte Folded Spill
987; MIPS32R6-EL-NEXT:    addu $gp, $2, $25
988; MIPS32R6-EL-NEXT:    lw $1, %got(arr)($gp)
989; MIPS32R6-EL-NEXT:    lhu $2, 4($1)
990; MIPS32R6-EL-NEXT:    lbu $3, 6($1)
991; MIPS32R6-EL-NEXT:    sll $3, $3, 16
992; MIPS32R6-EL-NEXT:    lw $4, 0($1)
993; MIPS32R6-EL-NEXT:    lw $25, %call16(extern_func)($gp)
994; MIPS32R6-EL-NEXT:    .reloc ($tmp0), R_MIPS_JALR, extern_func
995; MIPS32R6-EL-NEXT:  $tmp0:
996; MIPS32R6-EL-NEXT:    jalr $25
997; MIPS32R6-EL-NEXT:    or $5, $2, $3
998; MIPS32R6-EL-NEXT:    lw $ra, 20($sp) # 4-byte Folded Reload
999; MIPS32R6-EL-NEXT:    jr $ra
1000; MIPS32R6-EL-NEXT:    addiu $sp, $sp, 24
1001;
1002; MIPS32R6-EB-LABEL: pass_array_byval:
1003; MIPS32R6-EB:       # %bb.0: # %entry
1004; MIPS32R6-EB-NEXT:    lui $2, %hi(_gp_disp)
1005; MIPS32R6-EB-NEXT:    addiu $2, $2, %lo(_gp_disp)
1006; MIPS32R6-EB-NEXT:    addiu $sp, $sp, -24
1007; MIPS32R6-EB-NEXT:    sw $ra, 20($sp) # 4-byte Folded Spill
1008; MIPS32R6-EB-NEXT:    addu $gp, $2, $25
1009; MIPS32R6-EB-NEXT:    lw $1, %got(arr)($gp)
1010; MIPS32R6-EB-NEXT:    lbu $2, 6($1)
1011; MIPS32R6-EB-NEXT:    sll $2, $2, 8
1012; MIPS32R6-EB-NEXT:    lhu $3, 4($1)
1013; MIPS32R6-EB-NEXT:    sll $3, $3, 16
1014; MIPS32R6-EB-NEXT:    lw $4, 0($1)
1015; MIPS32R6-EB-NEXT:    lw $25, %call16(extern_func)($gp)
1016; MIPS32R6-EB-NEXT:    .reloc ($tmp0), R_MIPS_JALR, extern_func
1017; MIPS32R6-EB-NEXT:  $tmp0:
1018; MIPS32R6-EB-NEXT:    jalr $25
1019; MIPS32R6-EB-NEXT:    or $5, $3, $2
1020; MIPS32R6-EB-NEXT:    lw $ra, 20($sp) # 4-byte Folded Reload
1021; MIPS32R6-EB-NEXT:    jr $ra
1022; MIPS32R6-EB-NEXT:    addiu $sp, $sp, 24
1023;
1024; MIPS64-EL-LABEL: pass_array_byval:
1025; MIPS64-EL:       # %bb.0: # %entry
1026; MIPS64-EL-NEXT:    daddiu $sp, $sp, -16
1027; MIPS64-EL-NEXT:    sd $ra, 8($sp) # 8-byte Folded Spill
1028; MIPS64-EL-NEXT:    sd $gp, 0($sp) # 8-byte Folded Spill
1029; MIPS64-EL-NEXT:    lui $1, %hi(%neg(%gp_rel(pass_array_byval)))
1030; MIPS64-EL-NEXT:    daddu $1, $1, $25
1031; MIPS64-EL-NEXT:    daddiu $gp, $1, %lo(%neg(%gp_rel(pass_array_byval)))
1032; MIPS64-EL-NEXT:    ld $1, %got_disp(arr)($gp)
1033; MIPS64-EL-NEXT:    lbu $2, 4($1)
1034; MIPS64-EL-NEXT:    dsll $2, $2, 32
1035; MIPS64-EL-NEXT:    lbu $3, 5($1)
1036; MIPS64-EL-NEXT:    dsll $3, $3, 40
1037; MIPS64-EL-NEXT:    or $2, $3, $2
1038; MIPS64-EL-NEXT:    lwl $3, 3($1)
1039; MIPS64-EL-NEXT:    lwr $3, 0($1)
1040; MIPS64-EL-NEXT:    daddiu $4, $zero, 1
1041; MIPS64-EL-NEXT:    dsll $4, $4, 32
1042; MIPS64-EL-NEXT:    daddiu $4, $4, -1
1043; MIPS64-EL-NEXT:    and $3, $3, $4
1044; MIPS64-EL-NEXT:    or $2, $3, $2
1045; MIPS64-EL-NEXT:    lbu $1, 6($1)
1046; MIPS64-EL-NEXT:    dsll $1, $1, 48
1047; MIPS64-EL-NEXT:    ld $25, %call16(extern_func)($gp)
1048; MIPS64-EL-NEXT:    .reloc .Ltmp0, R_MIPS_JALR, extern_func
1049; MIPS64-EL-NEXT:  .Ltmp0:
1050; MIPS64-EL-NEXT:    jalr $25
1051; MIPS64-EL-NEXT:    or $4, $2, $1
1052; MIPS64-EL-NEXT:    ld $gp, 0($sp) # 8-byte Folded Reload
1053; MIPS64-EL-NEXT:    ld $ra, 8($sp) # 8-byte Folded Reload
1054; MIPS64-EL-NEXT:    jr $ra
1055; MIPS64-EL-NEXT:    daddiu $sp, $sp, 16
1056;
1057; MIPS64-EB-LABEL: pass_array_byval:
1058; MIPS64-EB:       # %bb.0: # %entry
1059; MIPS64-EB-NEXT:    daddiu $sp, $sp, -16
1060; MIPS64-EB-NEXT:    sd $ra, 8($sp) # 8-byte Folded Spill
1061; MIPS64-EB-NEXT:    sd $gp, 0($sp) # 8-byte Folded Spill
1062; MIPS64-EB-NEXT:    lui $1, %hi(%neg(%gp_rel(pass_array_byval)))
1063; MIPS64-EB-NEXT:    daddu $1, $1, $25
1064; MIPS64-EB-NEXT:    daddiu $gp, $1, %lo(%neg(%gp_rel(pass_array_byval)))
1065; MIPS64-EB-NEXT:    ld $1, %got_disp(arr)($gp)
1066; MIPS64-EB-NEXT:    lbu $2, 5($1)
1067; MIPS64-EB-NEXT:    dsll $2, $2, 16
1068; MIPS64-EB-NEXT:    lbu $3, 4($1)
1069; MIPS64-EB-NEXT:    dsll $3, $3, 24
1070; MIPS64-EB-NEXT:    or $2, $3, $2
1071; MIPS64-EB-NEXT:    lwl $3, 0($1)
1072; MIPS64-EB-NEXT:    lwr $3, 3($1)
1073; MIPS64-EB-NEXT:    dsll $3, $3, 32
1074; MIPS64-EB-NEXT:    or $2, $3, $2
1075; MIPS64-EB-NEXT:    lbu $1, 6($1)
1076; MIPS64-EB-NEXT:    dsll $1, $1, 8
1077; MIPS64-EB-NEXT:    ld $25, %call16(extern_func)($gp)
1078; MIPS64-EB-NEXT:    .reloc .Ltmp0, R_MIPS_JALR, extern_func
1079; MIPS64-EB-NEXT:  .Ltmp0:
1080; MIPS64-EB-NEXT:    jalr $25
1081; MIPS64-EB-NEXT:    or $4, $2, $1
1082; MIPS64-EB-NEXT:    ld $gp, 0($sp) # 8-byte Folded Reload
1083; MIPS64-EB-NEXT:    ld $ra, 8($sp) # 8-byte Folded Reload
1084; MIPS64-EB-NEXT:    jr $ra
1085; MIPS64-EB-NEXT:    daddiu $sp, $sp, 16
1086;
1087; MIPS64R2-EL-LABEL: pass_array_byval:
1088; MIPS64R2-EL:       # %bb.0: # %entry
1089; MIPS64R2-EL-NEXT:    daddiu $sp, $sp, -16
1090; MIPS64R2-EL-NEXT:    sd $ra, 8($sp) # 8-byte Folded Spill
1091; MIPS64R2-EL-NEXT:    sd $gp, 0($sp) # 8-byte Folded Spill
1092; MIPS64R2-EL-NEXT:    lui $1, %hi(%neg(%gp_rel(pass_array_byval)))
1093; MIPS64R2-EL-NEXT:    daddu $1, $1, $25
1094; MIPS64R2-EL-NEXT:    daddiu $gp, $1, %lo(%neg(%gp_rel(pass_array_byval)))
1095; MIPS64R2-EL-NEXT:    ld $1, %got_disp(arr)($gp)
1096; MIPS64R2-EL-NEXT:    lbu $2, 4($1)
1097; MIPS64R2-EL-NEXT:    dsll $2, $2, 32
1098; MIPS64R2-EL-NEXT:    lbu $3, 5($1)
1099; MIPS64R2-EL-NEXT:    dsll $3, $3, 40
1100; MIPS64R2-EL-NEXT:    or $2, $3, $2
1101; MIPS64R2-EL-NEXT:    lwl $3, 3($1)
1102; MIPS64R2-EL-NEXT:    lwr $3, 0($1)
1103; MIPS64R2-EL-NEXT:    dext $3, $3, 0, 32
1104; MIPS64R2-EL-NEXT:    or $2, $3, $2
1105; MIPS64R2-EL-NEXT:    lbu $1, 6($1)
1106; MIPS64R2-EL-NEXT:    dsll $1, $1, 48
1107; MIPS64R2-EL-NEXT:    ld $25, %call16(extern_func)($gp)
1108; MIPS64R2-EL-NEXT:    .reloc .Ltmp0, R_MIPS_JALR, extern_func
1109; MIPS64R2-EL-NEXT:  .Ltmp0:
1110; MIPS64R2-EL-NEXT:    jalr $25
1111; MIPS64R2-EL-NEXT:    or $4, $2, $1
1112; MIPS64R2-EL-NEXT:    ld $gp, 0($sp) # 8-byte Folded Reload
1113; MIPS64R2-EL-NEXT:    ld $ra, 8($sp) # 8-byte Folded Reload
1114; MIPS64R2-EL-NEXT:    jr $ra
1115; MIPS64R2-EL-NEXT:    daddiu $sp, $sp, 16
1116;
1117; MIPS64R2-EB-LABEL: pass_array_byval:
1118; MIPS64R2-EB:       # %bb.0: # %entry
1119; MIPS64R2-EB-NEXT:    daddiu $sp, $sp, -16
1120; MIPS64R2-EB-NEXT:    sd $ra, 8($sp) # 8-byte Folded Spill
1121; MIPS64R2-EB-NEXT:    sd $gp, 0($sp) # 8-byte Folded Spill
1122; MIPS64R2-EB-NEXT:    lui $1, %hi(%neg(%gp_rel(pass_array_byval)))
1123; MIPS64R2-EB-NEXT:    daddu $1, $1, $25
1124; MIPS64R2-EB-NEXT:    daddiu $gp, $1, %lo(%neg(%gp_rel(pass_array_byval)))
1125; MIPS64R2-EB-NEXT:    ld $1, %got_disp(arr)($gp)
1126; MIPS64R2-EB-NEXT:    lbu $2, 5($1)
1127; MIPS64R2-EB-NEXT:    dsll $2, $2, 16
1128; MIPS64R2-EB-NEXT:    lbu $3, 4($1)
1129; MIPS64R2-EB-NEXT:    dsll $3, $3, 24
1130; MIPS64R2-EB-NEXT:    or $2, $3, $2
1131; MIPS64R2-EB-NEXT:    lwl $3, 0($1)
1132; MIPS64R2-EB-NEXT:    lwr $3, 3($1)
1133; MIPS64R2-EB-NEXT:    dext $3, $3, 0, 32
1134; MIPS64R2-EB-NEXT:    dsll $3, $3, 32
1135; MIPS64R2-EB-NEXT:    or $2, $3, $2
1136; MIPS64R2-EB-NEXT:    lbu $1, 6($1)
1137; MIPS64R2-EB-NEXT:    dsll $1, $1, 8
1138; MIPS64R2-EB-NEXT:    ld $25, %call16(extern_func)($gp)
1139; MIPS64R2-EB-NEXT:    .reloc .Ltmp0, R_MIPS_JALR, extern_func
1140; MIPS64R2-EB-NEXT:  .Ltmp0:
1141; MIPS64R2-EB-NEXT:    jalr $25
1142; MIPS64R2-EB-NEXT:    or $4, $2, $1
1143; MIPS64R2-EB-NEXT:    ld $gp, 0($sp) # 8-byte Folded Reload
1144; MIPS64R2-EB-NEXT:    ld $ra, 8($sp) # 8-byte Folded Reload
1145; MIPS64R2-EB-NEXT:    jr $ra
1146; MIPS64R2-EB-NEXT:    daddiu $sp, $sp, 16
1147entry:
1148  tail call void @extern_func(ptr byval([7 x i8]) @arr) nounwind
1149  ret void
1150}
1151
1152declare void @extern_func(ptr byval([7 x i8]))
1153