small improvement: added pattern for LDC -1 CMS 4 ZEQ/ZNE

This commit is contained in:
ceriel 1989-10-18 10:15:49 +00:00
parent cf65fbe6a1
commit 95563ae3bc

View file

@ -222,6 +222,7 @@ jmp label cost(1,7).
joehoe "call" label+rm cost(1,8). joehoe "call" label+rm cost(1,8).
jxx "syntax error" label. jxx "syntax error" label.
lea anyreg:wo, halfindir:ro cost(1,2). lea anyreg:wo, halfindir:ro cost(1,2).
lea LOCAL:wo, halfindir:ro cost(1,2). /* only for register variables, UNSAFE!!! */
loop label kills cx cost(1,5). loop label kills cx cost(1,5).
#ifdef REGVARS #ifdef REGVARS
mov LOCAL:wo, memory2:ro cost(1,2). /* only for register variables, UNSAFE!!! */ mov LOCAL:wo, memory2:ro cost(1,2). /* only for register variables, UNSAFE!!! */
@ -286,6 +287,9 @@ MOVES
#ifdef REGVARS #ifdef REGVARS
from memory2 to LOCAL /* unsafe !!! */ from memory2 to LOCAL /* unsafe !!! */
gen mov %2,%1 gen mov %2,%1
from halfindir to LOCAL /* unsafe !!! */
gen lea %2,%1
#endif #endif
from rm to register from rm to register
@ -623,6 +627,9 @@ pat stl inreg($1)==reg_any
with rmorconst with rmorconst
kills regvar($1) kills regvar($1)
gen move %1, {LOCAL,$1,2} gen move %1, {LOCAL,$1,2}
with halfindir
kills regvar($1)
gen move %1, {LOCAL,$1,2}
with exact STACK with exact STACK
kills regvar($1) kills regvar($1)
gen pop {LOCAL, $1, 2} gen pop {LOCAL, $1, 2}
@ -1792,6 +1799,11 @@ pat loc loc cii loc and zne $4<256 && $4>=0 && $5==2 && $1==1 && $2==2
pat loc loc cii $1==1 && $2==2 pat loc loc cii $1==1 && $2==2
with ACC with ACC
gen cbw. yields ax gen cbw. yields ax
with exact rmorconst1 ACC
uses REG
gen move %2,%a
move %1,%2.1
cbw. yields %a ax
with exact rmorconst1 with exact rmorconst1
uses reusing %1, ACC1=%1 uses reusing %1, ACC1=%1
gen cbw. yields ax gen cbw. yields ax
@ -2371,6 +2383,26 @@ with REG rmorconst STACK
gen or %1,%2 gen or %1,%2
jne {label,$3} jne {label,$3}
pat ldc cms zeq $2==4 && loww($1)==65535 && highw($1)==(0-1)
with rmorconst REG STACK
gen and %2,%1
cmp %2,{ANYCON,0-1}
je {label,$3}
with REG rmorconst STACK
gen and %1,%2
cmp %1,{ANYCON,0-1}
je {label,$3}
pat ldc cms zne $2==4 && loww($1)==65535 && highw($1)==(0-1)
with rmorconst REG STACK
gen and %2,%1
cmp %2,{ANYCON,0-1}
jne {label,$3}
with REG rmorconst STACK
gen and %1,%2
cmp %1,{ANYCON,0-1}
jne {label,$3}
pat ldc cms zeq $2==4 pat ldc cms zeq $2==4
with rm rm STACK with rm rm STACK
gen cmp %1, {ANYCON, loww($1)} gen cmp %1, {ANYCON, loww($1)}