This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Sythetic registers: modrm/gas question.
- From: Tom Lord <lord at emf dot net>
- To: dewar at gnat dot com
- Cc: dewar at gnat dot com, gcc at gcc dot gnu dot org, ja_walker at earthlink dot net
- Date: Sun, 5 Jan 2003 05:51:33 -0800 (PST)
- Subject: Re: Sythetic registers: modrm/gas question.
- References: <20030105131257.941B4F2D5D@nile.gnat.com>
It's a little more fundamental than that. It is central to the
design of the x86 that the variable length offsets are
optimized by the assembler.
Well, duh .... but synthregs are not about that. It was a separate
question (unless ja_walker is a right-twice-a-day broken clock here).
And that's the problem, It is being argued at too high a
level, and creates the impression of some principle that in
fact I do not believe will show up as improved code. You *DO*
need to examine GCC's generated code to realize that the code
we generate today is essentially equivalent to the idea of
SR's.
It's _not_ equivalent. Looking at just the instruction sequences and
ignoring cache considerations -- synthregs are almost certainly
slightly worse.
Synthregs improve locality at a slight cost in code size. I agree
with ja_walker that the worthiness of that trade-off is an emprical
question worth measuring. I'd go beyond him by saying that in the
medium term future, the trade-off almost certainly wins often.
Remember that the code you get for accessing a synthetic
register is identical *in all respects* to the code you get for
accessing local variables and arguments.
Great. And synthregs can put _more_ of the values in a computation
into that access class.
The [stupid gas] question here seemed to imply that the
fundamental idea behind the SR proposal was to take advantage of
the 3-byte MODRM format for efficient access to SR's, coupled
with a belief that GCC was using a 6-byte MODRM format for normal
memory references. If that were true it would have some interest,
but it is simply not true.
Nah, it doesn't imply that at all. If _that_ were ja_walker's
concern, then instead of a synthreg proposal, he'd have made a
proposal to "fix gas" (making it what it already is). Best available
evidence is that he isn't that clueless.
You really HAVE to look at specific x86 assembly language
sequences to see whether there is anything in this idea or
not. Yes, there are some machines on which the idea might play
out effectively, but I am pretyt convinced that the x86 is not
one of them.
x86 is a "rapidly" exploding range of physical architectures. I think
your statement is too sweeping, but I do get the impression you've
studied a subset of those physical architectures in excruciating
detail (hat's off). (Please don't miss the point of the compliment
and reply that "Yeah, well, until you've done the same you've no
business talking about the SR proposal" --- that'll get (even more)
tiresome real quick, I promise. ;-)
-t