aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorTiezhu Yang <yangtiezhu@loongson.cn>2021-11-06 17:50:20 +0800
committerMike Frysinger <vapier@gentoo.org>2021-11-06 12:19:58 -0400
commit50a97903cea702f618328babd9093bd1fefbd7f1 (patch)
tree73ae972b0fb510b084f645d7613eb48dabd74114 /sim
parent314ec7aeeb1b2e68f0d8fb9990f2335f475a6e33 (diff)
downloadgdb-50a97903cea702f618328babd9093bd1fefbd7f1.zip
gdb-50a97903cea702f618328babd9093bd1fefbd7f1.tar.gz
gdb-50a97903cea702f618328babd9093bd1fefbd7f1.tar.bz2
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 <yangtiezhu@loongson.cn>
Diffstat (limited to 'sim')
-rw-r--r--sim/mips/Makefile.in3
-rw-r--r--sim/mips/cp1.c8
2 files changed, 4 insertions, 7 deletions
diff --git a/sim/mips/Makefile.in b/sim/mips/Makefile.in
index 589c392..8a9241d 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 03ed0c0..8d45b84 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: