Skip to content

Commit

Permalink
[X86][EVEX512] Move 512-bit operations under useAVX512Regs
Browse files Browse the repository at this point in the history
  • Loading branch information
phoebewang committed May 24, 2024
1 parent fddf350 commit 84be76f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
7 changes: 4 additions & 3 deletions llvm/lib/Target/X86/X86ISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2022,6 +2022,10 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
setOperationAction(ISD::ROTL, MVT::v32i16, Custom);
setOperationAction(ISD::ROTR, MVT::v32i16, Custom);
}

setOperationAction(ISD::FNEG, MVT::v32f16, Custom);
setOperationAction(ISD::FABS, MVT::v32f16, Custom);
setOperationAction(ISD::FCOPYSIGN, MVT::v32f16, Custom);
}// useAVX512Regs

if (!Subtarget.useSoftFloat() && Subtarget.hasVBMI2()) {
Expand Down Expand Up @@ -2098,9 +2102,6 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
for (auto VT : { MVT::v4i32, MVT::v8i32, MVT::v2i64, MVT::v4i64 })
setOperationAction(ISD::CTPOP, VT, Legal);
}
setOperationAction(ISD::FNEG, MVT::v32f16, Custom);
setOperationAction(ISD::FABS, MVT::v32f16, Custom);
setOperationAction(ISD::FCOPYSIGN, MVT::v32f16, Custom);
}

// This block control legalization of v32i1/v64i1 which are available with
Expand Down
17 changes: 17 additions & 0 deletions llvm/test/CodeGen/X86/pr90844.ll
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,20 @@ entry:
store <2 x i64> %5, ptr poison, align 16
ret void
}

define void @foo(ptr %0) {
; CHECK-LABEL: foo:
; CHECK: # %bb.0: # %entry
; 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]
; CHECK-NEXT: vpxor 32(%rdi), %ymm0, %ymm1
; CHECK-NEXT: vpxor (%rdi), %ymm0, %ymm0
; CHECK-NEXT: vmovdqa %ymm0, (%rdi)
; CHECK-NEXT: vmovdqa %ymm1, 32(%rdi)
; CHECK-NEXT: vzeroupper
; CHECK-NEXT: retq
entry:
%1 = load <32 x half>, ptr %0
%2 = fneg <32 x half> %1
store <32 x half> %2, ptr %0
ret void
}

0 comments on commit 84be76f

Please sign in to comment.