[TTI] getTypeBasedIntrinsicInstrCost - add basic handling for strided load/store...
[llvm-project.git] / llvm / test / CodeGen / AArch64 / bf16-convert-intrinsics.ll
blob64bc95f2f38906d4a69520c1346d931e8904a9d5
1 ; RUN: llc < %s -verify-machineinstrs -mtriple=aarch64 -mattr=+neon -mattr=+bf16 | FileCheck %s
3 ; This test acts to test the old neon.bfcvt intrinsics, which are now
4 ; autoupgraded to fptrunc operations.
6 declare bfloat @llvm.aarch64.neon.bfcvt(float)
7 declare <8 x bfloat> @llvm.aarch64.neon.bfcvtn(<4 x float>)
8 declare <8 x bfloat> @llvm.aarch64.neon.bfcvtn2(<8 x bfloat>, <4 x float>)
10 ; CHECK-LABEL: test_vcvth_bf16_f32
11 ; CHECK:      bfcvt h0, s0
12 ; CHECK-NEXT: ret
13 define bfloat @test_vcvth_bf16_f32(float %a) {
14 entry:
15   %vcvth_bf16_f32 = call bfloat @llvm.aarch64.neon.bfcvt(float %a)
16   ret bfloat %vcvth_bf16_f32
19 ; CHECK-LABEL: test_vcvtq_low_bf16_f32
20 ; CHECK:      bfcvtn v0.4h, v0.4s
21 ; CHECK-NEXT: ret
22 define <8 x bfloat> @test_vcvtq_low_bf16_f32(<4 x float> %a) {
23 entry:
24   %cvt = call <8 x bfloat> @llvm.aarch64.neon.bfcvtn(<4 x float> %a)
25   ret <8 x bfloat> %cvt
28 ; CHECK-LABEL: test_vcvtq_high_bf16_f32
29 ; CHECK:      bfcvtn2 v1.8h, v0.4s
30 ; CHECK-NEXT: mov v0.16b, v1.16b
31 ; CHECK-NEXT: ret
32 define <8 x bfloat> @test_vcvtq_high_bf16_f32(<4 x float> %a, <8 x bfloat> %inactive) {
33 entry:
34   %cvt = call <8 x bfloat> @llvm.aarch64.neon.bfcvtn2(<8 x bfloat> %inactive, <4 x float> %a)
35   ret <8 x bfloat> %cvt