radeon/llvm: Handle loads from the constants address space.
authorTom Stellard <thomas.stellard@amd.com>
Thu, 13 Sep 2012 15:21:42 +0000 (15:21 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Fri, 21 Sep 2012 19:30:58 +0000 (19:30 +0000)
Reading from constant memory is not supported yet, so constant reads use
global memory.

src/gallium/drivers/radeon/MCTargetDesc/R600MCCodeEmitter.cpp
src/gallium/drivers/radeon/R600Instructions.td

index 8ad8213eaf6b2b9afc4f1fc0f833b6f5e7413237..847fcb62d4e12c02e529f40782e29a223a573560 100644 (file)
@@ -166,6 +166,7 @@ void R600MCCodeEmitter::EncodeInstruction(const MCInst &MI, raw_ostream &OS,
         Emit(inst, OS);
         break;
       }
+    case AMDGPU::CONSTANT_LOAD_eg:
     case AMDGPU::VTX_READ_PARAM_i32_eg:
     case AMDGPU::VTX_READ_PARAM_f32_eg:
     case AMDGPU::VTX_READ_GLOBAL_i8_eg:
index ce7a17253cae9a9004cdaac5cf55da183e5f248c..db4a3b800975ab28fe810d96708fe08c5e2fbc41 100644 (file)
@@ -1161,6 +1161,15 @@ class VTX_READ_GLOBAL_128_eg <ValueType vt> : VTX_READ_128_eg <1,
 def VTX_READ_GLOBAL_v4i32_eg : VTX_READ_GLOBAL_128_eg<v4i32>;
 def VTX_READ_GLOBAL_v4f32_eg : VTX_READ_GLOBAL_128_eg<v4f32>;
 
+//===----------------------------------------------------------------------===//
+// Constant Loads
+// XXX: We are currently storing all constants in the global address space.
+//===----------------------------------------------------------------------===//
+
+def CONSTANT_LOAD_eg : VTX_READ_32_eg <1,
+  [(set (f32 R600_TReg32_X:$dst), (constant_load ADDRVTX_READ:$ptr))]
+>;
+
 }
 
 let Predicates = [isCayman] in {