mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-18 12:29:21 +00:00
catch constants more often
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30534 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0ddae493e9
commit
6b634037b3
@ -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