1
1
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2
- # RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=MIPS32
2
+ # RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=MIPS32FP32
3
+ # RUN: llc -O0 -mtriple=mipsel-linux-gnu -mattr=+fp64,+mips32r2 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=MIPS32FP64
3
4
--- |
4
5
5
6
define void @select_i32() {entry : ret void}
6
7
define void @select_ptr() {entry : ret void}
8
+ define void @select_float() {entry : ret void}
9
+ define void @select_double() {entry : ret void}
7
10
8
11
...
9
12
---
@@ -16,16 +19,26 @@ body: |
16
19
bb.1.entry:
17
20
liveins: $a0, $a1, $a2
18
21
19
- ; MIPS32-LABEL: name: select_i32
20
- ; MIPS32: liveins: $a0, $a1, $a2
21
- ; MIPS32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
22
- ; MIPS32: [[COPY1:%[0-9]+]]:gpr32 = COPY $a1
23
- ; MIPS32: [[COPY2:%[0-9]+]]:gpr32 = COPY $a2
24
- ; MIPS32: [[ORi:%[0-9]+]]:gpr32 = ORi $zero, 1
25
- ; MIPS32: [[AND:%[0-9]+]]:gpr32 = AND [[COPY]], [[ORi]]
26
- ; MIPS32: [[MOVN_I_I:%[0-9]+]]:gpr32 = MOVN_I_I [[COPY1]], [[AND]], [[COPY2]]
27
- ; MIPS32: $v0 = COPY [[MOVN_I_I]]
28
- ; MIPS32: RetRA implicit $v0
22
+ ; MIPS32FP32-LABEL: name: select_i32
23
+ ; MIPS32FP32: liveins: $a0, $a1, $a2
24
+ ; MIPS32FP32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
25
+ ; MIPS32FP32: [[COPY1:%[0-9]+]]:gpr32 = COPY $a1
26
+ ; MIPS32FP32: [[COPY2:%[0-9]+]]:gpr32 = COPY $a2
27
+ ; MIPS32FP32: [[ORi:%[0-9]+]]:gpr32 = ORi $zero, 1
28
+ ; MIPS32FP32: [[AND:%[0-9]+]]:gpr32 = AND [[COPY]], [[ORi]]
29
+ ; MIPS32FP32: [[MOVN_I_I:%[0-9]+]]:gpr32 = MOVN_I_I [[COPY1]], [[AND]], [[COPY2]]
30
+ ; MIPS32FP32: $v0 = COPY [[MOVN_I_I]]
31
+ ; MIPS32FP32: RetRA implicit $v0
32
+ ; MIPS32FP64-LABEL: name: select_i32
33
+ ; MIPS32FP64: liveins: $a0, $a1, $a2
34
+ ; MIPS32FP64: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
35
+ ; MIPS32FP64: [[COPY1:%[0-9]+]]:gpr32 = COPY $a1
36
+ ; MIPS32FP64: [[COPY2:%[0-9]+]]:gpr32 = COPY $a2
37
+ ; MIPS32FP64: [[ORi:%[0-9]+]]:gpr32 = ORi $zero, 1
38
+ ; MIPS32FP64: [[AND:%[0-9]+]]:gpr32 = AND [[COPY]], [[ORi]]
39
+ ; MIPS32FP64: [[MOVN_I_I:%[0-9]+]]:gpr32 = MOVN_I_I [[COPY1]], [[AND]], [[COPY2]]
40
+ ; MIPS32FP64: $v0 = COPY [[MOVN_I_I]]
41
+ ; MIPS32FP64: RetRA implicit $v0
29
42
%3:gprb(s32) = COPY $a0
30
43
%1:gprb(s32) = COPY $a1
31
44
%2:gprb(s32) = COPY $a2
@@ -47,16 +60,26 @@ body: |
47
60
bb.1.entry:
48
61
liveins: $a0, $a1, $a2
49
62
50
- ; MIPS32-LABEL: name: select_ptr
51
- ; MIPS32: liveins: $a0, $a1, $a2
52
- ; MIPS32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
53
- ; MIPS32: [[COPY1:%[0-9]+]]:gpr32 = COPY $a1
54
- ; MIPS32: [[COPY2:%[0-9]+]]:gpr32 = COPY $a2
55
- ; MIPS32: [[ORi:%[0-9]+]]:gpr32 = ORi $zero, 1
56
- ; MIPS32: [[AND:%[0-9]+]]:gpr32 = AND [[COPY]], [[ORi]]
57
- ; MIPS32: [[MOVN_I_I:%[0-9]+]]:gpr32 = MOVN_I_I [[COPY1]], [[AND]], [[COPY2]]
58
- ; MIPS32: $v0 = COPY [[MOVN_I_I]]
59
- ; MIPS32: RetRA implicit $v0
63
+ ; MIPS32FP32-LABEL: name: select_ptr
64
+ ; MIPS32FP32: liveins: $a0, $a1, $a2
65
+ ; MIPS32FP32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
66
+ ; MIPS32FP32: [[COPY1:%[0-9]+]]:gpr32 = COPY $a1
67
+ ; MIPS32FP32: [[COPY2:%[0-9]+]]:gpr32 = COPY $a2
68
+ ; MIPS32FP32: [[ORi:%[0-9]+]]:gpr32 = ORi $zero, 1
69
+ ; MIPS32FP32: [[AND:%[0-9]+]]:gpr32 = AND [[COPY]], [[ORi]]
70
+ ; MIPS32FP32: [[MOVN_I_I:%[0-9]+]]:gpr32 = MOVN_I_I [[COPY1]], [[AND]], [[COPY2]]
71
+ ; MIPS32FP32: $v0 = COPY [[MOVN_I_I]]
72
+ ; MIPS32FP32: RetRA implicit $v0
73
+ ; MIPS32FP64-LABEL: name: select_ptr
74
+ ; MIPS32FP64: liveins: $a0, $a1, $a2
75
+ ; MIPS32FP64: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
76
+ ; MIPS32FP64: [[COPY1:%[0-9]+]]:gpr32 = COPY $a1
77
+ ; MIPS32FP64: [[COPY2:%[0-9]+]]:gpr32 = COPY $a2
78
+ ; MIPS32FP64: [[ORi:%[0-9]+]]:gpr32 = ORi $zero, 1
79
+ ; MIPS32FP64: [[AND:%[0-9]+]]:gpr32 = AND [[COPY]], [[ORi]]
80
+ ; MIPS32FP64: [[MOVN_I_I:%[0-9]+]]:gpr32 = MOVN_I_I [[COPY1]], [[AND]], [[COPY2]]
81
+ ; MIPS32FP64: $v0 = COPY [[MOVN_I_I]]
82
+ ; MIPS32FP64: RetRA implicit $v0
60
83
%3:gprb(s32) = COPY $a0
61
84
%1:gprb(p0) = COPY $a1
62
85
%2:gprb(p0) = COPY $a2
@@ -68,3 +91,90 @@ body: |
68
91
RetRA implicit $v0
69
92
70
93
...
94
+ ---
95
+ name : select_float
96
+ alignment : 2
97
+ legalized : true
98
+ regBankSelected : true
99
+ tracksRegLiveness : true
100
+ body : |
101
+ bb.1.entry:
102
+ liveins: $a0, $a1, $a2
103
+
104
+ ; MIPS32FP32-LABEL: name: select_float
105
+ ; MIPS32FP32: liveins: $a0, $a1, $a2
106
+ ; MIPS32FP32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
107
+ ; MIPS32FP32: [[MTC1_:%[0-9]+]]:fgr32 = MTC1 $a1
108
+ ; MIPS32FP32: [[MTC1_1:%[0-9]+]]:fgr32 = MTC1 $a2
109
+ ; MIPS32FP32: [[ORi:%[0-9]+]]:gpr32 = ORi $zero, 1
110
+ ; MIPS32FP32: [[AND:%[0-9]+]]:gpr32 = AND [[COPY]], [[ORi]]
111
+ ; MIPS32FP32: [[MOVN_I_S:%[0-9]+]]:fgr32 = MOVN_I_S [[MTC1_]], [[AND]], [[MTC1_1]]
112
+ ; MIPS32FP32: $f0 = COPY [[MOVN_I_S]]
113
+ ; MIPS32FP32: RetRA implicit $f0
114
+ ; MIPS32FP64-LABEL: name: select_float
115
+ ; MIPS32FP64: liveins: $a0, $a1, $a2
116
+ ; MIPS32FP64: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
117
+ ; MIPS32FP64: [[MTC1_:%[0-9]+]]:fgr32 = MTC1 $a1
118
+ ; MIPS32FP64: [[MTC1_1:%[0-9]+]]:fgr32 = MTC1 $a2
119
+ ; MIPS32FP64: [[ORi:%[0-9]+]]:gpr32 = ORi $zero, 1
120
+ ; MIPS32FP64: [[AND:%[0-9]+]]:gpr32 = AND [[COPY]], [[ORi]]
121
+ ; MIPS32FP64: [[MOVN_I_S:%[0-9]+]]:fgr32 = MOVN_I_S [[MTC1_]], [[AND]], [[MTC1_1]]
122
+ ; MIPS32FP64: $f0 = COPY [[MOVN_I_S]]
123
+ ; MIPS32FP64: RetRA implicit $f0
124
+ %3:gprb(s32) = COPY $a0
125
+ %1:fgr32(s32) = MTC1 $a1
126
+ %2:fgr32(s32) = MTC1 $a2
127
+ %6:gprb(s32) = G_CONSTANT i32 1
128
+ %7:gprb(s32) = COPY %3(s32)
129
+ %5:gprb(s32) = G_AND %7, %6
130
+ %4:fprb(s32) = G_SELECT %5(s32), %1, %2
131
+ $f0 = COPY %4(s32)
132
+ RetRA implicit $f0
133
+
134
+ ...
135
+ ---
136
+ name : select_double
137
+ alignment : 2
138
+ legalized : true
139
+ regBankSelected : true
140
+ tracksRegLiveness : true
141
+ fixedStack :
142
+ - { id: 0, offset: 16, size: 4, alignment: 8, isImmutable: true }
143
+ body : |
144
+ bb.1.entry:
145
+ liveins: $d6, $d7
146
+
147
+ ; MIPS32FP32-LABEL: name: select_double
148
+ ; MIPS32FP32: liveins: $d6, $d7
149
+ ; MIPS32FP32: [[COPY:%[0-9]+]]:afgr64 = COPY $d6
150
+ ; MIPS32FP32: [[COPY1:%[0-9]+]]:afgr64 = COPY $d7
151
+ ; MIPS32FP32: [[ADDiu:%[0-9]+]]:gpr32 = ADDiu %fixed-stack.0, 0
152
+ ; MIPS32FP32: [[LW:%[0-9]+]]:gpr32 = LW [[ADDiu]], 0 :: (load 4 from %fixed-stack.0, align 8)
153
+ ; MIPS32FP32: [[ORi:%[0-9]+]]:gpr32 = ORi $zero, 1
154
+ ; MIPS32FP32: [[AND:%[0-9]+]]:gpr32 = AND [[LW]], [[ORi]]
155
+ ; MIPS32FP32: [[MOVN_I_D32_:%[0-9]+]]:afgr64 = MOVN_I_D32 [[COPY]], [[AND]], [[COPY1]]
156
+ ; MIPS32FP32: $d0 = COPY [[MOVN_I_D32_]]
157
+ ; MIPS32FP32: RetRA implicit $d0
158
+ ; MIPS32FP64-LABEL: name: select_double
159
+ ; MIPS32FP64: liveins: $d6, $d7
160
+ ; MIPS32FP64: [[COPY:%[0-9]+]]:fgr64 = COPY $d6
161
+ ; MIPS32FP64: [[COPY1:%[0-9]+]]:fgr64 = COPY $d7
162
+ ; MIPS32FP64: [[ADDiu:%[0-9]+]]:gpr32 = ADDiu %fixed-stack.0, 0
163
+ ; MIPS32FP64: [[LW:%[0-9]+]]:gpr32 = LW [[ADDiu]], 0 :: (load 4 from %fixed-stack.0, align 8)
164
+ ; MIPS32FP64: [[ORi:%[0-9]+]]:gpr32 = ORi $zero, 1
165
+ ; MIPS32FP64: [[AND:%[0-9]+]]:gpr32 = AND [[LW]], [[ORi]]
166
+ ; MIPS32FP64: [[MOVN_I_D64_:%[0-9]+]]:fgr64 = MOVN_I_D64 [[COPY]], [[AND]], [[COPY1]]
167
+ ; MIPS32FP64: $d0 = COPY [[MOVN_I_D64_]]
168
+ ; MIPS32FP64: RetRA implicit $d0
169
+ %0:fprb(s64) = COPY $d6
170
+ %1:fprb(s64) = COPY $d7
171
+ %4:gprb(p0) = G_FRAME_INDEX %fixed-stack.0
172
+ %3:gprb(s32) = G_LOAD %4(p0) :: (load 4 from %fixed-stack.0, align 8)
173
+ %7:gprb(s32) = G_CONSTANT i32 1
174
+ %8:gprb(s32) = COPY %3(s32)
175
+ %6:gprb(s32) = G_AND %8, %7
176
+ %5:fprb(s64) = G_SELECT %6(s32), %0, %1
177
+ $d0 = COPY %5(s64)
178
+ RetRA implicit $d0
179
+
180
+ ...
0 commit comments