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
13 define bfloat @test_vcvth_bf16_f32(float %a) {
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
22 define <8 x bfloat> @test_vcvtq_low_bf16_f32(<4 x float> %a) {
24 %cvt = call <8 x bfloat> @llvm.aarch64.neon.bfcvtn(<4 x float> %a)
28 ; CHECK-LABEL: test_vcvtq_high_bf16_f32
29 ; CHECK: bfcvtn2 v1.8h, v0.4s
30 ; CHECK-NEXT: mov v0.16b, v1.16b
32 define <8 x bfloat> @test_vcvtq_high_bf16_f32(<4 x float> %a, <8 x bfloat> %inactive) {
34 %cvt = call <8 x bfloat> @llvm.aarch64.neon.bfcvtn2(<8 x bfloat> %inactive, <4 x float> %a)