1 ; RUN: llc < %s -mtriple=aarch64-eabi -mattr=+v8.2a,+neon,+fullfp16 | FileCheck %s
3 define dso_local half @t_vfmah_f16(half %a, half %b, half %c) {
4 ; CHECK-LABEL: t_vfmah_f16:
5 ; CHECK: fmadd h0, h1, h2, h0
8 %0 = tail call half @llvm.fma.f16(half %b, half %c, half %a)
12 define half @fnma16(half %a, half %b, half %c) nounwind readnone ssp {
13 ; CHECK-LABEL: fnma16:
14 ; CHECK: fnmadd h0, h0, h1, h2
16 %0 = tail call half @llvm.fma.f16(half %a, half %b, half %c)
17 %mul = fmul half %0, -1.000000e+00
21 define half @fms16(half %a, half %b, half %c) nounwind readnone ssp {
23 ; CHECK: fmsub h0, h0, h1, h2
25 %mul = fmul half %b, -1.000000e+00
26 %0 = tail call half @llvm.fma.f16(half %a, half %mul, half %c)
30 define half @fms16_com(half %a, half %b, half %c) nounwind readnone ssp {
31 ; CHECK-LABEL: fms16_com:
32 ; CHECK: fmsub h0, h1, h0, h2
35 %mul = fmul half %b, -1.000000e+00
36 %0 = tail call half @llvm.fma.f16(half %mul, half %a, half %c)
40 define half @fnms16(half %a, half %b, half %c) nounwind readnone ssp {
41 ; CHECK-LABEL: fnms16:
42 ; CHECK: fnmsub h0, h0, h1, h2
45 %mul = fmul half %c, -1.000000e+00
46 %0 = tail call half @llvm.fma.f16(half %a, half %b, half %mul)
50 define half @test_fmsub(half %a, half %b, half %c) {
51 ; CHECK-LABEL: test_fmsub:
52 ; CHECK: fmsub h0, h0, h1, h2
55 %nega = fsub half -0.0, %a
56 %val = call half @llvm.fma.f16(half %nega, half %b, half %c)
60 define half @test_fnmadd(half %a, half %b, half %c) {
61 ; CHECK-LABEL: test_fnmadd:
62 ; CHECK: fnmadd h0, h0, h1, h2
65 %nega = fsub half -0.0, %a
66 %negc = fsub half -0.0, %c
67 %val = call half @llvm.fma.f16(half %nega, half %b, half %negc)
71 define half @test_fmadd(half %a, half %b, half %c) {
72 ; CHECK-LABEL: test_fmadd:
73 ; CHECK: fmadd h0, h0, h1, h2
76 %nega = fsub half -0.0, %a
77 %negb = fsub half -0.0, %b
78 %val = call half @llvm.fma.f16(half %nega, half %negb, half %c)
82 define half @test_fnmsub(half %a, half %b, half %c) {
83 ; CHECK-LABEL: test_fnmsub:
84 ; CHECK: fnmsub h0, h0, h1, h2
87 %negc = fsub half -0.0, %c
88 %val = call half @llvm.fma.f16(half %a, half %b, half %negc)
92 declare half @llvm.fma.f16(half, half, half)