1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 3
2 # RUN: llc -mtriple=riscv64 -mattr=+d -run-pass=instruction-select -verify-machineinstrs %s -o - | \
13 ; CHECK-LABEL: name: is_fpclass_f32
14 ; CHECK: liveins: $f10_f
16 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr32 = COPY $f10_f
17 ; CHECK-NEXT: [[FCLASS_S:%[0-9]+]]:gpr = FCLASS_S [[COPY]]
18 ; CHECK-NEXT: [[ANDI:%[0-9]+]]:gpr = ANDI [[FCLASS_S]], 152
19 ; CHECK-NEXT: [[SLTU:%[0-9]+]]:gpr = SLTU $x0, [[ANDI]]
20 ; CHECK-NEXT: $x10 = COPY [[SLTU]]
21 ; CHECK-NEXT: PseudoRET implicit $x10
22 %0:fprb(s32) = COPY $f10_f
23 %3:gprb(s64) = G_CONSTANT i64 152
24 %4:gprb(s64) = G_CONSTANT i64 0
25 %5:gprb(s64) = G_FCLASS %0(s32)
26 %6:gprb(s64) = G_AND %5, %3
27 %7:gprb(s64) = G_ICMP intpred(ne), %6(s64), %4
29 PseudoRET implicit $x10
32 name: is_fpclass_f32_onehot
39 ; CHECK-LABEL: name: is_fpclass_f32_onehot
40 ; CHECK: liveins: $f10_f
42 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr32 = COPY $f10_f
43 ; CHECK-NEXT: [[FCLASS_S:%[0-9]+]]:gpr = FCLASS_S [[COPY]]
44 ; CHECK-NEXT: [[ANDI:%[0-9]+]]:gpr = ANDI [[FCLASS_S]], 256
45 ; CHECK-NEXT: [[SLTU:%[0-9]+]]:gpr = SLTU $x0, [[ANDI]]
46 ; CHECK-NEXT: $x10 = COPY [[SLTU]]
47 ; CHECK-NEXT: PseudoRET implicit $x10
48 %0:fprb(s32) = COPY $f10_f
49 %3:gprb(s64) = G_CONSTANT i64 256
50 %4:gprb(s64) = G_CONSTANT i64 0
51 %5:gprb(s64) = G_FCLASS %0(s32)
52 %6:gprb(s64) = G_AND %5, %3
53 %7:gprb(s64) = G_ICMP intpred(ne), %6(s64), %4
55 PseudoRET implicit $x10
58 name: is_fpclass_f32_one
65 ; CHECK-LABEL: name: is_fpclass_f32_one
66 ; CHECK: liveins: $f10_f
68 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr32 = COPY $f10_f
69 ; CHECK-NEXT: [[FCLASS_S:%[0-9]+]]:gpr = FCLASS_S [[COPY]]
70 ; CHECK-NEXT: [[ANDI:%[0-9]+]]:gpr = ANDI [[FCLASS_S]], 1
71 ; CHECK-NEXT: [[SLTU:%[0-9]+]]:gpr = SLTU $x0, [[ANDI]]
72 ; CHECK-NEXT: $x10 = COPY [[SLTU]]
73 ; CHECK-NEXT: PseudoRET implicit $x10
74 %0:fprb(s32) = COPY $f10_f
75 %3:gprb(s64) = G_CONSTANT i64 1
76 %4:gprb(s64) = G_CONSTANT i64 0
77 %5:gprb(s64) = G_FCLASS %0(s32)
78 %6:gprb(s64) = G_AND %5, %3
79 %7:gprb(s64) = G_ICMP intpred(ne), %6(s64), %4
81 PseudoRET implicit $x10
91 ; CHECK-LABEL: name: is_fpclass_f64
92 ; CHECK: liveins: $f10_d
94 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr64 = COPY $f10_d
95 ; CHECK-NEXT: [[FCLASS_D:%[0-9]+]]:gpr = FCLASS_D [[COPY]]
96 ; CHECK-NEXT: [[ANDI:%[0-9]+]]:gpr = ANDI [[FCLASS_D]], 152
97 ; CHECK-NEXT: [[SLTU:%[0-9]+]]:gpr = SLTU $x0, [[ANDI]]
98 ; CHECK-NEXT: $x10 = COPY [[SLTU]]
99 ; CHECK-NEXT: PseudoRET implicit $x10
100 %0:fprb(s64) = COPY $f10_d
101 %3:gprb(s64) = G_CONSTANT i64 152
102 %4:gprb(s64) = G_CONSTANT i64 0
103 %5:gprb(s64) = G_FCLASS %0(s64)
104 %6:gprb(s64) = G_AND %5, %3
105 %7:gprb(s64) = G_ICMP intpred(ne), %6(s64), %4
107 PseudoRET implicit $x10
110 name: is_fpclass_f64_onehot
112 regBankSelected: true
117 ; CHECK-LABEL: name: is_fpclass_f64_onehot
118 ; CHECK: liveins: $f10_d
120 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr64 = COPY $f10_d
121 ; CHECK-NEXT: [[FCLASS_D:%[0-9]+]]:gpr = FCLASS_D [[COPY]]
122 ; CHECK-NEXT: [[ANDI:%[0-9]+]]:gpr = ANDI [[FCLASS_D]], 256
123 ; CHECK-NEXT: [[SLTU:%[0-9]+]]:gpr = SLTU $x0, [[ANDI]]
124 ; CHECK-NEXT: $x10 = COPY [[SLTU]]
125 ; CHECK-NEXT: PseudoRET implicit $x10
126 %0:fprb(s64) = COPY $f10_d
127 %3:gprb(s64) = G_CONSTANT i64 256
128 %4:gprb(s64) = G_CONSTANT i64 0
129 %5:gprb(s64) = G_FCLASS %0(s64)
130 %6:gprb(s64) = G_AND %5, %3
131 %7:gprb(s64) = G_ICMP intpred(ne), %6(s64), %4
133 PseudoRET implicit $x10
136 name: is_fpclass_f64_one
138 regBankSelected: true
143 ; CHECK-LABEL: name: is_fpclass_f64_one
144 ; CHECK: liveins: $f10_d
146 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr64 = COPY $f10_d
147 ; CHECK-NEXT: [[FCLASS_D:%[0-9]+]]:gpr = FCLASS_D [[COPY]]
148 ; CHECK-NEXT: [[ANDI:%[0-9]+]]:gpr = ANDI [[FCLASS_D]], 1
149 ; CHECK-NEXT: [[SLTU:%[0-9]+]]:gpr = SLTU $x0, [[ANDI]]
150 ; CHECK-NEXT: $x10 = COPY [[SLTU]]
151 ; CHECK-NEXT: PseudoRET implicit $x10
152 %0:fprb(s64) = COPY $f10_d
153 %3:gprb(s64) = G_CONSTANT i64 1
154 %4:gprb(s64) = G_CONSTANT i64 0
155 %5:gprb(s64) = G_FCLASS %0(s64)
156 %6:gprb(s64) = G_AND %5, %3
157 %7:gprb(s64) = G_ICMP intpred(ne), %6(s64), %4
159 PseudoRET implicit $x10