[llvm] fc4020d - [X86] Mark fp128 FMA as LibCall instead of Expand. Add STRICT_FMA as well.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 21 18:32:05 PST 2019
Author: Craig Topper
Date: 2019-11-21T18:17:57-08:00
New Revision: fc4020dbbe446c6ba73fdda56390ce062eaf8f2e
URL: https://github.com/llvm/llvm-project/commit/fc4020dbbe446c6ba73fdda56390ce062eaf8f2e
DIFF: https://github.com/llvm/llvm-project/commit/fc4020dbbe446c6ba73fdda56390ce062eaf8f2e.diff
LOG: [X86] Mark fp128 FMA as LibCall instead of Expand. Add STRICT_FMA as well.
The Expand code would fall back to LibCall, but this makes it
more explicit.
Added:
Modified:
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/fp128-libcalls-strict.ll
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 059cce069f9a..bef8c8ab1ca0 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -674,7 +674,8 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
setOperationAction(ISD::STRICT_FDIV, MVT::f128, LibCall);
setOperationAction(ISD::FMUL, MVT::f128, LibCall);
setOperationAction(ISD::STRICT_FMUL, MVT::f128, LibCall);
- setOperationAction(ISD::FMA, MVT::f128, Expand);
+ setOperationAction(ISD::FMA, MVT::f128, LibCall);
+ setOperationAction(ISD::STRICT_FMA, MVT::f128, LibCall);
setOperationAction(ISD::FABS, MVT::f128, Custom);
setOperationAction(ISD::FNEG, MVT::f128, Custom);
diff --git a/llvm/test/CodeGen/X86/fp128-libcalls-strict.ll b/llvm/test/CodeGen/X86/fp128-libcalls-strict.ll
index 1e573089ac1f..3bd028af8433 100644
--- a/llvm/test/CodeGen/X86/fp128-libcalls-strict.ll
+++ b/llvm/test/CodeGen/X86/fp128-libcalls-strict.ll
@@ -54,9 +54,22 @@ entry:
ret fp128 %div
}
+define fp128 @fma(fp128 %x, fp128 %y, fp128 %z) nounwind strictfp {
+; CHECK-LABEL: fma:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: pushq %rax
+; CHECK-NEXT: callq fmal
+; CHECK-NEXT: popq %rax
+; CHECK-NEXT: retq
+entry:
+ %fma = call fp128 @llvm.experimental.constrained.fma.f128(fp128 %x, fp128 %y, fp128 %z, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
+ ret fp128 %fma
+}
+
attributes #0 = { strictfp }
declare fp128 @llvm.experimental.constrained.fadd.f128(fp128, fp128, metadata, metadata)
declare fp128 @llvm.experimental.constrained.fsub.f128(fp128, fp128, metadata, metadata)
declare fp128 @llvm.experimental.constrained.fmul.f128(fp128, fp128, metadata, metadata)
declare fp128 @llvm.experimental.constrained.fdiv.f128(fp128, fp128, metadata, metadata)
+declare fp128 @llvm.experimental.constrained.fma.f128(fp128, fp128, fp128, metadata, metadata)
More information about the llvm-commits
mailing list