mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-23 12:08:25 +00:00
catch constants more often
llvm-svn: 30534
This commit is contained in:
parent
054efcd85d
commit
d12f2d614a
@ -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>;
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user