From d11802438779edc773802b40dcfb3963eeca9f6e Mon Sep 17 00:00:00 2001 From: Dylan McKay Date: Sat, 1 Sep 2018 12:22:50 +0000 Subject: [PATCH] [AVR] Define the TST instruction as an alias of AND The 'tst Rd' instruction is equivalent to 'and Rd, Rd'. llvm-svn: 341276 --- llvm/lib/Target/AVR/AVRInstrInfo.td | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/llvm/lib/Target/AVR/AVRInstrInfo.td b/llvm/lib/Target/AVR/AVRInstrInfo.td index 2cba2e8..62f06f2 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)>; + -- 2.7.4