1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=aarch64 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
3 # Verify that we get FCMPSri when we compare against 0.0 and that we get
12 tracksRegLiveness: true
17 ; CHECK-LABEL: name: zero
18 ; CHECK: liveins: $s0, $s1
19 ; CHECK: [[COPY:%[0-9]+]]:fpr32 = COPY $s0
20 ; CHECK: nofpexcept FCMPSri [[COPY]], implicit-def $nzcv
21 ; CHECK: [[CSINCWr:%[0-9]+]]:gpr32 = CSINCWr $wzr, $wzr, 1, implicit $nzcv
22 ; CHECK: $s0 = COPY [[CSINCWr]]
23 ; CHECK: RET_ReallyLR implicit $s0
24 %0:fpr(s32) = COPY $s0
25 %1:fpr(s32) = COPY $s1
26 %2:fpr(s32) = G_FCONSTANT float 0.000000e+00
27 %3:gpr(s32) = G_FCMP floatpred(oeq), %0(s32), %2
29 RET_ReallyLR implicit $s0
37 tracksRegLiveness: true
38 machineFunctionInfo: {}
43 ; CHECK-LABEL: name: notzero
44 ; CHECK: liveins: $s0, $s1
45 ; CHECK: [[COPY:%[0-9]+]]:fpr32 = COPY $s0
46 ; CHECK: [[FMOVSi:%[0-9]+]]:fpr32 = FMOVSi 112
47 ; CHECK: nofpexcept FCMPSrr [[COPY]], [[FMOVSi]], implicit-def $nzcv
48 ; CHECK: [[CSINCWr:%[0-9]+]]:gpr32 = CSINCWr $wzr, $wzr, 1, implicit $nzcv
49 ; CHECK: $s0 = COPY [[CSINCWr]]
50 ; CHECK: RET_ReallyLR implicit $s0
51 %0:fpr(s32) = COPY $s0
52 %1:fpr(s32) = COPY $s1
53 %2:fpr(s32) = G_FCONSTANT float 1.000000e+00
54 %3:gpr(s32) = G_FCMP floatpred(oeq), %0(s32), %2
56 RET_ReallyLR implicit $s0
64 tracksRegLiveness: true
65 machineFunctionInfo: {}
70 ; CHECK-LABEL: name: notzero_s64
71 ; CHECK: liveins: $d0, $d1
72 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
73 ; CHECK: [[FMOVDi:%[0-9]+]]:fpr64 = FMOVDi 112
74 ; CHECK: nofpexcept FCMPDrr [[COPY]], [[FMOVDi]], implicit-def $nzcv
75 ; CHECK: [[CSINCWr:%[0-9]+]]:gpr32 = CSINCWr $wzr, $wzr, 1, implicit $nzcv
76 ; CHECK: $s0 = COPY [[CSINCWr]]
77 ; CHECK: RET_ReallyLR implicit $s0
78 %0:fpr(s64) = COPY $d0
79 %1:fpr(s64) = COPY $d1
80 %2:fpr(s64) = G_FCONSTANT double 1.000000e+00
81 %3:gpr(s32) = G_FCMP floatpred(oeq), %0(s64), %2
83 RET_ReallyLR implicit $s0
92 tracksRegLiveness: true
95 liveins: $d0, $d1, $s0
97 ; CHECK-LABEL: name: zero_s64
98 ; CHECK: liveins: $d0, $d1, $s0
99 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
100 ; CHECK: nofpexcept FCMPDri [[COPY]], implicit-def $nzcv
101 ; CHECK: [[CSINCWr:%[0-9]+]]:gpr32 = CSINCWr $wzr, $wzr, 1, implicit $nzcv
102 ; CHECK: $s0 = COPY [[CSINCWr]]
103 ; CHECK: RET_ReallyLR implicit $s0
104 %0:fpr(s64) = COPY $d0
105 %1:fpr(s64) = COPY $d1
106 %2:fpr(s64) = G_FCONSTANT double 0.000000e+00
107 %3:gpr(s32) = G_FCMP floatpred(oeq), %0(s64), %2
109 RET_ReallyLR implicit $s0
116 regBankSelected: true
117 tracksRegLiveness: true
122 ; CHECK-LABEL: name: zero_lhs
123 ; CHECK: liveins: $s0, $s1
124 ; CHECK: [[COPY:%[0-9]+]]:fpr32 = COPY $s0
125 ; CHECK: nofpexcept FCMPSri [[COPY]], implicit-def $nzcv
126 ; CHECK: [[CSINCWr:%[0-9]+]]:gpr32 = CSINCWr $wzr, $wzr, 1, implicit $nzcv
127 ; CHECK: $s0 = COPY [[CSINCWr]]
128 ; CHECK: RET_ReallyLR implicit $s0
129 %0:fpr(s32) = COPY $s0
130 %1:fpr(s32) = COPY $s1
131 %2:fpr(s32) = G_FCONSTANT float 0.000000e+00
132 %3:gpr(s32) = G_FCMP floatpred(oeq), %2(s32), %0
134 RET_ReallyLR implicit $s0
138 name: zero_lhs_not_commutative_pred
141 regBankSelected: true
142 tracksRegLiveness: true
147 ; CHECK-LABEL: name: zero_lhs_not_commutative_pred
148 ; CHECK: liveins: $s0, $s1
149 ; CHECK: [[COPY:%[0-9]+]]:fpr32 = COPY $s0
150 ; CHECK: [[FMOVS0_:%[0-9]+]]:fpr32 = FMOVS0
151 ; CHECK: nofpexcept FCMPSrr [[FMOVS0_]], [[COPY]], implicit-def $nzcv
152 ; CHECK: [[CSINCWr:%[0-9]+]]:gpr32 = CSINCWr $wzr, $wzr, 5, implicit $nzcv
153 ; CHECK: $s0 = COPY [[CSINCWr]]
154 ; CHECK: RET_ReallyLR implicit $s0
155 %0:fpr(s32) = COPY $s0
156 %1:fpr(s32) = COPY $s1
157 %2:fpr(s32) = G_FCONSTANT float 0.000000e+00
158 %3:gpr(s32) = G_FCMP floatpred(olt), %2(s32), %0
160 RET_ReallyLR implicit $s0