From: Tiezhu Yang Date: Sat, 6 Nov 2021 09:50:20 +0000 (+0800) Subject: sim: mips: use sim_fpu_to{32,64}u to fix build warnings X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=50a97903cea702f618328babd9093bd1fefbd7f1;p=binutils-gdb.git sim: mips: use sim_fpu_to{32,64}u to fix build warnings Since the first argument type is unsigned32 or unsigned64, just use sim_fpu_to{32,64}u instead of sim_fpu_to{32,64}i to fix the following build warnings: CC cp1.o .../sim/mips/cp1.c: In function 'convert': .../sim/mips/cp1.c:1425:32: warning: pointer targets in passing argument 1 of 'sim_fpu_to32i' differ in signedness [-Wpointer-sign] status |= sim_fpu_to32i (&result32, &wop, round); ^~~~~~~~~ In file included from .../sim/mips/sim-main.h:67, from .../sim/mips/cp1.c:46: .../sim/mips/../common/sim-fpu.h:270:22: note: expected 'signed32 *' {aka 'int *'} but argument is of type 'unsigned32 *' {aka 'unsigned int *'} INLINE_SIM_FPU (int) sim_fpu_to32i (signed32 *i, const sim_fpu *f, ^~~~~~~~~~~~~ .../sim/mips/cp1.c:1429:32: warning: pointer targets in passing argument 1 of 'sim_fpu_to64i' differ in signedness [-Wpointer-sign] status |= sim_fpu_to64i (&result64, &wop, round); ^~~~~~~~~ In file included from .../sim/mips/sim-main.h:67, from .../sim/mips/cp1.c:46: .../sim/mips/../common/sim-fpu.h:274:22: note: expected 'signed64 *' {aka 'long int *'} but argument is of type 'unsigned64 *' {aka 'long unsigned int *'} INLINE_SIM_FPU (int) sim_fpu_to64i (signed64 *i, const sim_fpu *f, ^~~~~~~~~~~~~ .../sim/mips/cp1.c: In function 'convert_ps': .../sim/mips/cp1.c:1528:34: warning: pointer targets in passing argument 1 of 'sim_fpu_to32i' differ in signedness [-Wpointer-sign] status_u |= sim_fpu_to32i (&res_u, &wop_u, round); ^~~~~~ In file included from .../sim/mips/sim-main.h:67, from .../sim/mips/cp1.c:46: .../sim/mips/../common/sim-fpu.h:270:22: note: expected 'signed32 *' {aka 'int *'} but argument is of type 'unsigned32 *' {aka 'unsigned int *'} INLINE_SIM_FPU (int) sim_fpu_to32i (signed32 *i, const sim_fpu *f, ^~~~~~~~~~~~~ .../sim/mips/cp1.c:1529:34: warning: pointer targets in passing argument 1 of 'sim_fpu_to32i' differ in signedness [-Wpointer-sign] status_l |= sim_fpu_to32i (&res_l, &wop_l, round); ^~~~~~ In file included from .../sim/mips/sim-main.h:67, from .../sim/mips/cp1.c:46: .../sim/mips/../common/sim-fpu.h:270:22: note: expected 'signed32 *' {aka 'int *'} but argument is of type 'unsigned32 *' {aka 'unsigned int *'} INLINE_SIM_FPU (int) sim_fpu_to32i (signed32 *i, const sim_fpu *f, ^~~~~~~~~~~~~ Signed-off-by: Tiezhu Yang --- diff --git a/sim/mips/Makefile.in b/sim/mips/Makefile.in index 589c392edb5..8a9241dd680 100644 --- a/sim/mips/Makefile.in +++ b/sim/mips/Makefile.in @@ -77,9 +77,6 @@ all: $(SIM_@sim_gen@_ALL) SIM_EXTRA_DEPS = itable.h -# Some modules don't build cleanly yet. -cp1.o: SIM_WERROR_CFLAGS = - ## COMMON_POST_CONFIG_FRAG IGEN_TRACE= # -G omit-line-numbers # -G trace-rule-selection -G trace-rule-rejection -G trace-entries # -G trace-all diff --git a/sim/mips/cp1.c b/sim/mips/cp1.c index 03ed0c0558f..8d45b84095e 100644 --- a/sim/mips/cp1.c +++ b/sim/mips/cp1.c @@ -1422,11 +1422,11 @@ convert (sim_cpu *cpu, sim_fpu_to64 (&result64, &wop); break; case fmt_word: - status |= sim_fpu_to32i (&result32, &wop, round); + status |= sim_fpu_to32u (&result32, &wop, round); result64 = result32; break; case fmt_long: - status |= sim_fpu_to64i (&result64, &wop, round); + status |= sim_fpu_to64u (&result64, &wop, round); break; default: result64 = 0; @@ -1525,8 +1525,8 @@ convert_ps (sim_cpu *cpu, switch (to) { case fmt_word: /* fmt_pw */ - status_u |= sim_fpu_to32i (&res_u, &wop_u, round); - status_l |= sim_fpu_to32i (&res_l, &wop_l, round); + status_u |= sim_fpu_to32u (&res_u, &wop_u, round); + status_l |= sim_fpu_to32u (&res_l, &wop_l, round); result = (((unsigned64)res_u) << 32) | (unsigned64)res_l; break; case fmt_ps: