pan/midgard: Use fprintf instead of printf for constants
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 13 Feb 2020 22:14:05 +0000 (17:14 -0500)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Sun, 16 Feb 2020 14:16:50 +0000 (09:16 -0500)
I was wondering where those constants disappeared to :-)

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes: 968f36d1fc0 ("pan/midgard: Support disassembling to a file")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3835>

src/panfrost/midgard/midgard_print.c

index 94a0f1a6453a4667be94d753393a8fb2be600a5d..e23e7d59817d675288c68bec1c89bfe90cf2e690 100644 (file)
@@ -138,11 +138,11 @@ mir_print_constant_component(FILE *fp, const midgard_constants *consts, unsigned
         switch (reg_mode) {
         case midgard_reg_mode_64:
                 if (is_sint) {
-                        printf("%"PRIi64, consts->i64[c]);
+                        fprintf(fp, "%"PRIi64, consts->i64[c]);
                 } else if (is_uint) {
-                        printf("%"PRIu64, consts->u64[c]);
+                        fprintf(fp, "%"PRIu64, consts->u64[c]);
                 } else if (is_hex) {
-                        printf("0x%"PRIX64, consts->u64[c]);
+                        fprintf(fp, "0x%"PRIX64, consts->u64[c]);
                 } else {
                         double v = consts->f64[c];
 
@@ -164,7 +164,7 @@ mir_print_constant_component(FILE *fp, const midgard_constants *consts, unsigned
                         else
                                 v = consts->i32[c];
 
-                        printf("%"PRIi64, v);
+                        fprintf(fp, "%"PRIi64, v);
                 } else if (is_uint || is_hex) {
                         uint64_t v;
 
@@ -173,14 +173,14 @@ mir_print_constant_component(FILE *fp, const midgard_constants *consts, unsigned
                         else
                                 v = consts->u32[c];
 
-                        printf(is_uint ? "%"PRIu64 : "0x%"PRIX64, v);
+                        fprintf(fp, is_uint ? "%"PRIu64 : "0x%"PRIX64, v);
                 } else {
                         float v = consts->f32[c];
 
                         if (mod & MIDGARD_FLOAT_MOD_ABS) v = fabsf(v);
                         if (mod & MIDGARD_FLOAT_MOD_NEG) v = -v;
 
-                        printf("%g", v);
+                        fprintf(fp, "%g", v);
                 }
                 break;
 
@@ -195,7 +195,7 @@ mir_print_constant_component(FILE *fp, const midgard_constants *consts, unsigned
                         else
                                 v = consts->i16[c];
 
-                        printf("%d", v);
+                        fprintf(fp, "%d", v);
                 } else if (is_uint || is_hex) {
                         uint32_t v;
 
@@ -204,14 +204,14 @@ mir_print_constant_component(FILE *fp, const midgard_constants *consts, unsigned
                         else
                                 v = consts->u16[c];
 
-                        printf(is_uint ? "%u" : "0x%X", v);
+                        fprintf(fp, is_uint ? "%u" : "0x%X", v);
                 } else {
                         float v = _mesa_half_to_float(consts->f16[c]);
 
                         if (mod & MIDGARD_FLOAT_MOD_ABS) v = fabsf(v);
                         if (mod & MIDGARD_FLOAT_MOD_NEG) v = -v;
 
-                        printf("%g", v);
+                        fprintf(fp, "%g", v);
                 }
                 break;