Skip to content

Commit

Permalink
Remove IND_LABEL_W and IND_LABEL_D
Browse files Browse the repository at this point in the history
Because li32 always loads a label into a GPR, it is sufficient to
coerce LABEL to REG, then use IND_RC_W or IND_RC_D for indirection
through the label.
  • Loading branch information
kernigh committed Oct 16, 2016
1 parent 5b5f774 commit 19f0eb8
Showing 1 changed file with 4 additions and 53 deletions.
57 changes: 4 additions & 53 deletions mach/powerpc/ncg/table
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,8 @@ TOKENS
IND_RC_H_S = { GPR reg; INT off; } 4.
IND_RC_W = { GPR reg; INT off; } 4.
IND_RR_W = { GPR reg1; GPR reg2; } 4.
IND_LABEL_W = { ADDR adr; } 4.
IND_RC_D = { GPR reg; INT off; } 8.
IND_RR_D = { GPR reg1; GPR reg2; } 8.
IND_LABEL_D = { ADDR adr; } 8.

NOT_R = { GPR reg; } 4.

Expand Down Expand Up @@ -256,9 +254,9 @@ SETS
LOGICAL_ALL = NOT_R + AND_RR + OR_RR + OR_RC + XOR_RR +
XOR_RC.

IND_ALL_W = IND_RC_W + IND_RR_W + IND_LABEL_W.
IND_ALL_W = IND_RC_W + IND_RR_W.

IND_ALL_D = IND_RC_D + IND_RR_D + IND_LABEL_D.
IND_ALL_D = IND_RC_D + IND_RR_D.

OP_ALL_W = SUM_ALL + TRISTATE_ALL + SEX_ALL + LOGICAL_ALL +
IND_ALL_W.
Expand Down Expand Up @@ -462,12 +460,6 @@ MOVES
gen
COMMENT("move IND_RR_W->GPR")
lwzx %2, %1.reg1, %1.reg2

from IND_LABEL_W to GPR
gen
COMMENT("move IND_LABEL_W->GPR")
move {LABEL, %1.adr}, RSCRATCH
lwz %2, {GPRINDIRECT, RSCRATCH, 0}

from IND_RC_W to FSREG
gen
Expand All @@ -478,13 +470,7 @@ MOVES
gen
COMMENT("move IND_RR_W->FSREG")
lfsx %2, %1.reg1, %1.reg2

from IND_LABEL_W to FSREG
gen
COMMENT("move IND_LABEL_W->FSREG")
move {LABEL, %1.adr}, RSCRATCH
lfs %2, {GPRINDIRECT, RSCRATCH, 0}


/* Write word */

from GPR to IND_RC_W
Expand All @@ -496,12 +482,6 @@ MOVES
gen
COMMENT("move GPR->IND_RR_W")
stwx %1, %2.reg1, %2.reg2

from GPR to IND_LABEL_W
gen
COMMENT("move GPR->IND_LABEL_D")
move {LABEL, %2.adr}, RSCRATCH
stw %1, {GPRINDIRECT, RSCRATCH, 0}

from FSREG to IND_RC_W
gen
Expand All @@ -513,12 +493,6 @@ MOVES
COMMENT("move FSREG->IND_RR_W")
stfsx %1, %2.reg1, %2.reg2

from FSREG to IND_LABEL_W
gen
COMMENT("move FSREG->IND_LABEL_D")
move {LABEL, %2.adr}, RSCRATCH
stfs %1, {GPRINDIRECT, RSCRATCH, 0}

/* Read double */

from IND_RC_D to FPR
Expand All @@ -531,12 +505,6 @@ MOVES
COMMENT("move IND_RR_D->FPR")
lfdx %2, %1.reg1, %1.reg2

from IND_LABEL_D to FPR
gen
COMMENT("move IND_LABEL_D->FPR")
move {LABEL, %1.adr}, RSCRATCH
lfd %2, {GPRINDIRECT, RSCRATCH, 0}

/* Write double */

from FPR to IND_RC_D
Expand All @@ -548,13 +516,7 @@ MOVES
gen
COMMENT("move FPR->IND_RR_W")
stfdx %1, %2.reg1, %2.reg2

from FPR to IND_LABEL_D
gen
COMMENT("move FPR->IND_LABEL_D")
move {LABEL, %2.adr}, RSCRATCH
stfd %1, {GPRINDIRECT, RSCRATCH, 0}


/* Extract condition code field (actually produces (CC&3)<<2) */

from CR0 to GPR
Expand Down Expand Up @@ -1142,8 +1104,6 @@ PATTERNS
yields {IND_RC_W, %1.reg, %1.off}
with SUM_RR
yields {IND_RR_W, %1.reg1, %1.reg2}
with LABEL
yields {IND_LABEL_W, %1.adr}

pat loi $1==INT64 /* Load double-word indirect */
with GPR
Expand All @@ -1152,8 +1112,6 @@ PATTERNS
yields {IND_RC_D, %1.reg, %1.off}
with SUM_RR
yields {IND_RR_D, %1.reg1, %1.reg2}
with LABEL
yields {IND_LABEL_D, %1.adr}

pat loi /* Load arbitrary size */
leaving
Expand Down Expand Up @@ -1216,9 +1174,6 @@ PATTERNS
with SUM_RC GPR+FSREG
gen
move %2, {IND_RC_W, %1.reg, %1.off}
with LABEL GPR+FSREG
gen
move %2, {IND_LABEL_W, %1.adr}

pat sti $1==INT64 /* Store double-word indirect */
with GPR FREG
Expand All @@ -1238,10 +1193,6 @@ PATTERNS
gen
move %2, {IND_RC_W, %1.reg, %1.off}
move %3, {IND_RC_W, %1.reg, %1.off+4}
with LABEL FREG
gen
move %2, {IND_LABEL_D, %1.adr}


pat sti /* Store arbitrary size */
leaving
Expand Down

0 comments on commit 19f0eb8

Please sign in to comment.