93 lines · plain
1; RUN: llc < %s -mtriple=aarch64 -mattr=+v8.2a,+neon,+fullfp16 | FileCheck %s2 3define dso_local half @t_vfmah_f16(half %a, half %b, half %c) {4; CHECK-LABEL: t_vfmah_f16:5; CHECK: fmadd h0, h1, h2, h06; CHECK-NEXT: ret7entry:8 %0 = tail call half @llvm.fma.f16(half %b, half %c, half %a)9 ret half %010}11 12define half @fnma16(half %a, half %b, half %c) nounwind readnone ssp {13; CHECK-LABEL: fnma16:14; CHECK: fnmadd h0, h0, h1, h215entry:16 %0 = tail call half @llvm.fma.f16(half %a, half %b, half %c)17 %mul = fmul half %0, -1.000000e+0018 ret half %mul19}20 21define half @fms16(half %a, half %b, half %c) nounwind readnone ssp {22; CHECK-LABEL: fms16:23; CHECK: fmsub h0, h0, h1, h224entry:25 %mul = fneg half %b26 %0 = tail call half @llvm.fma.f16(half %a, half %mul, half %c)27 ret half %028}29 30define half @fms16_com(half %a, half %b, half %c) nounwind readnone ssp {31; CHECK-LABEL: fms16_com:32; CHECK: fmsub h0, h1, h0, h233; CHECK-NEXT: ret34entry:35 %mul = fneg half %b36 %0 = tail call half @llvm.fma.f16(half %mul, half %a, half %c)37 ret half %038}39 40define half @fnms16(half %a, half %b, half %c) nounwind readnone ssp {41; CHECK-LABEL: fnms16:42; CHECK: fnmsub h0, h0, h1, h243; CHECK-NEXT: ret44entry:45 %mul = fneg half %c46 %0 = tail call half @llvm.fma.f16(half %a, half %b, half %mul)47 ret half %048}49 50define half @test_fmsub(half %a, half %b, half %c) {51; CHECK-LABEL: test_fmsub:52; CHECK: fmsub h0, h0, h1, h253; CHECK-NEXT: ret54entry:55 %nega = fsub half -0.0, %a56 %val = call half @llvm.fma.f16(half %nega, half %b, half %c)57 ret half %val58}59 60define half @test_fnmadd(half %a, half %b, half %c) {61; CHECK-LABEL: test_fnmadd:62; CHECK: fnmadd h0, h0, h1, h263; CHECK-NEXT: ret64entry:65 %nega = fsub half -0.0, %a66 %negc = fsub half -0.0, %c67 %val = call half @llvm.fma.f16(half %nega, half %b, half %negc)68 ret half %val69}70 71define half @test_fmadd(half %a, half %b, half %c) {72; CHECK-LABEL: test_fmadd:73; CHECK: fmadd h0, h0, h1, h274; CHECK-NEXT: ret75entry:76 %nega = fsub half -0.0, %a77 %negb = fsub half -0.0, %b78 %val = call half @llvm.fma.f16(half %nega, half %negb, half %c)79 ret half %val80}81 82define half @test_fnmsub(half %a, half %b, half %c) {83; CHECK-LABEL: test_fnmsub:84; CHECK: fnmsub h0, h0, h1, h285; CHECK-NEXT: ret86entry:87 %negc = fsub half -0.0, %c88 %val = call half @llvm.fma.f16(half %a, half %b, half %negc)89 ret half %val90}91 92declare half @llvm.fma.f16(half, half, half)93