[PATCH] D154592: [X86] LowerTRUNCATE - improve handling during type legalization to PACKSS/PACKUS patterns

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 11 02:39:33 PDT 2023


RKSimon added a comment.

Thanks @pengfei



================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:1242
     setOperationAction(ISD::TRUNCATE,    MVT::v4i16, Custom);
+    setOperationAction(ISD::TRUNCATE,    MVT::v4i32, Custom);
     setOperationAction(ISD::TRUNCATE,    MVT::v8i8,  Custom);
----------------
pengfei wrote:
> Why no `v2i64` and `v4i64`?
This tends to affect legal destination types or ones that are widened (via ReplaceNodeResults etc.) - so will need to be addressed in the next patch.


================
Comment at: llvm/test/CodeGen/X86/cast-vsel.ll:322
 ; SSE41-NEXT:    andps %xmm0, %xmm3
+; SSE41-NEXT:    psrld $31, %xmm4
 ; SSE41-NEXT:    movaps %xmm3, dj+4112(%rax)
----------------
pengfei wrote:
> This seems a little worse that `addps`?
Yes, I'll see if I can clean this up in a followup - its strange that xmm4 is being shifted but xmm3 still uses the and - I'd expect both to have been affected in the same manner.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154592/new/

https://reviews.llvm.org/D154592



More information about the llvm-commits mailing list