[PATCH] D105360: [PowerPC] Fix popcntb XL Compat Builtin for 32bit

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 13 10:02:48 PDT 2021


efriedma added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCInstr64Bit.td:831
+// 64bit version of popcntb for 64bit sized unsigned long. 
+let isCodeGenOnly = 1 in
+def POPCNTB8 : XForm_11<31, 122, (outs g8rc:$rA), (ins g8rc:$rS),
----------------
I'm sort of confused by the instruction variations here... let me see if I'm understanding correctly:

1. popcntb always produces a 64-bit result.
2. The 32-bit variation of the intrinsic just throws away the high bits.
3. We can't use the 64-bit instruction in "32-bit" mode because we marked the register class illegal in isel, and Feature64BitRegs has been marked "beta" for the last 15 years.
4. Therefore, there are two versions of the instruction: the real instruction that produces a 64-bit result, and a fake version of the instruction we can use in 32-bit mode.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105360



More information about the cfe-commits mailing list