[PATCH] use magic wl_fixed_t to/from double only on x86-64

Thiago Macieira thiago.macieira at intel.com
Wed May 16 12:32:12 PDT 2012


On quarta-feira, 16 de maio de 2012 11.20.03, Bill Spitzak wrote:
> Thiago Macieira wrote:
> > However, the div and mul are much more interesting. Those ought to be the
> > same, so I am actually wondering how it is possible that the div and mul
> > on
> > x86-64 can be so slow.
> 
> Divide by x and multiply by 1/x are not exactly the same because 1/x may
> not be exactly represented in the floating point format. So I think this
> is the reason the compiler is not producing the optimization. Though
> 1/256 can be represented exactly so it does not apply to this specific case.

Please note that it's the same code, same compiler, the difference is whether 
it's using x87 or SSE for the floating point math. Somehow, the x87 code is 
faster, which is counter-intuitive.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
     Intel Sweden AB - Registration Number: 556189-6027
     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20120516/12342f5a/attachment.pgp>


More information about the wayland-devel mailing list