Port-sparc64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Code models on sparc v9

On Sat, Aug 15, 2009 at 12:29:03PM +0100, raymond.meyer%rambler.ru@localhost 
> So a few questions,
> Why implement different code models, is it mainly to reduce the number
> of instructions when loading address constants into a register? Is that
> the only difference between them?

It is all about avoiding expensive code sequences for 64 bit constants.
32 bit immediates are 2 instructions (as on sparc32), 44 bit are
probably 3 (pc relative loads might be used - but they are cache-inefficient).

> Why is that in all code models, code size must be less than 2
> gigabytes?

Because the call and unconditional branch instructions have 32bit offset
(after allowing for code alignment).

> Are there any large applications that might need more than 2 gigabytes?
Possibly, but since the additional code can be in a separate shared
library it isn't a problem.

> When would you use abs64 code model, as opposed to abs44 or abs32?
If your OS might map code above 2^44.

(FYI: The kernel has all the -ve addresses)


David Laight: david%l8s.co.uk@localhost

Home | Main Index | Thread Index | Old Index