Am 14.06.2012 18:55, schrieb Paul Berry: > On 14 June 2012 09:02, Roland Scheidegger <srol...@vmware.com > <mailto:srol...@vmware.com>> wrote: > > Am 14.06.2012 15:07, schrieb Paul Berry: > > On 14 June 2012 05:10, Jose Fonseca <jfons...@vmware.com > <mailto:jfons...@vmware.com> > > <mailto:jfons...@vmware.com <mailto:jfons...@vmware.com>>> wrote: > > > > lp_build_utrunc() doesn't exists yet. For now, please use > > lp_build_itrunc() and add a /* FIXME: implement and use > > lp_build_utrunc() */ comment. It's not perfect, but it's no worse > > what's there now. > > > > Jose > > > > > > Ok, will do. Thank you. > btw I'm wondering how you'd actually do that in some semi-efficient > manner? > llvm has LLVMBuildFPToUI but x86 has no such conversion instructions > they are all signed. I guess multiply by 0.5, convert to signed int, > cast to unsigned and multiply by 2 isn't really the solution :-). > > > Playing around with gcc, it looks like it generally achieves > float->unsigned conversions by first converting to a 64-bit integer > (using the "fistpq" instruction on x86, or "cvttss2siq" on x86-64), then > truncating the upper 32 bits.
I guess that's a reasonable option (unless you'd need 64bit uints...). For vectorized llvm code though that option looks pretty bad. Roland _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev