[llvm] r371833 - [AArch64] More @llvm.fma.f16 tests

Sjoerd Meijer via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 13 02:44:13 PDT 2019


Author: sjoerdmeijer
Date: Fri Sep 13 02:44:13 2019
New Revision: 371833

URL: http://llvm.org/viewvc/llvm-project?rev=371833&view=rev
Log:
[AArch64] More @llvm.fma.f16 tests

Follow up of rL371321 that added FMA FP16 patterns. This adds more tests
for @llvm.fma.f16. This probably shows we miss one fmsub optimisation
opportunity, which I will look into.

Modified:
    llvm/trunk/test/CodeGen/AArch64/fp16_intrinsic_scalar_3op.ll

Modified: llvm/trunk/test/CodeGen/AArch64/fp16_intrinsic_scalar_3op.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/fp16_intrinsic_scalar_3op.ll?rev=371833&r1=371832&r2=371833&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/fp16_intrinsic_scalar_3op.ll (original)
+++ llvm/trunk/test/CodeGen/AArch64/fp16_intrinsic_scalar_3op.ll Fri Sep 13 02:44:13 2019
@@ -1,6 +1,4 @@
-; RUN: llc < %s -mtriple=aarch64-eabi -mattr=+v8.2a,+fullfp16  | FileCheck %s
-
-declare half @llvm.fma.f16(half, half, half)
+; RUN: llc < %s -mtriple=aarch64-eabi -mattr=+v8.2a,+neon,+fullfp16  | FileCheck %s
 
 define dso_local half @t_vfmah_f16(half %a, half %b, half %c) {
 ; CHECK-LABEL: t_vfmah_f16:
@@ -11,3 +9,45 @@ entry:
   ret half %0
 }
 
+define half @fnma16(half %a, half %b, half %c) nounwind readnone ssp {
+entry:
+; CHECK-LABEL: fnma16:
+; CHECK: fnmadd h0, h0, h1, h2
+  %0 = tail call half @llvm.fma.f16(half %a, half %b, half %c)
+  %mul = fmul half %0, -1.000000e+00
+  ret half %mul
+}
+
+define half @fms16(half %a, half %b, half %c) nounwind readnone ssp {
+entry:
+; CHECK-LABEL: fms16:
+; CHECK: fmsub h0, h0, h1, h2
+  %mul = fmul half %b, -1.000000e+00
+  %0 = tail call half @llvm.fma.f16(half %a, half %mul, half %c)
+  ret half %0
+}
+
+define half @fms16_com(half %a, half %b, half %c) nounwind readnone ssp {
+entry:
+; CHECK-LABEL: fms16_com:
+
+; FIXME:       This should be a fmsub.
+
+; CHECK:       fneg  h1, h1
+; CHECK-NEXT:  fmadd h0, h1, h0, h2
+  %mul = fmul half %b, -1.000000e+00
+  %0 = tail call half @llvm.fma.f16(half %mul, half %a, half %c)
+  ret half %0
+}
+
+define half @fnms16(half %a, half %b, half %c) nounwind readnone ssp {
+entry:
+; CHECK-LABEL: fnms16:
+; CHECK: fnmsub h0, h0, h1, h2
+  %mul = fmul half %c, -1.000000e+00
+  %0 = tail call half @llvm.fma.f16(half %a, half %b, half %mul)
+  ret half %0
+}
+
+declare half @llvm.fma.f16(half, half, half)
+




More information about the llvm-commits mailing list