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:
Tom Stellard
2013-06-07 20:37:48 +00:00
parent c1dcb8d654
commit 3ff0abfaab
36 changed files with 218 additions and 1458 deletions

View File

@ -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
}