pan/midgard: Use fprintf instead of printf for constants
I was wondering where those constants disappeared to :-)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes: 968f36d1fc
("pan/midgard: Support disassembling to a file")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3835>
This commit is contained in:
parent
6af14d3685
commit
8ab0bf1f93
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue