Remove the "invalid" stacking rule.
When ncg fell back on this rule, it did emit the string "invalid" in the assembly code and caused a syntax error in the assembler. Adjust the stacking rules so we can stack LOCAL, CONST, and LABEL without falling back on the "invalid" rule, and so we can stack them when we have no free register except the scratch register.
This commit is contained in:
parent
865ef629dd
commit
1e3dde915a
|
@ -233,7 +233,6 @@ TOKENS
|
||||||
|
|
||||||
SETS
|
SETS
|
||||||
|
|
||||||
TOKEN = LABEL + CONST + LOCAL.
|
|
||||||
GPRI = GPR + GPRE.
|
GPRI = GPR + GPRE.
|
||||||
|
|
||||||
SUM_ALL = SUM_RC + SUM_RR.
|
SUM_ALL = SUM_RC + SUM_RR.
|
||||||
|
@ -349,7 +348,6 @@ INSTRUCTIONS
|
||||||
gpr_wo_gprindirect GPRI:wo, GPRINDIRECT:ro.
|
gpr_wo_gprindirect GPRI:wo, GPRINDIRECT:ro.
|
||||||
gpr_wo_gpr_gpr GPRI:wo, GPRI:ro, GPRI:ro.
|
gpr_wo_gpr_gpr GPRI:wo, GPRI:ro, GPRI:ro.
|
||||||
|
|
||||||
invalid "invalid".
|
|
||||||
comment "!" LABEL+LABELI:ro.
|
comment "!" LABEL+LABELI:ro.
|
||||||
|
|
||||||
|
|
||||||
|
@ -754,24 +752,27 @@ TESTS
|
||||||
|
|
||||||
STACKINGRULES
|
STACKINGRULES
|
||||||
|
|
||||||
|
from LOCAL to STACK
|
||||||
|
gen
|
||||||
|
COMMENT("stack LOCAL")
|
||||||
|
stwu {GPRE, regvar(%1.off)}, {GPRINDIRECT, SP, 0-4}
|
||||||
|
|
||||||
from GPR to STACK
|
from GPR to STACK
|
||||||
gen
|
gen
|
||||||
COMMENT("stack GPR")
|
COMMENT("stack GPR")
|
||||||
stwu %1, {GPRINDIRECT, SP, 0-4}
|
stwu %1, {GPRINDIRECT, SP, 0-4}
|
||||||
|
|
||||||
from CONST to STACK
|
from CONST to STACK
|
||||||
uses REG
|
|
||||||
gen
|
gen
|
||||||
COMMENT("stack CONST")
|
COMMENT("stack CONST")
|
||||||
move %1, %a
|
move %1, SCRATCH
|
||||||
stwu %a, {GPRINDIRECT, SP, 0-4}
|
stwu SCRATCH, {GPRINDIRECT, SP, 0-4}
|
||||||
|
|
||||||
from LABEL to STACK
|
from LABEL to STACK
|
||||||
uses REG
|
|
||||||
gen
|
gen
|
||||||
COMMENT("stack LABEL")
|
COMMENT("stack LABEL")
|
||||||
move %1, {GPRE, %a}
|
move %1, SCRATCH
|
||||||
stwu %a, {GPRINDIRECT, SP, 0-4}
|
stwu SCRATCH, {GPRINDIRECT, SP, 0-4}
|
||||||
|
|
||||||
from SEX_B to STACK
|
from SEX_B to STACK
|
||||||
gen
|
gen
|
||||||
|
@ -810,10 +811,6 @@ STACKINGRULES
|
||||||
COMMENT("stack FSREG")
|
COMMENT("stack FSREG")
|
||||||
stfsu %1, {GPRINDIRECT, SP, 0-4}
|
stfsu %1, {GPRINDIRECT, SP, 0-4}
|
||||||
|
|
||||||
from TOKEN to STACK
|
|
||||||
gen
|
|
||||||
invalid.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
COERCIONS
|
COERCIONS
|
||||||
|
|
Loading…
Reference in a new issue