[Mesa-dev] [PATCH 06/13] gallium/auxiliary: Avoid double promotion.

Roland Scheidegger sroland at vmware.com
Tue Jul 14 06:10:45 PDT 2015


gallium is already using fabsf in lots of other places. Supported by
older msvc versions.

Roland

Am 14.07.2015 um 11:50 schrieb Iago Toral:
> This one will need wrapping for fabsf.
> 
> Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>
> 
> On Mon, 2015-07-13 at 16:22 -0700, Matt Turner wrote:
>> ---
>>  src/gallium/auxiliary/util/u_format_rgb9e5.h | 2 +-
>>  src/gallium/auxiliary/util/u_math.h          | 2 +-
>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/gallium/auxiliary/util/u_format_rgb9e5.h b/src/gallium/auxiliary/util/u_format_rgb9e5.h
>> index 7a01f7f..d1ace3f 100644
>> --- a/src/gallium/auxiliary/util/u_format_rgb9e5.h
>> +++ b/src/gallium/auxiliary/util/u_format_rgb9e5.h
>> @@ -75,7 +75,7 @@ typedef union {
>>  
>>  static INLINE float rgb9e5_ClampRange(float x)
>>  {
>> -   if (x > 0.0) {
>> +   if (x > 0.0f) {
>>        if (x >= MAX_RGB9E5) {
>>           return MAX_RGB9E5;
>>        } else {
>> diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h
>> index 3b4040f..9c3cb6a 100644
>> --- a/src/gallium/auxiliary/util/u_math.h
>> +++ b/src/gallium/auxiliary/util/u_math.h
>> @@ -240,7 +240,7 @@ util_iround(float f)
>>  static INLINE boolean
>>  util_is_approx(float a, float b, float tol)
>>  {
>> -   return fabs(b - a) <= tol;
>> +   return fabsf(b - a) <= tol;
>>  }
>>  
>>
> 
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 



More information about the mesa-dev mailing list