aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/R600/R600ControlFlowFinalizer.cpp
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-06-07 20:37:48 +0000
committerTom Stellard <thomas.stellard@amd.com>2013-06-07 20:37:48 +0000
commita6c6e1bfc2c20e39374790fa6d03dd4f3aac626f (patch)
tree0b8e4b8e5dc3f1b84c286f9044a385bbcd3e6882 /llvm/lib/Target/R600/R600ControlFlowFinalizer.cpp
parent6235c06ff87f20d8d221b84b4ab816fe54a38624 (diff)
downloadllvm-a6c6e1bfc2c20e39374790fa6d03dd4f3aac626f.zip
llvm-a6c6e1bfc2c20e39374790fa6d03dd4f3aac626f.tar.gz
llvm-a6c6e1bfc2c20e39374790fa6d03dd4f3aac626f.tar.bz2
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> llvm-svn: 183566
Diffstat (limited to 'llvm/lib/Target/R600/R600ControlFlowFinalizer.cpp')
-rw-r--r--llvm/lib/Target/R600/R600ControlFlowFinalizer.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/Target/R600/R600ControlFlowFinalizer.cpp b/llvm/lib/Target/R600/R600ControlFlowFinalizer.cpp
index 3d448bf..6e21df8 100644
--- a/llvm/lib/Target/R600/R600ControlFlowFinalizer.cpp
+++ b/llvm/lib/Target/R600/R600ControlFlowFinalizer.cpp
@@ -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
}