|
99 | 99 | ret half %13
|
100 | 100 | }
|
101 | 101 |
|
102 |
| -define bfloat @demote_bfloat_test(bfloat %a, bfloat %b) { |
| 102 | +define bfloat @demote_bfloat_test(bfloat %a, bfloat %b) #2 { |
103 | 103 | top:
|
104 | 104 | ; CHECK-LABEL: @demote_bfloat_test(
|
105 | 105 | ; CHECK-NEXT: top:
|
@@ -160,5 +160,70 @@ top:
|
160 | 160 | ret bfloat %13
|
161 | 161 | }
|
162 | 162 |
|
163 |
| -attributes #0 = { "target-features"="-avx512fp16" } |
164 |
| -attributes #1 = { "target-features"="+avx512fp16" } |
| 163 | +define bfloat @native_bfloat_test(bfloat %a, bfloat %b) #3 { |
| 164 | +top: |
| 165 | +; CHECK-LABEL: @native_bfloat_test( |
| 166 | +; CHECK-NEXT: top: |
| 167 | +; CHECK-NEXT: %0 = fadd bfloat %a, %b |
| 168 | +; CHECK-NEXT: %1 = fadd bfloat %0, %b |
| 169 | +; CHECK-NEXT: %2 = fadd bfloat %1, %b |
| 170 | +; CHECK-NEXT: %3 = fmul bfloat %2, %b |
| 171 | +; CHECK-NEXT: %4 = fdiv bfloat %3, %b |
| 172 | +; CHECK-NEXT: %5 = insertelement <2 x bfloat> undef, bfloat %a, i32 0 |
| 173 | +; CHECK-NEXT: %6 = insertelement <2 x bfloat> %5, bfloat %b, i32 1 |
| 174 | +; CHECK-NEXT: %7 = insertelement <2 x bfloat> undef, bfloat %b, i32 0 |
| 175 | +; CHECK-NEXT: %8 = insertelement <2 x bfloat> %7, bfloat %b, i32 1 |
| 176 | +; CHECK-NEXT: %9 = fadd <2 x bfloat> %6, %8 |
| 177 | +; CHECK-NEXT: %10 = extractelement <2 x bfloat> %9, i32 0 |
| 178 | +; CHECK-NEXT: %11 = extractelement <2 x bfloat> %9, i32 1 |
| 179 | +; CHECK-NEXT: %12 = fadd bfloat %10, %11 |
| 180 | +; CHECK-NEXT: %13 = fadd bfloat %12, %4 |
| 181 | +; CHECK-NEXT: ret bfloat %13 |
| 182 | +; |
| 183 | + %0 = fadd bfloat %a, %b |
| 184 | + %1 = fadd bfloat %0, %b |
| 185 | + %2 = fadd bfloat %1, %b |
| 186 | + %3 = fmul bfloat %2, %b |
| 187 | + %4 = fdiv bfloat %3, %b |
| 188 | + %5 = insertelement <2 x bfloat> undef, bfloat %a, i32 0 |
| 189 | + %6 = insertelement <2 x bfloat> %5, bfloat %b, i32 1 |
| 190 | + %7 = insertelement <2 x bfloat> undef, bfloat %b, i32 0 |
| 191 | + %8 = insertelement <2 x bfloat> %7, bfloat %b, i32 1 |
| 192 | + %9 = fadd <2 x bfloat> %6, %8 |
| 193 | + %10 = extractelement <2 x bfloat> %9, i32 0 |
| 194 | + %11 = extractelement <2 x bfloat> %9, i32 1 |
| 195 | + %12 = fadd bfloat %10, %11 |
| 196 | + %13 = fadd bfloat %12, %4 |
| 197 | + ret bfloat %13 |
| 198 | +} |
| 199 | + |
| 200 | +define i1 @fast_half_test(half %0, half %1) #0 { |
| 201 | +top: |
| 202 | +; CHECK-LABEL: @fast_half_test( |
| 203 | +; CHECK-NEXT: top: |
| 204 | +; CHECK-NEXT: %2 = fsub fast half %0, %1 |
| 205 | +; CHECK-NEXT: %3 = fcmp fast oeq half %2, 0xH0000 |
| 206 | +; CHECK-NEXT: ret i1 %3 |
| 207 | +; |
| 208 | + %2 = fsub fast half %0, %1 |
| 209 | + %3 = fcmp fast oeq half %2, 0xH0000 |
| 210 | + ret i1 %3 |
| 211 | +} |
| 212 | + |
| 213 | +define i1 @fast_bfloat_test(bfloat %0, bfloat %1) #2 { |
| 214 | +top: |
| 215 | +; CHECK-LABEL: @fast_bfloat_test( |
| 216 | +; CHECK-NEXT: top: |
| 217 | +; CHECK-NEXT: %2 = fsub fast bfloat %0, %1 |
| 218 | +; CHECK-NEXT: %3 = fcmp fast oeq bfloat %2, 0xR0000 |
| 219 | +; CHECK-NEXT: ret i1 %3 |
| 220 | +; |
| 221 | + %2 = fsub fast bfloat %0, %1 |
| 222 | + %3 = fcmp fast oeq bfloat %2, 0xR0000 |
| 223 | + ret i1 %3 |
| 224 | +} |
| 225 | + |
| 226 | +attributes #0 = { "julia.hasfp16"="false" } |
| 227 | +attributes #1 = { "julia.hasfp16"="true" } |
| 228 | +attributes #2 = { "julia.hasbf16"="false" } |
| 229 | +attributes #3 = { "julia.hasbf16"="true" } |
0 commit comments