brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 64bc95f Raw
38 lines · plain
1; RUN: llc < %s -verify-machineinstrs -mtriple=aarch64 -mattr=+neon -mattr=+bf16 | FileCheck %s2 3; This test acts to test the old neon.bfcvt intrinsics, which are now4; autoupgraded to fptrunc operations.5 6declare bfloat @llvm.aarch64.neon.bfcvt(float)7declare <8 x bfloat> @llvm.aarch64.neon.bfcvtn(<4 x float>)8declare <8 x bfloat> @llvm.aarch64.neon.bfcvtn2(<8 x bfloat>, <4 x float>)9 10; CHECK-LABEL: test_vcvth_bf16_f3211; CHECK:      bfcvt h0, s012; CHECK-NEXT: ret13define bfloat @test_vcvth_bf16_f32(float %a) {14entry:15  %vcvth_bf16_f32 = call bfloat @llvm.aarch64.neon.bfcvt(float %a)16  ret bfloat %vcvth_bf16_f3217}18 19; CHECK-LABEL: test_vcvtq_low_bf16_f3220; CHECK:      bfcvtn v0.4h, v0.4s21; CHECK-NEXT: ret22define <8 x bfloat> @test_vcvtq_low_bf16_f32(<4 x float> %a) {23entry:24  %cvt = call <8 x bfloat> @llvm.aarch64.neon.bfcvtn(<4 x float> %a)25  ret <8 x bfloat> %cvt26}27 28; CHECK-LABEL: test_vcvtq_high_bf16_f3229; CHECK:      bfcvtn2 v1.8h, v0.4s30; CHECK-NEXT: mov v0.16b, v1.16b31; CHECK-NEXT: ret32define <8 x bfloat> @test_vcvtq_high_bf16_f32(<4 x float> %a, <8 x bfloat> %inactive) {33entry:34  %cvt = call <8 x bfloat> @llvm.aarch64.neon.bfcvtn2(<8 x bfloat> %inactive, <4 x float> %a)35  ret <8 x bfloat> %cvt36}37 38