pan/bit: Add framework forinterpreting double vs float
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 30 Apr 2020 21:31:38 +0000 (17:31 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 1 May 2020 00:27:23 +0000 (00:27 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4844>

src/panfrost/bifrost/test/bi_interpret.c

index eaa3327430cee01c7c048b28b5ead66a4d383619..f858b812d955fe05be3c4344d083b3078b9bd0e5 100644 (file)
@@ -140,18 +140,21 @@ bit_write(struct bit_state *s, unsigned index, nir_alu_type T, bit_t value, bool
         bint(bit_i64 ## name, bit_i32 ## name, bit_i16 ## name, bit_i8 ## name); \
         unreachable("Invalid type");
 
-#define bit_make_float(name, expr) \
+#define bit_make_float_2(name, expr32, expr64) \
         static inline double \
         bit_f64 ## name(double a, double b, double c, double d) \
         { \
-                return expr; \
+                return expr64; \
         } \
         static inline float \
         bit_f32 ## name(float a, float b, float c, float d) \
         { \
-                return expr; \
+                return expr32; \
         } \
 
+#define bit_make_float(name, expr) \
+        bit_make_float_2(name, expr, expr)
+
 #define bit_make_int(name, expr) \
         static inline int64_t \
         bit_i64 ## name (int64_t a, int64_t b, int64_t c, int64_t d) \