From 125f9d0ca216e08ee07ec11f190395901f089deb Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Tue, 23 Jul 2013 01:48:08 +0000 Subject: [PATCH] R600: Simplify assembly for KCache registers using the TableGen !add operator Before: MOV * T0.W, KC0[131-128].Y After: MOV * T0.W, KC0[3].Y Reviewed-by: Vincent Lejeune git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186917 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/R600/R600RegisterInfo.td | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Target/R600/R600RegisterInfo.td b/lib/Target/R600/R600RegisterInfo.td index 66aa91628e1..1eabccbd59a 100644 --- a/lib/Target/R600/R600RegisterInfo.td +++ b/lib/Target/R600/R600RegisterInfo.td @@ -47,10 +47,10 @@ foreach Index = 0-127 in { foreach Index = 159-128 in { foreach Chan = [ "X", "Y", "Z", "W" ] in { // 32-bit Temporary Registers - def KC0_#Index#_#Chan : R600RegWithChan <"KC0["#Index#"-128]."#Chan, Index, Chan>; + def KC0_#Index#_#Chan : R600RegWithChan <"KC0["#!add(Index,-128)#"]."#Chan, Index, Chan>; } // 128-bit Temporary Registers - def KC0_#Index#_XYZW : R600Reg_128 <"KC0["#Index#"-128].XYZW", + def KC0_#Index#_XYZW : R600Reg_128 <"KC0["#!add(Index, -128)#"].XYZW", [!cast("KC0_"#Index#"_X"), !cast("KC0_"#Index#"_Y"), !cast("KC0_"#Index#"_Z"), @@ -62,10 +62,10 @@ foreach Index = 159-128 in { foreach Index = 191-160 in { foreach Chan = [ "X", "Y", "Z", "W" ] in { // 32-bit Temporary Registers - def KC1_#Index#_#Chan : R600RegWithChan <"KC1["#Index#"-160]."#Chan, Index, Chan>; + def KC1_#Index#_#Chan : R600RegWithChan <"KC1["#!add(Index,-160)#"]."#Chan, Index, Chan>; } // 128-bit Temporary Registers - def KC1_#Index#_XYZW : R600Reg_128 <"KC1["#Index#"-160].XYZW", + def KC1_#Index#_XYZW : R600Reg_128 <"KC1["#!add(Index, -160)#"].XYZW", [!cast("KC1_"#Index#"_X"), !cast("KC1_"#Index#"_Y"), !cast("KC1_"#Index#"_Z"),