This patch implements the __popcntb XL compatibility builtin for 32bit in the frontend and backend. This patch also updates tests for __popcntb and other XL Compat sync related builtins.
Details
- Reviewers
stefanp nemanjai amyk - Group Reviewers
Restricted Project - Commits
- rGde3956605a70: [PowerPC] Fix popcntb XL Compat Builtin for 32bit
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/test/CodeGen/builtins-ppc-xlcompat-sync.c | ||
---|---|---|
241 | From the document, __icbt only valid when -qarch is set to target pwr8 or higher processors. It looks like target cpu sema checking and error case are missing. If you are working on another patch to fix it, please put fixme comments for the __icbt implementation and test case in this patch. | |
469 | same as above. | |
llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-sync-64.ll | ||
84 | same here, pwr8 (or later processors) only |
Minor indentation comments but LGTM.
clang/test/CodeGen/builtins-ppc-xlcompat-sync.c | ||
---|---|---|
3 | ||
llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-msync.ll | ||
3 | Minor indentation nit. | |
llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-sync-32.ll | ||
4 | Minor indentation nit. | |
llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-sync-64.ll | ||
4 | Minor indentation nit. |
llvm/lib/Target/PowerPC/PPCInstr64Bit.td | ||
---|---|---|
913 | I'm sort of confused by the instruction variations here... let me see if I'm understanding correctly:
|
llvm/lib/Target/PowerPC/PPCInstr64Bit.td | ||
---|---|---|
913 | This is correct. We have two GPR register classes that model the same register file. The gprc registers pretend the high bits don't exist. The two versions of the instructions that have GPR operands are quite common in PPC. There have historically been some operating systems on which context switches spill the full width GPRs even in 32-bit mode. Others spill only the low 32 bits of the GPRs. The addition of two different register classes and Feature64BitRegs likely had to do with that. |
llvm/lib/Target/PowerPC/PPCInstr64Bit.td | ||
---|---|---|
913 |
Oh, that makes sense. You can't really use the high bits of a 64-bit register if they can get randomly zeroed out from under you. Are any commonly used operating systems today in the "spill only the low 32 bits" category? |
llvm/lib/Target/PowerPC/PPCInstr64Bit.td | ||
---|---|---|
913 | Unfortunately, 32-bit AIX is in this category. We are hoping to be able to change that so that once we no longer support the old versions, we have more freedom with code generation. |