From 6b634037b3bc4d0cf48b2e4760b82c08f2898aa6 Mon Sep 17 00:00:00 2001 From: Andrew Lenharth Date: Wed, 20 Sep 2006 15:05:49 +0000 Subject: [PATCH] catch constants more often git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30534 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Alpha/AlphaInstrInfo.td | 14 ++++++++++++++ lib/Target/Alpha/README.txt | 16 ---------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/lib/Target/Alpha/AlphaInstrInfo.td b/lib/Target/Alpha/AlphaInstrInfo.td index be0d497f7e2..ceac0562d1b 100644 --- a/lib/Target/Alpha/AlphaInstrInfo.td +++ b/lib/Target/Alpha/AlphaInstrInfo.td @@ -214,6 +214,20 @@ def : Pat<(select GPRC:$which, GPRC:$src1, GPRC:$src2), def : Pat<(select GPRC:$which, GPRC:$src1, immUExt8:$src2), (CMOVEQi GPRC:$src1, immUExt8:$src2, GPRC:$which)>; +//Invert sense when we can for constants: +def : Pat<(select (seteq GPRC:$RCOND, 0), immUExt8:$RFALSE, GPRC:$RTRUE), + (CMOVEQi GPRC:$RTRUE, immUExt8:$RFALSE, GPRC:$RCOND)>; +def : Pat<(select (setne GPRC:$RCOND, 0), immUExt8:$RFALSE, GPRC:$RTRUE), + (CMOVNEi GPRC:$RTRUE, immUExt8:$RFALSE, GPRC:$RCOND)>; +def : Pat<(select (setgt GPRC:$RCOND, 0), immUExt8:$RFALSE, GPRC:$RTRUE), + (CMOVGTi GPRC:$RTRUE, immUExt8:$RFALSE, GPRC:$RCOND)>; +def : Pat<(select (setge GPRC:$RCOND, 0), immUExt8:$RFALSE, GPRC:$RTRUE), + (CMOVGEi GPRC:$RTRUE, immUExt8:$RFALSE, GPRC:$RCOND)>; +def : Pat<(select (setlt GPRC:$RCOND, 0), immUExt8:$RFALSE, GPRC:$RTRUE), + (CMOVLTi GPRC:$RTRUE, immUExt8:$RFALSE, GPRC:$RCOND)>; +def : Pat<(select (setle GPRC:$RCOND, 0), immUExt8:$RFALSE, GPRC:$RTRUE), + (CMOVLEi GPRC:$RTRUE, immUExt8:$RFALSE, GPRC:$RCOND)>; + def ADDL : OForm< 0x10, 0x00, "addl $RA,$RB,$RC", [(set GPRC:$RC, (intop (add GPRC:$RA, GPRC:$RB)))], s_iadd>; diff --git a/lib/Target/Alpha/README.txt b/lib/Target/Alpha/README.txt index ed5424726a7..2d1909a42c5 100644 --- a/lib/Target/Alpha/README.txt +++ b/lib/Target/Alpha/README.txt @@ -1,19 +1,3 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -Fix cmovs with a constant on the wrong side - -aka: - lda $0,10($31) - cmovlt $17,$0,$16 - -is bad for: - -long %cmov_lt2(long %a, long %c) { -entry: - %tmp.1 = setlt long %c, 0 - %retval = select bool %tmp.1, long 10, long %a - ret long %retval -} - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Fix Ordered/Unordered FP stuff -- 2.34.1