[llvm] [X86] Enhance FABS/FNEG lowering for scalar _Float16 with bitwise operations (PR #128637)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 25 06:55:14 PST 2025
================
@@ -22313,7 +22344,7 @@ static SDValue LowerFABSorFNEG(SDValue Op, SelectionDAG &DAG) {
// generate a 16-byte vector constant and logic op even for the scalar case.
// Using a 16-byte mask allows folding the load of the mask with
// the logic op, so it can save (~4 bytes) on code size.
- bool IsFakeVector = !VT.isVector() && !IsF128;
+ bool IsFakeVector = !VT.isVector() && !IsF128 && VT != MVT::f16;
----------------
RKSimon wrote:
The SSE2 `setF16Action(MVT::f16, Promote)` call is setting the default values - these need to set to Custom for ISD::FABS/FNEG/FCOPYSIGN afterward.
https://github.com/llvm/llvm-project/pull/128637
More information about the llvm-commits
mailing list