Skip to content

Commit 84be76f

Browse files
committed
[X86][EVEX512] Move 512-bit operations under useAVX512Regs
1 parent fddf350 commit 84be76f

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2022,6 +2022,10 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
20222022
setOperationAction(ISD::ROTL, MVT::v32i16, Custom);
20232023
setOperationAction(ISD::ROTR, MVT::v32i16, Custom);
20242024
}
2025+
2026+
setOperationAction(ISD::FNEG, MVT::v32f16, Custom);
2027+
setOperationAction(ISD::FABS, MVT::v32f16, Custom);
2028+
setOperationAction(ISD::FCOPYSIGN, MVT::v32f16, Custom);
20252029
}// useAVX512Regs
20262030

20272031
if (!Subtarget.useSoftFloat() && Subtarget.hasVBMI2()) {
@@ -2098,9 +2102,6 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
20982102
for (auto VT : { MVT::v4i32, MVT::v8i32, MVT::v2i64, MVT::v4i64 })
20992103
setOperationAction(ISD::CTPOP, VT, Legal);
21002104
}
2101-
setOperationAction(ISD::FNEG, MVT::v32f16, Custom);
2102-
setOperationAction(ISD::FABS, MVT::v32f16, Custom);
2103-
setOperationAction(ISD::FCOPYSIGN, MVT::v32f16, Custom);
21042105
}
21052106

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

llvm/test/CodeGen/X86/pr90844.ll

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,20 @@ entry:
1717
store <2 x i64> %5, ptr poison, align 16
1818
ret void
1919
}
20+
21+
define void @foo(ptr %0) {
22+
; CHECK-LABEL: foo:
23+
; CHECK: # %bb.0: # %entry
24+
; CHECK-NEXT: vpbroadcastw {{.*#+}} ymm0 = [-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0]
25+
; CHECK-NEXT: vpxor 32(%rdi), %ymm0, %ymm1
26+
; CHECK-NEXT: vpxor (%rdi), %ymm0, %ymm0
27+
; CHECK-NEXT: vmovdqa %ymm0, (%rdi)
28+
; CHECK-NEXT: vmovdqa %ymm1, 32(%rdi)
29+
; CHECK-NEXT: vzeroupper
30+
; CHECK-NEXT: retq
31+
entry:
32+
%1 = load <32 x half>, ptr %0
33+
%2 = fneg <32 x half> %1
34+
store <32 x half> %2, ptr %0
35+
ret void
36+
}

0 commit comments

Comments
 (0)