1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple aarch64 -mattr=+fullfp16 -run-pass=aarch64-prelegalizer-combiner -global-isel -verify-machineinstrs %s -o - | FileCheck %s
9 ; CHECK-LABEL: name: test_s16
12 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
13 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s16) = G_FCONSTANT half 0xH0000
14 ; CHECK-NEXT: [[FMAXIMUM:%[0-9]+]]:_(s16) = G_FMAXIMUM [[C]], [[COPY]]
15 ; CHECK-NEXT: $h0 = COPY [[FMAXIMUM]](s16)
16 ; CHECK-NEXT: RET_ReallyLR implicit $h0
18 %1:_(s16) = G_FCONSTANT half 0xH0000
19 %2:_(s1) = G_FCMP floatpred(olt), %0(s16), %1
20 %3:_(s16) = G_SELECT %2(s1), %1, %0
22 RET_ReallyLR implicit $h0
31 ; CHECK-LABEL: name: test_s32
34 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
35 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 0.000000e+00
36 ; CHECK-NEXT: [[FMAXIMUM:%[0-9]+]]:_(s32) = G_FMAXIMUM [[C]], [[COPY]]
37 ; CHECK-NEXT: $s0 = COPY [[FMAXIMUM]](s32)
38 ; CHECK-NEXT: RET_ReallyLR implicit $s0
40 %1:_(s32) = G_FCONSTANT float 0.000000e+00
41 %2:_(s1) = G_FCMP floatpred(olt), %0(s32), %1
42 %3:_(s32) = G_SELECT %2(s1), %1, %0
44 RET_ReallyLR implicit $s0
53 ; CHECK-LABEL: name: test_s64
56 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $d0
57 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_FCONSTANT double 0.000000e+00
58 ; CHECK-NEXT: [[FMAXIMUM:%[0-9]+]]:_(s64) = G_FMAXIMUM [[C]], [[COPY]]
59 ; CHECK-NEXT: $d0 = COPY [[FMAXIMUM]](s64)
60 ; CHECK-NEXT: RET_ReallyLR implicit $d0
62 %1:_(s64) = G_FCONSTANT double 0.000000e+00
63 %2:_(s1) = G_FCMP floatpred(olt), %0(s64), %1
64 %3:_(s64) = G_SELECT %2(s1), %1, %0
66 RET_ReallyLR implicit $d0
75 ; CHECK-LABEL: name: test_s64_fmin
78 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $d0
79 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_FCONSTANT double 0.000000e+00
80 ; CHECK-NEXT: [[FMINIMUM:%[0-9]+]]:_(s64) = G_FMINIMUM [[C]], [[COPY]]
81 ; CHECK-NEXT: $d0 = COPY [[FMINIMUM]](s64)
82 ; CHECK-NEXT: RET_ReallyLR implicit $d0
84 %1:_(s64) = G_FCONSTANT double 0.000000e+00
85 %2:_(s1) = G_FCMP floatpred(ogt), %0(s64), %1
86 %3:_(s64) = G_SELECT %2(s1), %1, %0
88 RET_ReallyLR implicit $d0
97 ; CHECK-LABEL: name: test_v8s16
100 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
101 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s16) = G_FCONSTANT half 0xH0000
102 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<8 x s16>) = G_BUILD_VECTOR [[C]](s16), [[C]](s16), [[C]](s16), [[C]](s16), [[C]](s16), [[C]](s16), [[C]](s16), [[C]](s16)
103 ; CHECK-NEXT: [[FMAXIMUM:%[0-9]+]]:_(<8 x s16>) = G_FMAXIMUM [[BUILD_VECTOR]], [[COPY]]
104 ; CHECK-NEXT: $q0 = COPY [[FMAXIMUM]](<8 x s16>)
105 ; CHECK-NEXT: RET_ReallyLR implicit $q0
106 %0:_(<8 x s16>) = COPY $q0
107 %2:_(s16) = G_FCONSTANT half 0xH0000
108 %1:_(<8 x s16>) = G_BUILD_VECTOR %2(s16), %2(s16), %2(s16), %2(s16), %2(s16), %2(s16), %2(s16), %2(s16)
109 %3:_(<8 x s1>) = G_FCMP floatpred(olt), %0(<8 x s16>), %1
110 %4:_(<8 x s16>) = G_SELECT %3(<8 x s1>), %1, %0
111 $q0 = COPY %4(<8 x s16>)
112 RET_ReallyLR implicit $q0
121 ; CHECK-LABEL: name: test_v4s32
122 ; CHECK: liveins: $q0
124 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
125 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<4 x s32>) = G_BITCAST [[COPY]](<2 x s64>)
126 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 0.000000e+00
127 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32)
128 ; CHECK-NEXT: [[FMAXIMUM:%[0-9]+]]:_(<4 x s32>) = G_FMAXIMUM [[BUILD_VECTOR]], [[BITCAST]]
129 ; CHECK-NEXT: $q0 = COPY [[FMAXIMUM]](<4 x s32>)
130 ; CHECK-NEXT: RET_ReallyLR implicit $q0
131 %1:_(<2 x s64>) = COPY $q0
132 %0:_(<4 x s32>) = G_BITCAST %1(<2 x s64>)
133 %3:_(s32) = G_FCONSTANT float 0.000000e+00
134 %2:_(<4 x s32>) = G_BUILD_VECTOR %3(s32), %3(s32), %3(s32), %3(s32)
135 %4:_(<4 x s1>) = G_FCMP floatpred(olt), %0(<4 x s32>), %2
136 %5:_(<4 x s32>) = G_SELECT %4(<4 x s1>), %2, %0
137 $q0 = COPY %5(<4 x s32>)
138 RET_ReallyLR implicit $q0
147 ; CHECK-LABEL: name: test_v2s64
148 ; CHECK: liveins: $q0
150 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
151 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_FCONSTANT double 0.000000e+00
152 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[C]](s64), [[C]](s64)
153 ; CHECK-NEXT: [[FMAXIMUM:%[0-9]+]]:_(<2 x s64>) = G_FMAXIMUM [[BUILD_VECTOR]], [[COPY]]
154 ; CHECK-NEXT: $q0 = COPY [[FMAXIMUM]](<2 x s64>)
155 ; CHECK-NEXT: RET_ReallyLR implicit $q0
156 %0:_(<2 x s64>) = COPY $q0
157 %2:_(s64) = G_FCONSTANT double 0.000000e+00
158 %1:_(<2 x s64>) = G_BUILD_VECTOR %2(s64), %2(s64)
159 %3:_(<2 x s1>) = G_FCMP floatpred(olt), %0(<2 x s64>), %1
160 %4:_(<2 x s64>) = G_SELECT %3(<2 x s1>), %1, %0
161 $q0 = COPY %4(<2 x s64>)
162 RET_ReallyLR implicit $q0
166 name: test_v2s64_fmin
171 ; CHECK-LABEL: name: test_v2s64_fmin
172 ; CHECK: liveins: $q0
174 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
175 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_FCONSTANT double 0.000000e+00
176 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[C]](s64), [[C]](s64)
177 ; CHECK-NEXT: [[FMINIMUM:%[0-9]+]]:_(<2 x s64>) = G_FMINIMUM [[BUILD_VECTOR]], [[COPY]]
178 ; CHECK-NEXT: $q0 = COPY [[FMINIMUM]](<2 x s64>)
179 ; CHECK-NEXT: RET_ReallyLR implicit $q0
180 %0:_(<2 x s64>) = COPY $q0
181 %2:_(s64) = G_FCONSTANT double 0.000000e+00
182 %1:_(<2 x s64>) = G_BUILD_VECTOR %2(s64), %2(s64)
183 %3:_(<2 x s1>) = G_FCMP floatpred(ogt), %0(<2 x s64>), %1
184 %4:_(<2 x s64>) = G_SELECT %3(<2 x s1>), %1, %0
185 $q0 = COPY %4(<2 x s64>)
186 RET_ReallyLR implicit $q0