* gdb (ARM processor) casting issues in iwmmxt.c
@ 2006-09-19 11:43 shanevolpe
2006-09-19 18:31 ` Michael Snyder
0 siblings, 1 reply; 5+ messages in thread
From: shanevolpe @ 2006-09-19 11:43 UTC (permalink / raw)
To: gdb
All,
I tried compiling gdb client for the xscale processor and all works
good but for some casting issues in iwmmxt.c Here is what I found:
There is casting occurring on the target:
(unsigned long) s1 = a * b;
I changed all the castings to only cast on the source and not
target.. After my modifications everything compiled fine. Below is a
patch file with my changes. I'm not sure if there is something I'm
missing, I have never seen casting on the target before.
Patch:
--- gdb-6.3/sim/arm/iwmmxt~old.c 2003-03-27 12:13:33.000000000 -0500
+++ gdb-6.3/sim/arm/iwmmxt.c 2006-09-18 15:26:05.000000000 -0400
@@ -2114,7 +2114,7 @@
s = (signed long) a * (signed long) b;
- (signed long long) t += s;
+ t += (signed long long)s;
}
else
{
@@ -2130,7 +2130,7 @@
wR [BITS (12, 15)] = 0;
if (BIT (21)) /* Signed. */
- (signed long long) wR[BITS (12, 15)] += (signed long long) t;
+ wR[BITS (12, 15)] += (signed long long) t;
else
wR [BITS (12, 15)] += t;
@@ -2166,7 +2166,7 @@
b = wRHALF (BITS (0, 3), i * 2);
b = EXTEND16 (b);
- (signed long) s1 = a * b;
+ s1 = (signed long)a * (signed long)b;
a = wRHALF (BITS (16, 19), i * 2 + 1);
a = EXTEND16 (a);
@@ -2174,7 +2174,7 @@
b = wRHALF (BITS (0, 3), i * 2 + 1);
b = EXTEND16 (b);
- (signed long) s2 = a * b;
+ s2 = (signed long)a * (signed long)b;
}
else /* Unsigned. */
{
@@ -2183,12 +2183,12 @@
a = wRHALF (BITS (16, 19), i * 2);
b = wRHALF (BITS ( 0, 3), i * 2);
- (unsigned long) s1 = a * b;
+ s1 = (unsigned long)a *(unsigned long) b;
a = wRHALF (BITS (16, 19), i * 2 + 1);
b = wRHALF (BITS ( 0, 3), i * 2 + 1);
- (signed long) s2 = a * b;
+ s2 = (signed long)a * (signed long)b;
}
r |= (ARMdword) ((s1 + s2) & 0xffffffff) << (i ? 32 : 0);
--
Registered Linux User: #293401
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: gdb (ARM processor) casting issues in iwmmxt.c
2006-09-19 11:43 gdb (ARM processor) casting issues in iwmmxt.c shanevolpe
@ 2006-09-19 18:31 ` Michael Snyder
2006-09-19 18:33 ` shanevolpe
0 siblings, 1 reply; 5+ messages in thread
From: Michael Snyder @ 2006-09-19 18:31 UTC (permalink / raw)
To: shanevolpe, gdb
Are you on a branch? The casts that you want to change
don't seem to be in my version of the source file (which
according to CVS, is up to date).
Michael
-----Original Message-----
From: gdb-owner@sourceware.org on behalf of shanevolpe@gmail.com
Sent: Tue 9/19/2006 4:43 AM
To: gdb@sourceware.org
Subject: gdb (ARM processor) casting issues in iwmmxt.c
All,
I tried compiling gdb client for the xscale processor and all works
good but for some casting issues in iwmmxt.c Here is what I found:
There is casting occurring on the target:
(unsigned long) s1 = a * b;
I changed all the castings to only cast on the source and not
target.. After my modifications everything compiled fine. Below is a
patch file with my changes. I'm not sure if there is something I'm
missing, I have never seen casting on the target before.
Patch:
--- gdb-6.3/sim/arm/iwmmxt~old.c 2003-03-27 12:13:33.000000000 -0500
+++ gdb-6.3/sim/arm/iwmmxt.c 2006-09-18 15:26:05.000000000 -0400
@@ -2114,7 +2114,7 @@
s = (signed long) a * (signed long) b;
- (signed long long) t += s;
+ t += (signed long long)s;
}
else
{
@@ -2130,7 +2130,7 @@
wR [BITS (12, 15)] = 0;
if (BIT (21)) /* Signed. */
- (signed long long) wR[BITS (12, 15)] += (signed long long) t;
+ wR[BITS (12, 15)] += (signed long long) t;
else
wR [BITS (12, 15)] += t;
@@ -2166,7 +2166,7 @@
b = wRHALF (BITS (0, 3), i * 2);
b = EXTEND16 (b);
- (signed long) s1 = a * b;
+ s1 = (signed long)a * (signed long)b;
a = wRHALF (BITS (16, 19), i * 2 + 1);
a = EXTEND16 (a);
@@ -2174,7 +2174,7 @@
b = wRHALF (BITS (0, 3), i * 2 + 1);
b = EXTEND16 (b);
- (signed long) s2 = a * b;
+ s2 = (signed long)a * (signed long)b;
}
else /* Unsigned. */
{
@@ -2183,12 +2183,12 @@
a = wRHALF (BITS (16, 19), i * 2);
b = wRHALF (BITS ( 0, 3), i * 2);
- (unsigned long) s1 = a * b;
+ s1 = (unsigned long)a *(unsigned long) b;
a = wRHALF (BITS (16, 19), i * 2 + 1);
b = wRHALF (BITS ( 0, 3), i * 2 + 1);
- (signed long) s2 = a * b;
+ s2 = (signed long)a * (signed long)b;
}
r |= (ARMdword) ((s1 + s2) & 0xffffffff) << (i ? 32 : 0);
--
Registered Linux User: #293401
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: gdb (ARM processor) casting issues in iwmmxt.c
2006-09-19 18:31 ` Michael Snyder
@ 2006-09-19 18:33 ` shanevolpe
2006-09-19 18:35 ` Daniel Jacobowitz
2006-09-19 18:36 ` Michael Snyder
0 siblings, 2 replies; 5+ messages in thread
From: shanevolpe @ 2006-09-19 18:33 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb
Michael,
I'm using 6.2 and 6.3, I will look at porting the cvs to the embedded
platform I'm using (openembedded.org)
Regards,
Shane
On 9/19/06, Michael Snyder <Michael.Snyder@palmsource.com> wrote:
>
> Are you on a branch? The casts that you want to change
> don't seem to be in my version of the source file (which
> according to CVS, is up to date).
>
> Michael
>
>
> -----Original Message-----
> From: gdb-owner@sourceware.org on behalf of shanevolpe@gmail.com
> Sent: Tue 9/19/2006 4:43 AM
> To: gdb@sourceware.org
> Subject: gdb (ARM processor) casting issues in iwmmxt.c
>
> All,
> I tried compiling gdb client for the xscale processor and all works
> good but for some casting issues in iwmmxt.c Here is what I found:
> There is casting occurring on the target:
> (unsigned long) s1 = a * b;
> I changed all the castings to only cast on the source and not
> target.. After my modifications everything compiled fine. Below is a
> patch file with my changes. I'm not sure if there is something I'm
> missing, I have never seen casting on the target before.
>
> Patch:
> --- gdb-6.3/sim/arm/iwmmxt~old.c 2003-03-27 12:13:33.000000000 -0500
> +++ gdb-6.3/sim/arm/iwmmxt.c 2006-09-18 15:26:05.000000000 -0400
> @@ -2114,7 +2114,7 @@
>
> s = (signed long) a * (signed long) b;
>
> - (signed long long) t += s;
> + t += (signed long long)s;
> }
> else
> {
> @@ -2130,7 +2130,7 @@
> wR [BITS (12, 15)] = 0;
>
> if (BIT (21)) /* Signed. */
> - (signed long long) wR[BITS (12, 15)] += (signed long long) t;
> + wR[BITS (12, 15)] += (signed long long) t;
> else
> wR [BITS (12, 15)] += t;
>
> @@ -2166,7 +2166,7 @@
> b = wRHALF (BITS (0, 3), i * 2);
> b = EXTEND16 (b);
>
> - (signed long) s1 = a * b;
> + s1 = (signed long)a * (signed long)b;
>
> a = wRHALF (BITS (16, 19), i * 2 + 1);
> a = EXTEND16 (a);
> @@ -2174,7 +2174,7 @@
> b = wRHALF (BITS (0, 3), i * 2 + 1);
> b = EXTEND16 (b);
>
> - (signed long) s2 = a * b;
> + s2 = (signed long)a * (signed long)b;
> }
> else /* Unsigned. */
> {
> @@ -2183,12 +2183,12 @@
> a = wRHALF (BITS (16, 19), i * 2);
> b = wRHALF (BITS ( 0, 3), i * 2);
>
> - (unsigned long) s1 = a * b;
> + s1 = (unsigned long)a *(unsigned long) b;
>
> a = wRHALF (BITS (16, 19), i * 2 + 1);
> b = wRHALF (BITS ( 0, 3), i * 2 + 1);
>
> - (signed long) s2 = a * b;
> + s2 = (signed long)a * (signed long)b;
> }
>
> r |= (ARMdword) ((s1 + s2) & 0xffffffff) << (i ? 32 : 0);
>
>
>
>
> --
> Registered Linux User: #293401
>
>
--
Registered Linux User: #293401
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: gdb (ARM processor) casting issues in iwmmxt.c
2006-09-19 18:33 ` shanevolpe
@ 2006-09-19 18:35 ` Daniel Jacobowitz
2006-09-19 18:36 ` Michael Snyder
1 sibling, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2006-09-19 18:35 UTC (permalink / raw)
To: shanevolpe; +Cc: Michael Snyder, gdb
On Tue, Sep 19, 2006 at 02:33:41PM -0400, shanevolpe@gmail.com wrote:
> Michael,
> I'm using 6.2 and 6.3, I will look at porting the cvs to the embedded
> platform I'm using (openembedded.org)
Good idea. I can confirm that this was fixed since then.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: gdb (ARM processor) casting issues in iwmmxt.c
2006-09-19 18:33 ` shanevolpe
2006-09-19 18:35 ` Daniel Jacobowitz
@ 2006-09-19 18:36 ` Michael Snyder
1 sibling, 0 replies; 5+ messages in thread
From: Michael Snyder @ 2006-09-19 18:36 UTC (permalink / raw)
To: shanevolpe; +Cc: gdb
OK. We generally don't accept patches for old releases.
Try going to at least 6.5.
-----Original Message-----
From: shanevolpe@gmail.com [mailto:shanevolpe@gmail.com]
Sent: Tue 9/19/2006 11:33 AM
To: Michael Snyder
Cc: gdb@sourceware.org
Subject: Re: gdb (ARM processor) casting issues in iwmmxt.c
Michael,
I'm using 6.2 and 6.3, I will look at porting the cvs to the embedded
platform I'm using (openembedded.org)
Regards,
Shane
On 9/19/06, Michael Snyder <Michael.Snyder@palmsource.com> wrote:
>
> Are you on a branch? The casts that you want to change
> don't seem to be in my version of the source file (which
> according to CVS, is up to date).
>
> Michael
>
>
> -----Original Message-----
> From: gdb-owner@sourceware.org on behalf of shanevolpe@gmail.com
> Sent: Tue 9/19/2006 4:43 AM
> To: gdb@sourceware.org
> Subject: gdb (ARM processor) casting issues in iwmmxt.c
>
> All,
> I tried compiling gdb client for the xscale processor and all works
> good but for some casting issues in iwmmxt.c Here is what I found:
> There is casting occurring on the target:
> (unsigned long) s1 = a * b;
> I changed all the castings to only cast on the source and not
> target.. After my modifications everything compiled fine. Below is a
> patch file with my changes. I'm not sure if there is something I'm
> missing, I have never seen casting on the target before.
>
> Patch:
> --- gdb-6.3/sim/arm/iwmmxt~old.c 2003-03-27 12:13:33.000000000 -0500
> +++ gdb-6.3/sim/arm/iwmmxt.c 2006-09-18 15:26:05.000000000 -0400
> @@ -2114,7 +2114,7 @@
>
> s = (signed long) a * (signed long) b;
>
> - (signed long long) t += s;
> + t += (signed long long)s;
> }
> else
> {
> @@ -2130,7 +2130,7 @@
> wR [BITS (12, 15)] = 0;
>
> if (BIT (21)) /* Signed. */
> - (signed long long) wR[BITS (12, 15)] += (signed long long) t;
> + wR[BITS (12, 15)] += (signed long long) t;
> else
> wR [BITS (12, 15)] += t;
>
> @@ -2166,7 +2166,7 @@
> b = wRHALF (BITS (0, 3), i * 2);
> b = EXTEND16 (b);
>
> - (signed long) s1 = a * b;
> + s1 = (signed long)a * (signed long)b;
>
> a = wRHALF (BITS (16, 19), i * 2 + 1);
> a = EXTEND16 (a);
> @@ -2174,7 +2174,7 @@
> b = wRHALF (BITS (0, 3), i * 2 + 1);
> b = EXTEND16 (b);
>
> - (signed long) s2 = a * b;
> + s2 = (signed long)a * (signed long)b;
> }
> else /* Unsigned. */
> {
> @@ -2183,12 +2183,12 @@
> a = wRHALF (BITS (16, 19), i * 2);
> b = wRHALF (BITS ( 0, 3), i * 2);
>
> - (unsigned long) s1 = a * b;
> + s1 = (unsigned long)a *(unsigned long) b;
>
> a = wRHALF (BITS (16, 19), i * 2 + 1);
> b = wRHALF (BITS ( 0, 3), i * 2 + 1);
>
> - (signed long) s2 = a * b;
> + s2 = (signed long)a * (signed long)b;
> }
>
> r |= (ARMdword) ((s1 + s2) & 0xffffffff) << (i ? 32 : 0);
>
>
>
>
> --
> Registered Linux User: #293401
>
>
--
Registered Linux User: #293401
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-09-19 18:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-19 11:43 gdb (ARM processor) casting issues in iwmmxt.c shanevolpe
2006-09-19 18:31 ` Michael Snyder
2006-09-19 18:33 ` shanevolpe
2006-09-19 18:35 ` Daniel Jacobowitz
2006-09-19 18:36 ` Michael Snyder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox