This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [mips sim]: Fix check for negative dmult operands
- From: Richard Sandiford <rsandifo at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: 15 Jun 2003 17:48:12 +0100
- Subject: Re: [mips sim]: Fix check for negative dmult operands
- References: <wvn7k7y198k.fsf@talisman.cambridge.redhat.com>
Ping?
Richard Sandiford <rsandifo@redhat.com> writes:
> do_dmultx tests for negative operands with:
>
> if (op1 < 0)
> {
> op1 = - op1;
> ++sign;
> }
> if (op2 < 0)
> {
> op2 = - op2;
> ++sign;
> }
>
> but op1 and op2 are unsigned...
>
> The patch below fixes some gcc.c-torture/execute/950426-2.c failures
> on mipsisa64-elf. Please install if OK.
>
> Richard
>
>
> * mips.igen (do_dmultx): Fix check for negative operands.
>
> Index: sim/mips/mips.igen
> ===================================================================
> RCS file: /cvs/src/src/sim/mips/mips.igen,v
> retrieving revision 1.53
> diff -u -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.53 mips.igen
> --- sim/mips/mips.igen 14 Jan 2003 19:01:41 -0000 1.53
> +++ sim/mips/mips.igen 7 Jun 2003 10:14:00 -0000
> @@ -1347,12 +1350,12 @@ 000000,5.RS,5.RT,0000000000,011011:SPECI
> sign = 0;
> if (signed_p)
> {
> - if (op1 < 0)
> + if ((signed64) op1 < 0)
> {
> op1 = - op1;
> ++sign;
> }
> - if (op2 < 0)
> + if ((signed64) op2 < 0)
> {
> op2 = - op2;
> ++sign;