* [mips sim]: Fix check for negative dmult operands
@ 2003-06-07 10:21 Richard Sandiford
2003-06-15 16:50 ` Richard Sandiford
0 siblings, 1 reply; 5+ messages in thread
From: Richard Sandiford @ 2003-06-07 10:21 UTC (permalink / raw)
To: gdb-patches
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;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [mips sim]: Fix check for negative dmult operands
2003-06-07 10:21 [mips sim]: Fix check for negative dmult operands Richard Sandiford
@ 2003-06-15 16:50 ` Richard Sandiford
2003-06-15 17:04 ` Andrew Cagney
[not found] ` <mailpost.1055695861.19245@news-sj1-1>
0 siblings, 2 replies; 5+ messages in thread
From: Richard Sandiford @ 2003-06-15 16:50 UTC (permalink / raw)
To: gdb-patches
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;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [mips sim]: Fix check for negative dmult operands
2003-06-15 16:50 ` Richard Sandiford
@ 2003-06-15 17:04 ` Andrew Cagney
[not found] ` <mailpost.1055696668.19518@news-sj1-1>
[not found] ` <mailpost.1055695861.19245@news-sj1-1>
1 sibling, 1 reply; 5+ messages in thread
From: Andrew Cagney @ 2003-06-15 17:04 UTC (permalink / raw)
To: Richard Sandiford; +Cc: gdb-patches
> 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.
(I'm not ment to be maintaing MIPS sim any more :-)
Yes, just add a comment reminding the reader that op1 is already 64 bits.
Andrew
>> 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;
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [mips sim]: Fix check for negative dmult operands
[not found] ` <mailpost.1055695861.19245@news-sj1-1>
@ 2003-06-18 1:13 ` cgd
0 siblings, 0 replies; 5+ messages in thread
From: cgd @ 2003-06-18 1:13 UTC (permalink / raw)
To: rsandifo; +Cc: gdb-patches
At Sun, 15 Jun 2003 16:51:01 +0000 (UTC), "Richard Sandiford" wrote:
> Ping?
applied. (thanks for the ping.)
(FWIW, we had this in our source tree here, but it's among so many
other diffs i hadn't noticed it. *sigh*)
chris
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [mips sim]: Fix check for negative dmult operands
[not found] ` <mailpost.1055696668.19518@news-sj1-1>
@ 2003-06-18 1:18 ` cgd
0 siblings, 0 replies; 5+ messages in thread
From: cgd @ 2003-06-18 1:18 UTC (permalink / raw)
To: ac131313; +Cc: Richard Sandiford, gdb-patches
At Sun, 15 Jun 2003 17:04:28 +0000 (UTC), "Andrew Cagney" wrote:
> Yes, just add a comment reminding the reader that op1 is already 64 bits.
op1 and op2 and defined approximately 10 lines above as:
unsigned64 op1 = GPR[rs];
unsigned64 op2 = GPR[rt];
so IMO their 64-bitness is fairly clear already.
cgd
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-06-18 1:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-07 10:21 [mips sim]: Fix check for negative dmult operands Richard Sandiford
2003-06-15 16:50 ` Richard Sandiford
2003-06-15 17:04 ` Andrew Cagney
[not found] ` <mailpost.1055696668.19518@news-sj1-1>
2003-06-18 1:18 ` cgd
[not found] ` <mailpost.1055695861.19245@news-sj1-1>
2003-06-18 1:13 ` cgd
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox