Patch: IA64 inline integer division

Richard Henderson rth@redhat.com
Tue Mar 9 23:41:00 GMT 2004


On Tue, Mar 09, 2004 at 03:15:55PM -0800, Steve Ellcey wrote:
> OK, after pushing some bits around to figure out the exact difference,
> I see that the constant used in the libgcc version (that works) is
> -(2^-34) and the constant used in the inline version (broken) uses
> +(2^-34).  Otherwise the two algorithms look identical.

Ok, that makes sense.  Patch approved if you update the comment
to reflect the proper sign.

> You're right.  I hadn't thought about the more general case but a 'load
> immediate' into a general register followed by a setf into a floating
> point register is probably always going to be faster then a load from
> memory.  That seems to be what the HP compiler does.  I'll look into
> this some more.

Something I thought might work well (in that it doesn't completely
obfuscate the rtl, such that optimizers are happy), is to create an
HFmode floating point format which consists of just exponent and sign.

You then need two more things, to make compress_float_constant dtrt:

  * Constants of this mode should be LEGITIMATE_CONSTANT_P.
  * Create extendhf[sdx]f2 expanders that accept these constants in
    operand 1.  Internally, the expander can force the constant into
    a register, but can't require that the caller do so.


r~



More information about the Gcc-patches mailing list