Skip to content

Commit f688e09

Browse files
authored
Enable custom lowering of fabs_v16f16 with AVX and fabs_v32f16 with A… (#73565)
This is the last patch for fabs lowering. v32f16 works for AVX as well with the patch (with type legalization).
1 parent 2630d72 commit f688e09

File tree

2 files changed

+26
-2283
lines changed

2 files changed

+26
-2283
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,8 +1596,7 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
15961596
setOperationAction(ISD::STORE, VT, Custom);
15971597
}
15981598
setF16Action(MVT::v16f16, Expand);
1599-
if (Subtarget.hasAVX2())
1600-
setOperationAction(ISD::FABS, MVT::v16f16, Custom);
1599+
setOperationAction(ISD::FABS, MVT::v16f16, Custom);
16011600
setOperationAction(ISD::FADD, MVT::v16f16, Expand);
16021601
setOperationAction(ISD::FSUB, MVT::v16f16, Expand);
16031602
setOperationAction(ISD::FMUL, MVT::v16f16, Expand);
@@ -2054,6 +2053,7 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
20542053
for (auto VT : { MVT::v4i32, MVT::v8i32, MVT::v2i64, MVT::v4i64 })
20552054
setOperationAction(ISD::CTPOP, VT, Legal);
20562055
}
2056+
setOperationAction(ISD::FABS, MVT::v32f16, Custom);
20572057
}
20582058

20592059
// This block control legalization of v32i1/v64i1 which are available with

0 commit comments

Comments
 (0)