Commit 5af50159 by Kito Cheng Committed by Chung-Ju Wu

[NDS32] Use HOST_WIDE_INT_PRINT_DEC instead of %ld or %d.

gcc/
	* config/nds32/nds32.c (nds32_asm_output_mi_thunk,
	nds32_print_operand, nds32_print_operand_address): Use
	HOST_WIDE_INT_PRINT_DEC instead.

From-SVN: r258620
parent 6a5a7ee3
2018-03-17 Kito Cheng <kito.cheng@gmail.com>
* config/nds32/nds32.c (nds32_asm_output_mi_thunk,
nds32_print_operand, nds32_print_operand_address): Use
HOST_WIDE_INT_PRINT_DEC instead.
2018-03-17 Chung-Ju Wu <jasonwucj@gmail.com> 2018-03-17 Chung-Ju Wu <jasonwucj@gmail.com>
* config/nds32/nds32.c (nds32_register_priority): Modify cost. * config/nds32/nds32.c (nds32_register_priority): Modify cost.
......
...@@ -1689,18 +1689,22 @@ nds32_asm_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, ...@@ -1689,18 +1689,22 @@ nds32_asm_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
{ {
if (satisfies_constraint_Is15 (GEN_INT (delta))) if (satisfies_constraint_Is15 (GEN_INT (delta)))
{ {
fprintf (file, "\taddi\t$r%d, $r%d, %ld\n", fprintf (file, "\taddi\t$r%d, $r%d, " HOST_WIDE_INT_PRINT_DEC "\n",
this_regno, this_regno, delta); this_regno, this_regno, delta);
} }
else if (satisfies_constraint_Is20 (GEN_INT (delta))) else if (satisfies_constraint_Is20 (GEN_INT (delta)))
{ {
fprintf (file, "\tmovi\t$ta, %ld\n", delta); fprintf (file, "\tmovi\t$ta, " HOST_WIDE_INT_PRINT_DEC "\n", delta);
fprintf (file, "\tadd\t$r%d, $r%d, $ta\n", this_regno, this_regno); fprintf (file, "\tadd\t$r%d, $r%d, $ta\n", this_regno, this_regno);
} }
else else
{ {
fprintf (file, "\tsethi\t$ta, hi20(%ld)\n", delta); fprintf (file,
fprintf (file, "\tori\t$ta, $ta, lo12(%ld)\n", delta); "\tsethi\t$ta, hi20(" HOST_WIDE_INT_PRINT_DEC ")\n",
delta);
fprintf (file,
"\tori\t$ta, $ta, lo12(" HOST_WIDE_INT_PRINT_DEC ")\n",
delta);
fprintf (file, "\tadd\t$r%d, $r%d, $ta\n", this_regno, this_regno); fprintf (file, "\tadd\t$r%d, $r%d, $ta\n", this_regno, this_regno);
} }
} }
...@@ -2318,7 +2322,7 @@ nds32_print_operand (FILE *stream, rtx x, int code) ...@@ -2318,7 +2322,7 @@ nds32_print_operand (FILE *stream, rtx x, int code)
{ {
/* If user gives integer value directly (0~1023), /* If user gives integer value directly (0~1023),
we just print out the value. */ we just print out the value. */
fprintf (stream, "%d", op_value); fprintf (stream, HOST_WIDE_INT_PRINT_DEC, op_value);
} }
else if (op_value < 0 else if (op_value < 0
|| op_value >= ((int) ARRAY_SIZE (nds32_intrinsic_register_names) || op_value >= ((int) ARRAY_SIZE (nds32_intrinsic_register_names)
...@@ -2429,8 +2433,8 @@ nds32_print_operand_address (FILE *stream, machine_mode /*mode*/, rtx x) ...@@ -2429,8 +2433,8 @@ nds32_print_operand_address (FILE *stream, machine_mode /*mode*/, rtx x)
if (REG_P (op0) && CONST_INT_P (op1)) if (REG_P (op0) && CONST_INT_P (op1))
{ {
/* [Ra + imm] */ /* [Ra + imm] */
fprintf (stream, "[%s + (%d)]", fprintf (stream, "[%s + (" HOST_WIDE_INT_PRINT_DEC ")]",
reg_names[REGNO (op0)], (int)INTVAL (op1)); reg_names[REGNO (op0)], INTVAL (op1));
} }
else if (REG_P (op0) && REG_P (op1)) else if (REG_P (op0) && REG_P (op1))
{ {
...@@ -2501,8 +2505,8 @@ nds32_print_operand_address (FILE *stream, machine_mode /*mode*/, rtx x) ...@@ -2501,8 +2505,8 @@ nds32_print_operand_address (FILE *stream, machine_mode /*mode*/, rtx x)
else if (REG_P (op0) && CONST_INT_P (op1)) else if (REG_P (op0) && CONST_INT_P (op1))
{ {
/* [Ra], imm */ /* [Ra], imm */
fprintf (stream, "[%s], %d", fprintf (stream, "[%s], " HOST_WIDE_INT_PRINT_DEC,
reg_names[REGNO (op0)], (int)INTVAL (op1)); reg_names[REGNO (op0)], INTVAL (op1));
} }
else else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment