]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: mips: use sim_fpu_to{32,64}u to fix build warnings
authorTiezhu Yang <yangtiezhu@loongson.cn>
Sat, 6 Nov 2021 09:50:20 +0000 (17:50 +0800)
committerMike Frysinger <vapier@gentoo.org>
Sat, 6 Nov 2021 16:19:58 +0000 (12:19 -0400)
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 <yangtiezhu@loongson.cn>
sim/mips/Makefile.in
sim/mips/cp1.c

index 589c392edb5338082e82e7464d56d61ef3adfeee..8a9241dd680e7b5118caa51adc85b5cb9b5dd8b3 100644 (file)
@@ -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
index 03ed0c0558ff633e64b88b9ea2740ffe021e215a..8d45b84095ee35c682d851c3d419b0bb715d8f86 100644 (file)
@@ -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: