summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorDylan McKay <me@dylanmckay.io>2018-09-01 12:22:50 +0000
committerDylan McKay <me@dylanmckay.io>2018-09-01 12:22:50 +0000
commitd11802438779edc773802b40dcfb3963eeca9f6e (patch)
treeb076dd3fed0abab7f4f01f9b66cbc26505b68eaf /llvm
parent8b0f9d2e58f1cb0267ebed9eec3de6b54ba10a98 (diff)
downloadbcm5719-llvm-d11802438779edc773802b40dcfb3963eeca9f6e.tar.gz
bcm5719-llvm-d11802438779edc773802b40dcfb3963eeca9f6e.zip
[AVR] Define the TST instruction as an alias of AND
The 'tst Rd' instruction is equivalent to 'and Rd, Rd'. llvm-svn: 341276
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Target/AVR/AVRInstrInfo.td15
1 files changed, 6 insertions, 9 deletions
diff --git a/llvm/lib/Target/AVR/AVRInstrInfo.td b/llvm/lib/Target/AVR/AVRInstrInfo.td
index 2cba2e80f4e..62f06f2bf77 100644
--- a/llvm/lib/Target/AVR/AVRInstrInfo.td
+++ b/llvm/lib/Target/AVR/AVRInstrInfo.td
@@ -730,15 +730,7 @@ Defs = [SREG] in
// TST Rd
// Test for zero of minus.
// This operation is identical to a `Rd AND Rd`.
-//def : InstAlias<"tst\t$rd", (ANDRdRr GPR8:$rd, GPR8:$rd), 1>;
-
-let Defs = [SREG] in
-def TSTRd : FTST<0b0010,
- 0b00,
- (outs),
- (ins GPR8:$rd),
- "tst\t$rd",
- [(AVRtst i8:$rd)]>;
+def : InstAlias<"tst\t$rd", (ANDRdRr GPR8:$rd, GPR8:$rd)>;
//===----------------------------------------------------------------------===//
// Jump instructions
@@ -2104,3 +2096,8 @@ def : Pat<(i8 (trunc (AVRlsr (AVRlsr (AVRlsr (AVRlsr (AVRlsr (AVRlsr (AVRlsr
def : Pat<(shl i16:$src1, (i8 1)),
(LSLWRd i16:$src1)>;
+// Lowering of 'tst' node to 'TST' instruction.
+// TST is an alias of AND Rd, Rd.
+def : Pat<(AVRtst i8:$rd),
+ (ANDRdRr $rd, $rd)>;
+
OpenPOWER on IntegriCloud