[Mesa-dev] [PATCH 01/10] i965: Add functions to convert float <-> VF.

Matt Turner mattst88 at gmail.com
Fri Oct 24 09:50:09 PDT 2014


On Fri, Oct 24, 2014 at 1:17 AM, Francisco Jerez <currojerez at riseup.net> wrote:
> Matt Turner <mattst88 at gmail.com> writes:
>> +float
>> +brw_vf_to_float(unsigned char vf)
>> +{
>> +   union fu fu;
>> +
>> +   /* ±0.0f is special cased. */
>> +   if (vf == 0x00 || vf == 0x80) {
>> +      fu.u = vf << 24;
>> +      return fu.f;
>> +   }
>
> No need to special-case 0, AFAICT this just repeats the same you're
> doing below.

It is necessary: otherwise brw_vf_to_float(±0.125f) would return a VF
matching ±0.0f.


More information about the mesa-dev mailing list