Fix promotion of floats to doubles

Use the f variants of the math functions if the input parameter is a
float, saves converting from float to double and running the double
variant of the math function for gaining no precision at all

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3969>
This commit is contained in:
Albert Astals Cid
2020-02-26 23:05:51 +01:00
committed by Albert Astals Cid
parent 94cb129d51
commit 06c5875fd6
12 changed files with 34 additions and 34 deletions
+1 -1
View File
@@ -245,7 +245,7 @@ gen_diff_l3_weights(struct gen_l3_weights w0, struct gen_l3_weights w1)
float dw = 0;
for (unsigned i = 0; i < GEN_NUM_L3P; i++)
dw += fabs(w0.w[i] - w1.w[i]);
dw += fabsf(w0.w[i] - w1.w[i]);
return dw;
}