From 8ab0bf1f939af480997fafd8bf562644a60df08a Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 13 Feb 2020 17:14:05 -0500 Subject: [PATCH] pan/midgard: Use fprintf instead of printf for constants I was wondering where those constants disappeared to :-) Signed-off-by: Alyssa Rosenzweig Fixes: 968f36d1fc0 ("pan/midgard: Support disassembling to a file") Part-of: --- src/panfrost/midgard/midgard_print.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/panfrost/midgard/midgard_print.c b/src/panfrost/midgard/midgard_print.c index 94a0f1a6453..e23e7d59817 100644 --- a/src/panfrost/midgard/midgard_print.c +++ b/src/panfrost/midgard/midgard_print.c @@ -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; -- 2.30.2