diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2009-05-03 13:18:50 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2009-05-03 13:18:50 +0000 |
commit | 1fcfb6b6d2635ca817e6ecc0ba2dac80e530fb81 (patch) | |
tree | eec3eec3f5d8fd961c1446024ec2a7d639061402 /lib/Target | |
parent | f2f540261b187bb3fd14646a08f7e79afa1b5d96 (diff) | |
download | external_llvm-1fcfb6b6d2635ca817e6ecc0ba2dac80e530fb81.zip external_llvm-1fcfb6b6d2635ca817e6ecc0ba2dac80e530fb81.tar.gz external_llvm-1fcfb6b6d2635ca817e6ecc0ba2dac80e530fb81.tar.bz2 |
Temporary disable imm patterns for cmp. Actually, all cmp-related stuff (select_cc, setcc, br_cc). needs to be rethought
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70766 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/MSP430/MSP430InstrInfo.td | 100 |
1 files changed, 82 insertions, 18 deletions
diff --git a/lib/Target/MSP430/MSP430InstrInfo.td b/lib/Target/MSP430/MSP430InstrInfo.td index 8f7e4f7..4dfda5d 100644 --- a/lib/Target/MSP430/MSP430InstrInfo.td +++ b/lib/Target/MSP430/MSP430InstrInfo.td @@ -691,12 +691,58 @@ def CMP16rr : Pseudo<(outs), (ins GR16:$src1, GR16:$src2), "cmp.w\t{$src1, $src2}", [(MSP430cmp GR16:$src1, GR16:$src2), (implicit SRW)]>; -def CMP8ri : Pseudo<(outs), (ins GR8:$src1, i8imm:$src2), - "cmp.b\t{$src1, $src2}", - [(MSP430cmp GR8:$src1, imm:$src2), (implicit SRW)]>; -def CMP16ri : Pseudo<(outs), (ins GR16:$src1, i16imm:$src2), - "cmp.w\t{$src1, $src2}", - [(MSP430cmp GR16:$src1, imm:$src2), (implicit SRW)]>; +// FIXME: imm is allowed only on src operand, not on dst. + +//def CMP8ri : Pseudo<(outs), (ins GR8:$src1, i8imm:$src2), +// "cmp.b\t{$src1, $src2}", +// [(MSP430cmp GR8:$src1, imm:$src2), (implicit SRW)]>; +//def CMP16ri : Pseudo<(outs), (ins GR16:$src1, i16imm:$src2), +// "cmp.w\t{$src1, $src2}", +// [(MSP430cmp GR16:$src1, imm:$src2), (implicit SRW)]>; + +//def CMP8mi : Pseudo<(outs), (ins memsrc:$src1, i8imm:$src2), +// "cmp.b\t{$src1, $src2}", +// [(MSP430cmp (load addr:$src1), (i8 imm:$src2)), (implicit SRW)]>; +//def CMP16mi : Pseudo<(outs), (ins memsrc:$src1, i16imm:$src2), +// "cmp.w\t{$src1, $src2}", +// [(MSP430cmp (load addr:$src1), (i16 imm:$src2)), (implicit SRW)]>; + + +// Imm 0, +1, +2, +4, +8 are encoded via constant generator registers. +// That's why we can use them as dest operands. +// We don't define new class for them, since they would need special encoding +// in the future. + +def CMP8ri0 : Pseudo<(outs), (ins GR8:$src1), + "cmp.b\t{$src1, #0}", + [(MSP430cmp GR8:$src1, 0), (implicit SRW)]>; +def CMP16ri0: Pseudo<(outs), (ins GR16:$src1), + "cmp.w\t{$src1, #0}", + [(MSP430cmp GR16:$src1, 0), (implicit SRW)]>; +def CMP8ri1 : Pseudo<(outs), (ins GR8:$src1), + "cmp.b\t{$src1, #1}", + [(MSP430cmp GR8:$src1, 1), (implicit SRW)]>; +def CMP16ri1: Pseudo<(outs), (ins GR16:$src1), + "cmp.w\t{$src1, #1}", + [(MSP430cmp GR16:$src1, 1), (implicit SRW)]>; +def CMP8ri2 : Pseudo<(outs), (ins GR8:$src1), + "cmp.b\t{$src1, #2}", + [(MSP430cmp GR8:$src1, 2), (implicit SRW)]>; +def CMP16ri2: Pseudo<(outs), (ins GR16:$src1), + "cmp.w\t{$src1, #2}", + [(MSP430cmp GR16:$src1, 2), (implicit SRW)]>; +def CMP8ri4 : Pseudo<(outs), (ins GR8:$src1), + "cmp.b\t{$src1, #4}", + [(MSP430cmp GR8:$src1, 4), (implicit SRW)]>; +def CMP16ri4: Pseudo<(outs), (ins GR16:$src1), + "cmp.w\t{$src1, #4}", + [(MSP430cmp GR16:$src1, 4), (implicit SRW)]>; +def CMP8ri8 : Pseudo<(outs), (ins GR8:$src1), + "cmp.b\t{$src1, #8}", + [(MSP430cmp GR8:$src1, 8), (implicit SRW)]>; +def CMP16ri8: Pseudo<(outs), (ins GR16:$src1), + "cmp.w\t{$src1, #8}", + [(MSP430cmp GR16:$src1, 8), (implicit SRW)]>; def CMP8rm : Pseudo<(outs), (ins GR8:$src1, memsrc:$src2), "cmp.b\t{$src1, $src2}", @@ -712,19 +758,37 @@ def CMP16mr : Pseudo<(outs), (ins memsrc:$src1, GR16:$src2), "cmp.w\t{$src1, $src2}", [(MSP430cmp (load addr:$src1), GR16:$src2), (implicit SRW)]>; -def CMP8mi : Pseudo<(outs), (ins memsrc:$src1, i8imm:$src2), - "cmp.b\t{$src1, $src2}", - [(MSP430cmp (load addr:$src1), (i8 imm:$src2)), (implicit SRW)]>; -def CMP16mi : Pseudo<(outs), (ins memsrc:$src1, i16imm:$src2), - "cmp.w\t{$src1, $src2}", - [(MSP430cmp (load addr:$src1), (i16 imm:$src2)), (implicit SRW)]>; +def CMP8mi0 : Pseudo<(outs), (ins memsrc:$src1), + "cmp.b\t{$src1, #0}", + [(MSP430cmp (load addr:$src1), (i8 0)), (implicit SRW)]>; +def CMP16mi0: Pseudo<(outs), (ins memsrc:$src1), + "cmp.w\t{$src1, #0}", + [(MSP430cmp (load addr:$src1), (i16 0)), (implicit SRW)]>; +def CMP8mi1 : Pseudo<(outs), (ins memsrc:$src1), + "cmp.b\t{$src1, #1}", + [(MSP430cmp (load addr:$src1), (i8 1)), (implicit SRW)]>; +def CMP16mi1: Pseudo<(outs), (ins memsrc:$src1), + "cmp.w\t{$src1, #1}", + [(MSP430cmp (load addr:$src1), (i16 1)), (implicit SRW)]>; +def CMP8mi2 : Pseudo<(outs), (ins memsrc:$src1), + "cmp.b\t{$src1, #2}", + [(MSP430cmp (load addr:$src1), (i8 2)), (implicit SRW)]>; +def CMP16mi2: Pseudo<(outs), (ins memsrc:$src1), + "cmp.w\t{$src1, #2}", + [(MSP430cmp (load addr:$src1), (i16 2)), (implicit SRW)]>; +def CMP8mi4 : Pseudo<(outs), (ins memsrc:$src1), + "cmp.b\t{$src1, #4}", + [(MSP430cmp (load addr:$src1), (i8 4)), (implicit SRW)]>; +def CMP16mi4: Pseudo<(outs), (ins memsrc:$src1), + "cmp.w\t{$src1, #4}", + [(MSP430cmp (load addr:$src1), (i16 4)), (implicit SRW)]>; +def CMP8mi8 : Pseudo<(outs), (ins memsrc:$src1), + "cmp.b\t{$src1, #8}", + [(MSP430cmp (load addr:$src1), (i8 8)), (implicit SRW)]>; +def CMP16mi8: Pseudo<(outs), (ins memsrc:$src1), + "cmp.w\t{$src1, #8}", + [(MSP430cmp (load addr:$src1), (i16 8)), (implicit SRW)]>; -def CMP8mm : Pseudo<(outs), (ins memsrc:$src1, memsrc:$src2), - "cmp.b\t{$src1, $src2}", - [(MSP430cmp (load addr:$src1), (i8 (load addr:$src2))), (implicit SRW)]>; -def CMP16mm : Pseudo<(outs), (ins memsrc:$src1, memsrc:$src2), - "cmp.w\t{$src1, $src2}", - [(MSP430cmp (load addr:$src1), (i16 (load addr:$src2))), (implicit SRW)]>; } // Defs = [SRW] //===----------------------------------------------------------------------===// |