diff options
author | Tom Stellard <[email protected]> | 2012-07-10 11:15:49 -0400 |
---|---|---|
committer | Tom Stellard <[email protected]> | 2012-07-11 17:47:20 +0000 |
commit | 49ae102ee346d4be6a61ebdaba6e5d5ad8469407 (patch) | |
tree | 069e17b22b82de1661c1f81cb1e08a80ec507d28 /src/gallium/drivers/radeon/R600Instructions.td | |
parent | bbdf3af8577ca61fc54c4a1615e80940c904636e (diff) |
radeon/llvm: Use multiclasses for floating point loads
The original strategy for handling floating point loads, which was to
lower (f32 load) to (f32 bitcast (i32 load)) wasn't really working. The
main problem was that the DAG legalizer couldn't handle replacing a node
with two results (load) with a node with only one result (bitcast).
Diffstat (limited to 'src/gallium/drivers/radeon/R600Instructions.td')
-rw-r--r-- | src/gallium/drivers/radeon/R600Instructions.td | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/src/gallium/drivers/radeon/R600Instructions.td b/src/gallium/drivers/radeon/R600Instructions.td index a7d29fe5488..f96bd157da7 100644 --- a/src/gallium/drivers/radeon/R600Instructions.td +++ b/src/gallium/drivers/radeon/R600Instructions.td @@ -1021,14 +1021,6 @@ class VTX_READ_32_eg <bits<8> buffer_id, list<dag> pattern> let DATA_FORMAT = 0xD; // COLOR_32 } -def VTX_READ_PARAM_eg : VTX_READ_32_eg <0, - [(set (i32 R600_TReg32_X:$dst), (load_param ADDRVTX_READ:$ptr))] ->; - -def VTX_READ_GLOBAL_eg : VTX_READ_32_eg <1, - [(set (i32 R600_TReg32_X:$dst), (global_load ADDRVTX_READ:$ptr))] ->; - class VTX_READ_128_eg <bits<8> buffer_id, list<dag> pattern> : VTX_READ_eg <buffer_id, (outs R600_Reg128:$dst), pattern> { @@ -1040,10 +1032,40 @@ class VTX_READ_128_eg <bits<8> buffer_id, list<dag> pattern> let DATA_FORMAT = 0x22; // COLOR_32_32_32_32 } -def VTX_READ_GLOBAL_128_eg : VTX_READ_128_eg <1, - [(set (v4i32 R600_Reg128:$dst), (global_load ADDRVTX_READ:$ptr))] +//===----------------------------------------------------------------------===// +// VTX Read from parameter memory space +//===----------------------------------------------------------------------===// + +class VTX_READ_PARAM_32_eg <ValueType vt> : VTX_READ_32_eg <0, + [(set (vt R600_TReg32_X:$dst), (load_param ADDRVTX_READ:$ptr))] +>; + +def VTX_READ_PARAM_i32_eg : VTX_READ_PARAM_32_eg<i32>; +def VTX_READ_PARAM_f32_eg : VTX_READ_PARAM_32_eg<f32>; + + +//===----------------------------------------------------------------------===// +// VTX Read from global memory space +//===----------------------------------------------------------------------===// + +// 32-bit reads + +class VTX_READ_GLOBAL_eg <ValueType vt> : VTX_READ_32_eg <1, + [(set (vt R600_TReg32_X:$dst), (global_load ADDRVTX_READ:$ptr))] >; +def VTX_READ_GLOBAL_i32_eg : VTX_READ_GLOBAL_eg<i32>; +def VTX_READ_GLOBAL_f32_eg : VTX_READ_GLOBAL_eg<f32>; + +// 128-bit reads + +class VTX_READ_GLOBAL_128_eg <ValueType vt> : VTX_READ_128_eg <1, + [(set (vt R600_Reg128:$dst), (global_load ADDRVTX_READ:$ptr))] +>; + +def VTX_READ_GLOBAL_v4i32_eg : VTX_READ_GLOBAL_128_eg<v4i32>; +def VTX_READ_GLOBAL_v4f32_eg : VTX_READ_GLOBAL_128_eg<v4f32>; + } let Predicates = [isCayman] in { |