1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -O0 -mtriple=mipsel-linux-gnu -global-isel -verify-machineinstrs %s -o -| FileCheck %s -check-prefixes=MIPS32
3 ; RUN: llc -O0 -mtriple=mipsel-linux-gnu -global-isel -mcpu=mips32r6 -verify-machineinstrs %s -o -| FileCheck %s -check-prefixes=MIPS32R6
5 @float_align1 = common global float 0.000000e+00, align 1
6 @float_align2 = common global float 0.000000e+00, align 2
7 @float_align4 = common global float 0.000000e+00, align 4
8 @float_align8 = common global float 0.000000e+00, align 8
9 @i32_align1 = common global i32 0, align 1
10 @i32_align2 = common global i32 0, align 2
11 @i32_align4 = common global i32 0, align 4
12 @i32_align8 = common global i32 0, align 8
14 define void @store_float_align1(float %a) {
15 ; MIPS32-LABEL: store_float_align1:
16 ; MIPS32: # %bb.0: # %entry
17 ; MIPS32-NEXT: lui $1, %hi(float_align1)
18 ; MIPS32-NEXT: addiu $2, $1, %lo(float_align1)
19 ; MIPS32-NEXT: mfc1 $1, $f12
20 ; MIPS32-NEXT: swl $1, 3($2)
21 ; MIPS32-NEXT: swr $1, 0($2)
25 ; MIPS32R6-LABEL: store_float_align1:
26 ; MIPS32R6: # %bb.0: # %entry
27 ; MIPS32R6-NEXT: lui $1, %hi(float_align1)
28 ; MIPS32R6-NEXT: addiu $1, $1, %lo(float_align1)
29 ; MIPS32R6-NEXT: swc1 $f12, 0($1)
30 ; MIPS32R6-NEXT: jrc $ra
32 store float %a, ptr @float_align1, align 1
36 define void @store_float_align2(float %a) {
37 ; MIPS32-LABEL: store_float_align2:
38 ; MIPS32: # %bb.0: # %entry
39 ; MIPS32-NEXT: lui $1, %hi(float_align2)
40 ; MIPS32-NEXT: addiu $2, $1, %lo(float_align2)
41 ; MIPS32-NEXT: mfc1 $1, $f12
42 ; MIPS32-NEXT: swl $1, 3($2)
43 ; MIPS32-NEXT: swr $1, 0($2)
47 ; MIPS32R6-LABEL: store_float_align2:
48 ; MIPS32R6: # %bb.0: # %entry
49 ; MIPS32R6-NEXT: lui $1, %hi(float_align2)
50 ; MIPS32R6-NEXT: addiu $1, $1, %lo(float_align2)
51 ; MIPS32R6-NEXT: swc1 $f12, 0($1)
52 ; MIPS32R6-NEXT: jrc $ra
54 store float %a, ptr @float_align2, align 2
58 define void @store_float_align4(float %a) {
59 ; MIPS32-LABEL: store_float_align4:
60 ; MIPS32: # %bb.0: # %entry
61 ; MIPS32-NEXT: lui $1, %hi(float_align4)
62 ; MIPS32-NEXT: addiu $1, $1, %lo(float_align4)
63 ; MIPS32-NEXT: swc1 $f12, 0($1)
67 ; MIPS32R6-LABEL: store_float_align4:
68 ; MIPS32R6: # %bb.0: # %entry
69 ; MIPS32R6-NEXT: lui $1, %hi(float_align4)
70 ; MIPS32R6-NEXT: addiu $1, $1, %lo(float_align4)
71 ; MIPS32R6-NEXT: swc1 $f12, 0($1)
72 ; MIPS32R6-NEXT: jrc $ra
74 store float %a, ptr @float_align4, align 4
78 define void @store_float_align8(float %a) {
79 ; MIPS32-LABEL: store_float_align8:
80 ; MIPS32: # %bb.0: # %entry
81 ; MIPS32-NEXT: lui $1, %hi(float_align8)
82 ; MIPS32-NEXT: addiu $1, $1, %lo(float_align8)
83 ; MIPS32-NEXT: swc1 $f12, 0($1)
87 ; MIPS32R6-LABEL: store_float_align8:
88 ; MIPS32R6: # %bb.0: # %entry
89 ; MIPS32R6-NEXT: lui $1, %hi(float_align8)
90 ; MIPS32R6-NEXT: addiu $1, $1, %lo(float_align8)
91 ; MIPS32R6-NEXT: swc1 $f12, 0($1)
92 ; MIPS32R6-NEXT: jrc $ra
94 store float %a, ptr @float_align8, align 8
98 define void @store_i32_align1(i32 signext %a) {
99 ; MIPS32-LABEL: store_i32_align1:
100 ; MIPS32: # %bb.0: # %entry
101 ; MIPS32-NEXT: lui $1, %hi(i32_align1)
102 ; MIPS32-NEXT: addiu $1, $1, %lo(i32_align1)
103 ; MIPS32-NEXT: swl $4, 3($1)
104 ; MIPS32-NEXT: swr $4, 0($1)
105 ; MIPS32-NEXT: jr $ra
108 ; MIPS32R6-LABEL: store_i32_align1:
109 ; MIPS32R6: # %bb.0: # %entry
110 ; MIPS32R6-NEXT: lui $1, %hi(i32_align1)
111 ; MIPS32R6-NEXT: addiu $1, $1, %lo(i32_align1)
112 ; MIPS32R6-NEXT: sw $4, 0($1)
113 ; MIPS32R6-NEXT: jrc $ra
115 store i32 %a, ptr @i32_align1, align 1
119 define void @store_i32_align2(i32 signext %a) {
120 ; MIPS32-LABEL: store_i32_align2:
121 ; MIPS32: # %bb.0: # %entry
122 ; MIPS32-NEXT: lui $1, %hi(i32_align2)
123 ; MIPS32-NEXT: addiu $1, $1, %lo(i32_align2)
124 ; MIPS32-NEXT: swl $4, 3($1)
125 ; MIPS32-NEXT: swr $4, 0($1)
126 ; MIPS32-NEXT: jr $ra
129 ; MIPS32R6-LABEL: store_i32_align2:
130 ; MIPS32R6: # %bb.0: # %entry
131 ; MIPS32R6-NEXT: lui $1, %hi(i32_align2)
132 ; MIPS32R6-NEXT: addiu $1, $1, %lo(i32_align2)
133 ; MIPS32R6-NEXT: sw $4, 0($1)
134 ; MIPS32R6-NEXT: jrc $ra
136 store i32 %a, ptr @i32_align2, align 2
140 define void @store_i32_align4(i32 signext %a) {
141 ; MIPS32-LABEL: store_i32_align4:
142 ; MIPS32: # %bb.0: # %entry
143 ; MIPS32-NEXT: lui $1, %hi(i32_align4)
144 ; MIPS32-NEXT: addiu $1, $1, %lo(i32_align4)
145 ; MIPS32-NEXT: sw $4, 0($1)
146 ; MIPS32-NEXT: jr $ra
149 ; MIPS32R6-LABEL: store_i32_align4:
150 ; MIPS32R6: # %bb.0: # %entry
151 ; MIPS32R6-NEXT: lui $1, %hi(i32_align4)
152 ; MIPS32R6-NEXT: addiu $1, $1, %lo(i32_align4)
153 ; MIPS32R6-NEXT: sw $4, 0($1)
154 ; MIPS32R6-NEXT: jrc $ra
156 store i32 %a, ptr @i32_align4, align 4
160 define void @store_i32_align8(i32 signext %a) {
161 ; MIPS32-LABEL: store_i32_align8:
162 ; MIPS32: # %bb.0: # %entry
163 ; MIPS32-NEXT: lui $1, %hi(i32_align8)
164 ; MIPS32-NEXT: addiu $1, $1, %lo(i32_align8)
165 ; MIPS32-NEXT: sw $4, 0($1)
166 ; MIPS32-NEXT: jr $ra
169 ; MIPS32R6-LABEL: store_i32_align8:
170 ; MIPS32R6: # %bb.0: # %entry
171 ; MIPS32R6-NEXT: lui $1, %hi(i32_align8)
172 ; MIPS32R6-NEXT: addiu $1, $1, %lo(i32_align8)
173 ; MIPS32R6-NEXT: sw $4, 0($1)
174 ; MIPS32R6-NEXT: jrc $ra
176 store i32 %a, ptr @i32_align8, align 8