mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-12-19 11:23:32 +00:00
R600/SI: Use bcnt instruction for ctpop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210567 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -668,6 +668,7 @@ unsigned SIInstrInfo::getVALUOp(const MachineInstr &MI) {
|
||||
case AMDGPU::S_LOAD_DWORDX2_SGPR: return AMDGPU::BUFFER_LOAD_DWORDX2_ADDR64;
|
||||
case AMDGPU::S_LOAD_DWORDX4_IMM:
|
||||
case AMDGPU::S_LOAD_DWORDX4_SGPR: return AMDGPU::BUFFER_LOAD_DWORDX4_ADDR64;
|
||||
case AMDGPU::S_BCNT1_I32_B32: return AMDGPU::V_BCNT_U32_B32_e32;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1218,6 +1219,10 @@ void SIInstrInfo::moveToVALU(MachineInstr &TopInst) const {
|
||||
// 3 to not hit an assertion later in MCInstLower.
|
||||
Inst->addOperand(MachineOperand::CreateImm(0));
|
||||
Inst->addOperand(MachineOperand::CreateImm(0));
|
||||
} else if (Opcode == AMDGPU::S_BCNT1_I32_B32) {
|
||||
// The VALU version adds the second operand to the result, so insert an
|
||||
// extra 0 operand.
|
||||
Inst->addOperand(MachineOperand::CreateImm(0));
|
||||
}
|
||||
|
||||
addDescImplicitUseDef(NewDesc, Inst);
|
||||
|
||||
Reference in New Issue
Block a user