cube_face_coord: Use fabsf instead of fabs since we know it's floats
authorAlbert Astals Cid <aacid@kde.org>
Mon, 24 Feb 2020 23:36:44 +0000 (00:36 +0100)
committerMarge Bot <eric+marge@anholt.net>
Wed, 26 Feb 2020 21:47:01 +0000 (21:47 +0000)
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3933>

src/compiler/nir/nir_opcodes.py

index f83b8300d1852c577911b3de9da31a969c133bae..9e335445a3142f9b2ddb4077b6ffdb0ebb2d46f8 100644 (file)
@@ -467,9 +467,9 @@ for i in range(1, 5):
 # AMD_gcn_shader extended instructions
 unop_horiz("cube_face_coord", 2, tfloat32, 3, tfloat32, """
 dst.x = dst.y = 0.0;
-float absX = fabs(src0.x);
-float absY = fabs(src0.y);
-float absZ = fabs(src0.z);
+float absX = fabsf(src0.x);
+float absY = fabsf(src0.y);
+float absZ = fabsf(src0.z);
 
 float ma = 0.0;
 if (absX >= absY && absX >= absZ) { ma = 2 * src0.x; }