mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
AArch64/PowerPC/SystemZ/X86: This patch fixes the interface, usage, and all
in-tree implementations of TargetLoweringBase::isFMAFasterThanMulAndAdd in order to resolve the following issues with fmuladd (i.e. optional FMA) intrinsics: 1. On X86(-64) targets, ISD::FMA nodes are formed when lowering fmuladd intrinsics even if the subtarget does not support FMA instructions, leading to laughably bad code generation in some situations. 2. On AArch64 targets, ISD::FMA nodes are formed for operations on fp128, resulting in a call to a software fp128 FMA implementation. 3. On PowerPC targets, FMAs are not generated from fmuladd intrinsics on types like v2f32, v8f32, v4f64, etc., even though they promote, split, scalarize, etc. to types that support hardware FMAs. The function has also been slightly renamed for consistency and to force a merge/build conflict for any out-of-tree target implementing it. To resolve, see comments and fixed in-tree examples. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185956 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -7809,18 +7809,15 @@ bool PPCTargetLowering::allowsUnalignedMemoryAccesses(EVT VT,
|
||||
return true;
|
||||
}
|
||||
|
||||
/// isFMAFasterThanMulAndAdd - Return true if an FMA operation is faster than
|
||||
/// a pair of mul and add instructions. fmuladd intrinsics will be expanded to
|
||||
/// FMAs when this method returns true (and FMAs are legal), otherwise fmuladd
|
||||
/// is expanded to mul + add.
|
||||
bool PPCTargetLowering::isFMAFasterThanMulAndAdd(EVT VT) const {
|
||||
bool PPCTargetLowering::isFMAFasterThanFMulAndFAdd(EVT VT) const {
|
||||
VT = VT.getScalarType();
|
||||
|
||||
if (!VT.isSimple())
|
||||
return false;
|
||||
|
||||
switch (VT.getSimpleVT().SimpleTy) {
|
||||
case MVT::f32:
|
||||
case MVT::f64:
|
||||
case MVT::v4f32:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
|
Reference in New Issue
Block a user