[PATCH] D155622: [X86] Recognize standalone `(1 << nbits) - 1` pattern as bzhi

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 18 10:39:29 PDT 2023


goldstein.w.n added inline comments.


================
Comment at: llvm/test/CodeGen/X86/extract-lowbits.ll:2948
   ret i64 %masked
 }
 
----------------
danilaml wrote:
> goldstein.w.n wrote:
> > Can you add a test where `nbits` is masked by vreg width? Just want to make sure those semantics are maintained.
> Could elaborate? Which semantics should the test verify?
> Do you mean something like `(1 << (nbits & vreg_width)) - 1`?
Yes, just don't see any tests with a mask. `vreg_width - 1` really. I expect it to work fine, just want to watch out for the fact that shifts can ignore word mask, but bzhi can't


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155622



More information about the llvm-commits mailing list