Optimize mr. X, X
after some instructions.
For example, when ncg emits slw r9,r8,r5 mr. r9,r9 then top simplifies the code to slw. r9,r8,r5
This commit is contained in:
parent
c964eeddba
commit
5f2a7b260f
|
@ -348,7 +348,7 @@ INSTRUCTIONS
|
||||||
or GPR:wo, GPR:ro, GPR:ro.
|
or GPR:wo, GPR:ro, GPR:ro.
|
||||||
mr GPR:wo, GPR:ro.
|
mr GPR:wo, GPR:ro.
|
||||||
orX "or." GPR:wo:cc, GPR:ro, GPR:ro.
|
orX "or." GPR:wo:cc, GPR:ro, GPR:ro.
|
||||||
orX_readonly "or." GPR:ro:cc, GPR:ro, GPR:ro.
|
mrX_readonly "mr." GPR:ro:cc, GPR:ro.
|
||||||
orc GPR:wo, GPR:ro, GPR:ro.
|
orc GPR:wo, GPR:ro, GPR:ro.
|
||||||
ori GPR:wo, GPR:ro, CONST+LABEL_LO:ro.
|
ori GPR:wo, GPR:ro, CONST+LABEL_LO:ro.
|
||||||
oris GPR:wo, GPR:ro, CONST:ro.
|
oris GPR:wo, GPR:ro, CONST:ro.
|
||||||
|
@ -707,15 +707,12 @@ MOVES
|
||||||
|
|
||||||
TESTS
|
TESTS
|
||||||
|
|
||||||
/* Given orX %1, %1, %1, ncgg says, "Instruction destroys %1,
|
/* Given "mrX %1, %1", ncgg would say, "Instruction destroys
|
||||||
* not allowed here". We use orX_readonly to trick ncgg.
|
* %1, not allowed here". We use mrX_readonly to trick ncgg.
|
||||||
*
|
|
||||||
* Using "or." and not "mr." because mach/powerpc/top/table
|
|
||||||
* was optimizing "or." and not "mr.".
|
|
||||||
*/
|
*/
|
||||||
to test GPR
|
to test GPR
|
||||||
gen
|
gen
|
||||||
orX_readonly %1, %1, %1
|
mrX_readonly %1, %1
|
||||||
|
|
||||||
|
|
||||||
STACKINGRULES
|
STACKINGRULES
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
/* PowerPC desciptor table for ACK target optimizer */
|
/* PowerPC table for ACK target optimizer */
|
||||||
|
|
||||||
MAXOP 3;
|
MAXOP 3;
|
||||||
LABEL_STARTER '.';
|
LABEL_STARTER '.';
|
||||||
|
@ -16,10 +16,33 @@ X, Y, Z { TRUE };
|
||||||
addi RNZ, RNZ, 0 -> ;
|
addi RNZ, RNZ, 0 -> ;
|
||||||
addis RNZ, RNZ, 0 -> ;
|
addis RNZ, RNZ, 0 -> ;
|
||||||
|
|
||||||
|
or X, Y, Y -> mr X, Y ;
|
||||||
|
or. X, Y, Y -> mr. X, Y ;
|
||||||
|
|
||||||
mr X, X -> ;
|
mr X, X -> ;
|
||||||
fmr X, X -> ;
|
fmr X, X -> ;
|
||||||
|
|
||||||
or X, Y, Z : or. X, X, X -> or. X, Y, Z ;
|
add X, Y, Z : mr. X, X -> add. X, Y, Z ;
|
||||||
|
and X, Y, Z : mr. X, X -> and. X, Y, Z ;
|
||||||
|
andc X, Y, Z : mr. X, X -> andc. X, Y, Z ;
|
||||||
|
divw X, Y, Z : mr. X, X -> divw. X, Y, Z ;
|
||||||
|
divwu X, Y, Z : mr. X, X -> divwu. X, Y, Z ;
|
||||||
|
extsb X, Y, Z : mr. X, X -> extsb. X, Y, Z ;
|
||||||
|
extsh X, Y, Z : mr. X, X -> extsh. X, Y, Z ;
|
||||||
|
eqv X, Y, Z : mr. X, X -> eqv. X, Y, Z ;
|
||||||
|
mullw X, Y, Z : mr. X, X -> mullw. X, Y, Z ;
|
||||||
|
nand X, Y, Z : mr. X, X -> nand. X, Y, Z ;
|
||||||
|
nor X, Y, Z : mr. X, X -> nor. X, Y, Z ;
|
||||||
|
or X, Y, Z : mr. X, X -> or. X, Y, Z ;
|
||||||
|
orc X, Y, Z : mr. X, X -> orc. X, Y, Z ;
|
||||||
|
slw X, Y, Z : mr. X, X -> slw. X, Y, Z ;
|
||||||
|
slwi X, Y, Z : mr. X, X -> slwi. X, Y, Z ;
|
||||||
|
subf X, Y, Z : mr. X, X -> subf. X, Y, Z ;
|
||||||
|
sraw X, Y, Z : mr. X, X -> sraw. X, Y, Z ;
|
||||||
|
srawi X, Y, Z : mr. X, X -> srawi. X, Y, Z ;
|
||||||
|
srw X, Y, Z : mr. X, X -> srw. X, Y, Z ;
|
||||||
|
srwi X, Y, Z : mr. X, X -> srwi. X, Y, Z ;
|
||||||
|
xor X, Y, Z : mr. X, X -> xor. X, Y, Z ;
|
||||||
|
|
||||||
b X : labdef X -> labdef X ;
|
b X : labdef X -> labdef X ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue