This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Sythetic registers: modrm/gas question.


> The question since it could almost certainly have been answered with a
> five-minute experiment (what, you don't have the necessary platform
> around?)

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.


> the synthregs proposal is argued for 
> at a much higher level than would require that close an examination
> of GCC's generated code

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. 


> Or are you good at simulating complex caches in your head based
> on disassembly listings and demand that we all are as well?

Well yes I am pretty good at it, but I definitely do NOT like to depend
on doing this, and I do NOT expect others to do it. What is needed are
some real examples so that we are NOT doing things in our head.

I certainly apologize if my answer seemed rude, but it was an attempt to
try to dig down into the details, since that is where the substance of
the argument will play out in a useful manner.

Actually I think the idea that the issue is in any sense related to the
operation of complex caches is completely bogus. In practice in typical
x86 code, nearly all EBP references with small offsets (references to
arguments or locals in the current stack frame) are in L1 cache. All our
data shows that, so if the idea of the SR proposal is somehow to improve
cache performance, that is unlikely to work out in practice. GCC already
does a pretty aggressive job of moving most references to the local
stack (either by referencing variables there, or spill locations).

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. 

The 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.

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]