From 89ece086bcd2186ab53cb6a69d53005893cab0ea Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Tue, 29 May 2012 11:36:29 -0400 Subject: radeonsi: Remove use.sgpr* intrinsics, use load instructions instead We now model loading uses sgpr values with LLVM IR load instructions that use the USER_SGPR address space. The definition of the sgpr parameter to the use_sgpr() helper function in radeonsi_shader.c has changed so that you can pass raw sgpr values rather than having to divide the sgpr value you want to use by the dword width of the type you want to load. --- src/gallium/drivers/radeon/SIInstructions.td | 40 +++++++++++----------------- 1 file changed, 16 insertions(+), 24 deletions(-) (limited to 'src/gallium/drivers/radeon/SIInstructions.td') diff --git a/src/gallium/drivers/radeon/SIInstructions.td b/src/gallium/drivers/radeon/SIInstructions.td index a77b8bd7c11..fc8ec4a3394 100644 --- a/src/gallium/drivers/radeon/SIInstructions.td +++ b/src/gallium/drivers/radeon/SIInstructions.td @@ -7,6 +7,18 @@ // //===----------------------------------------------------------------------===// +def load_user_sgpr : PatFrag<(ops node:$ptr), + (load node:$ptr), + [{ + const Value *Src = cast(N)->getSrcValue(); + if (Src) { + PointerType * PT = dyn_cast(Src->getType()); + return PT && PT->getAddressSpace() == AMDILAS::USER_SGPR_ADDRESS; + } + return false; + }] +>; + def isSI : Predicate<"Subtarget.device()" "->getGeneration() == AMDILDeviceInfo::HD7XXX">; @@ -826,26 +838,19 @@ def SI_INTERP_CONST : InstSI < imm:$attr, SReg_32:$params))] >; - def USE_SGPR_32 : InstSI < (outs SReg_32:$dst), (ins i32imm:$src0), "USE_SGPR_32", - [(set SReg_32:$dst, (int_SI_use_sgpr imm:$src0))] - -> { - field bits<32> Inst = 0; -} + [(set (i32 SReg_32:$dst), (load_user_sgpr imm:$src0))] +>; def USE_SGPR_64 : InstSI < (outs SReg_64:$dst), (ins i32imm:$src0), "USE_SGPR_64", - [(set SReg_64:$dst, (int_SI_use_sgpr imm:$src0))] - -> { - field bits<32> Inst = 0; -} + [(set (i64 SReg_64:$dst), (load_user_sgpr imm:$src0))] +>; def VS_LOAD_BUFFER_INDEX : InstSI < (outs VReg_32:$dst), @@ -869,19 +874,6 @@ def : Pat< 0, 0, (i32 SREG_LIT_0)) >; -def : Pat< - (int_SI_use_sgprptrcf32 imm:$src0), - (USE_SGPR_64 imm:$src0) ->; -def : Pat< - (int_SI_use_sgprptrci128 imm:$src0), - (USE_SGPR_64 imm:$src0) ->; -def : Pat< - (int_SI_use_sgprptrci256 imm:$src0), - (USE_SGPR_64 imm:$src0) ->; - /* int_SI_export */ def : Pat < (int_SI_export imm:$en, imm:$vm, imm:$done, imm:$tgt, imm:$compr, -- cgit v1.2.3