[Info-vax] problem with 64-bit pointers in C

John Reagan xyzzy1959 at gmail.com
Tue Feb 13 16:37:26 EST 2018


On Tuesday, February 13, 2018 at 3:36:53 PM UTC-5, yuhong... at hotmail.com wrote:
> On Monday, February 12, 2018 at 2:05:37 PM UTC-8, John Reagan wrote:
> > On Monday, February 12, 2018 at 4:46:19 PM UTC-5, Stephen Hoffman wrote:
> > 
> > > 
> > > Worth mentioning... why?   There were code-size increases going from 
> > > VAX to Alpha.  From Alpha to i64, too.  And it wouldn't surprise me to 
> > > see code size changes between Itanium and x86.  
> > 
> > Here's a purely unscientific, unsupported, non-commital, no promises, your mileage may vary, swag.
> > 
> > I picked a C module from inside the mostly target-independent part of the Macro compiler itself.  
> > 
> > On Alpha, ~127,000 bytes of code, optimized
> > On Itanium, ~250,000 bytes of code, optimized
> > On x86, ~159,000 bytes of untested code, NOOPTIMIZE
> > 
> > The code uses 32-bit pointers but there are lots of REX prefixes since LLVM is using the full x64-64 register set (16 64-bit general purpose registers). I'm not sure going to 64-pointers would make all that much difference in REX prefix count (it would increase the size of all the data structures with embedded pointers)
> 
> Good point. If you do need 64-bit values you might as well use the extra registers anyway. And I assumes that the 64-bit option was there even in Alpha.

Running in 64-bit mode gives you the %RIP-based addressing modes.  Those are really helpful.  Not to mention passing arguments in registers instead of the stack.

Yes, /POINTER_SIZE=64 is there on Alpha.  Mostly just turned the LDL instructions into LDQ instructions when loading the pointer from memory into a register.  The load instructions themselves always want a 64-bit pointer as an address.  It is only whether the result is sign-extended or not when placed into the destination register.



More information about the Info-vax mailing list