[llvm] [AArch64][GlobalISel] Legalize 128-bit types for FABS (PR #104753)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 20 07:59:53 PDT 2024
================
@@ -8456,6 +8458,21 @@ LegalizerHelper::lowerAbsToCNeg(MachineInstr &MI) {
return Legalized;
}
+LegalizerHelper::LegalizeResult LegalizerHelper::lowerFAbs(MachineInstr &MI) {
+ Register SrcReg = MI.getOperand(1).getReg();
+ Register DstReg = MI.getOperand(0).getReg();
+
+ LLT Ty = MRI.getType(DstReg);
+
+ // Reset sign bit
+ MIRBuilder.buildAnd(DstReg, SrcReg,
+ MIRBuilder.buildConstant(
+ Ty, APInt::getSignedMaxValue(Ty.getSizeInBits())));
----------------
arsenm wrote:
Not 100% sure this works for ppc_fp128 but we don't support that yet anyway
https://github.com/llvm/llvm-project/pull/104753
More information about the llvm-commits
mailing list