summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChristian Konig <christian.koenig@amd.com>2013-02-16 11:28:36 +0000
committerChristian Konig <christian.koenig@amd.com>2013-02-16 11:28:36 +0000
commitb559b079b4a7ca7fe0462280ee5bf4fd300c775f (patch)
tree927af6b9758902ba569d960b0dc60bc71ab29941 /llvm/lib
parenta881179ffe789ca25c987da3da63c1e7363aa7cf (diff)
downloadbcm5719-llvm-b559b079b4a7ca7fe0462280ee5bf4fd300c775f.tar.gz
bcm5719-llvm-b559b079b4a7ca7fe0462280ee5bf4fd300c775f.zip
R600/SI: Add pattern to simplify i64 loading
This is a candidate for the stable branch. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 175356
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/R600/SIInstrInfo.td4
-rw-r--r--llvm/lib/Target/R600/SIInstructions.td5
2 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Target/R600/SIInstrInfo.td b/llvm/lib/Target/R600/SIInstrInfo.td
index efc6015c681..8c4e5afdeb7 100644
--- a/llvm/lib/Target/R600/SIInstrInfo.td
+++ b/llvm/lib/Target/R600/SIInstrInfo.td
@@ -40,6 +40,10 @@ def IMM12bit : ImmLeaf <
[{return isUInt<12>(Imm);}]
>;
+class InlineImm <ValueType vt> : ImmLeaf <vt, [{
+ return -16 <= Imm && Imm <= 64;
+}]>;
+
class InstSI <dag outs, dag ins, string asm, list<dag> pattern> :
AMDGPUInst<outs, ins, asm, pattern> {
diff --git a/llvm/lib/Target/R600/SIInstructions.td b/llvm/lib/Target/R600/SIInstructions.td
index 7a83303eef7..9372993dd44 100644
--- a/llvm/lib/Target/R600/SIInstructions.td
+++ b/llvm/lib/Target/R600/SIInstructions.td
@@ -1292,6 +1292,11 @@ def : Pat <
(S_MOV_B32 fpimm:$imm)
>;
+def : Pat <
+ (i64 InlineImm<i64>:$imm),
+ (S_MOV_B64 InlineImm<i64>:$imm)
+>;
+
// i64 immediates aren't supported in hardware, split it into two 32bit values
def : Pat <
(i64 imm:$imm),
OpenPOWER on IntegriCloud