[llvm] r341276 - [AVR] Define the TST instruction as an alias of AND

Dylan McKay via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 1 05:22:50 PDT 2018


Author: dylanmckay
Date: Sat Sep  1 05:22:50 2018
New Revision: 341276

URL: http://llvm.org/viewvc/llvm-project?rev=341276&view=rev
Log:
[AVR] Define the TST instruction as an alias of AND

The 'tst Rd' instruction is equivalent to 'and Rd, Rd'.

Modified:
    llvm/trunk/lib/Target/AVR/AVRInstrInfo.td

Modified: llvm/trunk/lib/Target/AVR/AVRInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AVR/AVRInstrInfo.td?rev=341276&r1=341275&r2=341276&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AVR/AVRInstrInfo.td (original)
+++ llvm/trunk/lib/Target/AVR/AVRInstrInfo.td Sat Sep  1 05:22:50 2018
@@ -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 (AV
 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)>;
+




More information about the llvm-commits mailing list