* reg-stack.c potpourri
@ 2006-01-28 1:59 Lucas (a.k.a T-Bird or bsdfan3)
2006-01-29 4:14 ` Ian Lance Taylor
0 siblings, 1 reply; 2+ messages in thread
From: Lucas (a.k.a T-Bird or bsdfan3) @ 2006-01-28 1:59 UTC (permalink / raw)
To: gcc
1) What would need to be done to reg-stack.c to allow other ports
besides i386 to use it? (support for multiple-stack machines would be
REALLY nice, but rather far off) (any other ideas?)
2) I found a minor bug in the header comment for reg-stack.c -- when
whoever wrote the comment documented "push" insns, they said SET_DEST
was two things at the same time and never said what SET_SRC was! Is the
SET_DEST supposed to be FIRST_STACK_REG, or a plain REG or MEM?
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: reg-stack.c potpourri
2006-01-28 1:59 reg-stack.c potpourri Lucas (a.k.a T-Bird or bsdfan3)
@ 2006-01-29 4:14 ` Ian Lance Taylor
0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2006-01-29 4:14 UTC (permalink / raw)
To: Lucas (a.k.a T-Bird or bsdfan3); +Cc: gcc
"Lucas \(a.k.a T-Bird or bsdfan3\)" <tbird-contact@cox.net> writes:
> 1) What would need to be done to reg-stack.c to allow other ports
> besides i386 to use it? (support for multiple-stack machines would be
> REALLY nice, but rather far off) (any other ideas?)
reg-stack.c is pretty closed tied to the x87 FP instructions used on
IA32. It has specific knowledge of which instructions use which slots
on the stack, e.g., in subst_stack_regs_pat.
More seriously, I don't think the general approach of treating every
stack slot as a hard register and then turning that into stack
manipulation is going to give you optimal code. If you are compiling
for a stack machine, I would think that you should select instructions
and allocate registers with the stack architecture in mind.
But if you are committed to using gcc, then using something along the
lines of reg-stack.c may be your best bet.
> 2) I found a minor bug in the header comment for reg-stack.c -- when
> whoever wrote the comment documented "push" insns, they said SET_DEST
> was two things at the same time and never said what SET_SRC was! Is
> the SET_DEST supposed to be FIRST_STACK_REG, or a plain REG or MEM?
It should read:
A "push" or "load" insn is a SET whose SET_DEST is FIRST_STACK_REG
and whose SET_SRC is REG or MEM.
Ian
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-01-29 2:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-28 1:59 reg-stack.c potpourri Lucas (a.k.a T-Bird or bsdfan3)
2006-01-29 4:14 ` Ian Lance Taylor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).