Re: Range of 32 bit values
Re: Range of 32 bit values
- Subject: Re: Range of 32 bit values
- From: Greg Guerin <email@hidden>
- Date: Mon, 9 Apr 2007 15:07:49 -0700
Ben Weiss wrote:
>You could try dicing up the floating-point format by hand using integer
>instructions. The float format is 1:8:23, with a bias of 127, so you'd have
>something like this (which should handle denormal/ infinity values as well,
>since you want them all to produce 0 output):
There is a point of negative returns. If the number of clocks consumed by
a series of integer ops exceeds the number of clocks for a simpler floating
op, then the integer ops intended to be an optimization are no longer an
optimization. They actually slow the calculation, rather than speeding it
up.
The threshold for negative returns depends on the hardware. It even
depends on the specific CPU model, not just gross distinctions like PPC vs.
x86. That is, different PPC CPUs have different speeds for integer and
floating ops, as do different models of x86 CPUs.
If I had to figure this one out, I'd write different versions, measure
them, and then see what kind of variation there was across different CPUs
and models. I strongly doubt that one single optimization trick will
always be fastest across all target platforms, except when the target
platform itself is restricted. In that case, I'd still write different
versions and measure them, rather than assuming that some trick would
necessarily be fastest, just because it used to be fastest at another place
and time.
-- GG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden