mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 04:24:00 +00:00
R600: Rework subtarget info and remove AMDILDevice classes
This should simplify the subtarget definitions and make it easier to add new ones. Reviewed-by: Vincent Lejeune <vljn@ovi.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183566 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -65,7 +65,7 @@ private:
|
||||
|
||||
const MCInstrDesc &getHWInstrDesc(ControlFlowInstruction CFI) const {
|
||||
unsigned Opcode = 0;
|
||||
bool isEg = (ST.device()->getGeneration() >= AMDGPUDeviceInfo::HD5XXX);
|
||||
bool isEg = (ST.getGeneration() >= AMDGPUSubtarget::EVERGREEN);
|
||||
switch (CFI) {
|
||||
case CF_TC:
|
||||
Opcode = isEg ? AMDGPU::CF_TC_EG : AMDGPU::CF_TC_R600;
|
||||
@ -98,7 +98,7 @@ private:
|
||||
Opcode = isEg ? AMDGPU::POP_EG : AMDGPU::POP_R600;
|
||||
break;
|
||||
case CF_END:
|
||||
if (ST.device()->getDeviceFlag() == OCL_DEVICE_CAYMAN) {
|
||||
if (ST.hasCaymanISA()) {
|
||||
Opcode = AMDGPU::CF_END_CM;
|
||||
break;
|
||||
}
|
||||
@ -301,17 +301,19 @@ private:
|
||||
}
|
||||
|
||||
unsigned getHWStackSize(unsigned StackSubEntry, bool hasPush) const {
|
||||
switch (ST.device()->getGeneration()) {
|
||||
case AMDGPUDeviceInfo::HD4XXX:
|
||||
switch (ST.getGeneration()) {
|
||||
case AMDGPUSubtarget::R600:
|
||||
case AMDGPUSubtarget::R700:
|
||||
if (hasPush)
|
||||
StackSubEntry += 2;
|
||||
break;
|
||||
case AMDGPUDeviceInfo::HD5XXX:
|
||||
case AMDGPUSubtarget::EVERGREEN:
|
||||
if (hasPush)
|
||||
StackSubEntry ++;
|
||||
case AMDGPUDeviceInfo::HD6XXX:
|
||||
case AMDGPUSubtarget::NORTHERN_ISLANDS:
|
||||
StackSubEntry += 2;
|
||||
break;
|
||||
default: llvm_unreachable("Not a VLIW4/VLIW5 GPU");
|
||||
}
|
||||
return (StackSubEntry + 3)/4; // Need ceil value of StackSubEntry/4
|
||||
}
|
||||
|
Reference in New Issue
Block a user