* [PATCH] deal with vector return value for ppc68
@ 2005-10-24 23:47 Paul Gilliam
2005-11-02 21:59 ` Kevin Buettner
2005-11-02 22:42 ` [PATCH] " Daniel Jacobowitz
0 siblings, 2 replies; 12+ messages in thread
From: Paul Gilliam @ 2005-10-24 23:47 UTC (permalink / raw)
To: gdb-patches
2005-10-24 Paul Gilliam <pgilliam@us.ibm.com
* ppc-sysv-tdep.c (ppc64_sysv_abi_return_value): Copy code from
ppc_sysv_abi_return_value() to handle a vector return value.
Index: ppc-sysv-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ppc-sysv-tdep.c,v
retrieving revision 1.31
diff -a -u -p -r1.31 ppc-sysv-tdep.c
--- ppc-sysv-tdep.c 17 Aug 2005 07:44:13 -0000 1.31
+++ ppc-sysv-tdep.c 24 Oct 2005 22:57:31 -0000
@@ -906,11 +906,11 @@ ppc64_sysv_abi_return_value (struct gdba
}
return RETURN_VALUE_REGISTER_CONVENTION;
}
+ /* Integers in r3. */
if ((TYPE_CODE (valtype) == TYPE_CODE_INT
|| TYPE_CODE (valtype) == TYPE_CODE_ENUM)
&& TYPE_LENGTH (valtype) <= 8)
{
- /* Integers in r3. */
if (writebuf != NULL)
{
/* Be careful to sign extend the value. */
@@ -938,24 +938,41 @@ ppc64_sysv_abi_return_value (struct gdba
regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 3, readbuf);
return RETURN_VALUE_REGISTER_CONVENTION;
}
- if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY
- && TYPE_LENGTH (valtype) <= 8
- && TYPE_CODE (TYPE_TARGET_TYPE (valtype)) == TYPE_CODE_INT
- && TYPE_LENGTH (TYPE_TARGET_TYPE (valtype)) == 1)
+ /* Array type has more than one use. */
+ if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY)
{
/* Small character arrays are returned, right justified, in r3. */
- int offset = (register_size (gdbarch, tdep->ppc_gp0_regnum + 3)
- - TYPE_LENGTH (valtype));
- if (writebuf != NULL)
- regcache_cooked_write_part (regcache, tdep->ppc_gp0_regnum + 3,
- offset, TYPE_LENGTH (valtype), writebuf);
- if (readbuf != NULL)
- regcache_cooked_read_part (regcache, tdep->ppc_gp0_regnum + 3,
- offset, TYPE_LENGTH (valtype), readbuf);
- return RETURN_VALUE_REGISTER_CONVENTION;
+ if (TYPE_LENGTH (valtype) <= 8
+ && TYPE_CODE (TYPE_TARGET_TYPE (valtype)) == TYPE_CODE_INT
+ && TYPE_LENGTH (TYPE_TARGET_TYPE (valtype)) == 1)
+ {
+ int offset = (register_size (gdbarch, tdep->ppc_gp0_regnum + 3)
+ - TYPE_LENGTH (valtype));
+ if (writebuf != NULL)
+ regcache_cooked_write_part (regcache, tdep->ppc_gp0_regnum + 3,
+ offset, TYPE_LENGTH (valtype), writebuf);
+ if (readbuf != NULL)
+ regcache_cooked_read_part (regcache, tdep->ppc_gp0_regnum + 3,
+ offset, TYPE_LENGTH (valtype), readbuf);
+ return RETURN_VALUE_REGISTER_CONVENTION;
+ }
+ /* A VMX vector is returned in v2. */
+ if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY
+ && TYPE_VECTOR (valtype) && tdep->ppc_vr0_regnum >= 0)
+ {
+ if (readbuf)
+ {
+ regcache_cooked_read (regcache, tdep->ppc_vr0_regnum+2, readbuf);
+ }
+ if (writebuf)
+ {
+ regcache_cooked_write(regcache, tdep->ppc_vr0_regnum+2, writebuf);
+ }
+ return RETURN_VALUE_REGISTER_CONVENTION;
+ }
}
/* Big floating point values get stored in adjacent floating
- point registers. */
+ point registers, starting with F1. */
if (TYPE_CODE (valtype) == TYPE_CODE_FLT
&& (TYPE_LENGTH (valtype) == 16 || TYPE_LENGTH (valtype) == 32))
{
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] deal with vector return value for ppc68
2005-10-24 23:47 [PATCH] deal with vector return value for ppc68 Paul Gilliam
@ 2005-11-02 21:59 ` Kevin Buettner
2005-11-07 23:33 ` Paul Gilliam
2005-11-02 22:42 ` [PATCH] " Daniel Jacobowitz
1 sibling, 1 reply; 12+ messages in thread
From: Kevin Buettner @ 2005-11-02 21:59 UTC (permalink / raw)
To: gdb-patches
On Mon, 24 Oct 2005 16:06:10 -0700
Paul Gilliam <pgilliam@us.ibm.com> wrote:
> 2005-10-24 Paul Gilliam <pgilliam@us.ibm.com
>
> * ppc-sysv-tdep.c (ppc64_sysv_abi_return_value): Copy code from
> ppc_sysv_abi_return_value() to handle a vector return value.
Okay.
Kevin
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] deal with vector return value for ppc68
2005-10-24 23:47 [PATCH] deal with vector return value for ppc68 Paul Gilliam
2005-11-02 21:59 ` Kevin Buettner
@ 2005-11-02 22:42 ` Daniel Jacobowitz
2005-11-03 1:31 ` Mark Kettenis
1 sibling, 1 reply; 12+ messages in thread
From: Daniel Jacobowitz @ 2005-11-02 22:42 UTC (permalink / raw)
To: Paul Gilliam; +Cc: gdb-patches
On Mon, Oct 24, 2005 at 04:06:10PM -0700, Paul Gilliam wrote:
> 2005-10-24 Paul Gilliam <pgilliam@us.ibm.com
>
> * ppc-sysv-tdep.c (ppc64_sysv_abi_return_value): Copy code from
> ppc_sysv_abi_return_value() to handle a vector return value.
Kevin's approved this but before you check it in please fix the
formatting.
> + /* Array type has more than one use. */
Two spaces after periods.
> + /* A VMX vector is returned in v2. */
Ditto.
> + if (readbuf)
> + {
> + regcache_cooked_read (regcache, tdep->ppc_vr0_regnum+2, readbuf);
> + }
> + if (writebuf)
> + {
> + regcache_cooked_write(regcache, tdep->ppc_vr0_regnum+2, writebuf);
> + }
Useless braces; spaces before parentheses.
Thanks.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] deal with vector return value for ppc68
2005-11-02 22:42 ` [PATCH] " Daniel Jacobowitz
@ 2005-11-03 1:31 ` Mark Kettenis
2005-11-07 21:42 ` [COMMIT] " Paul Gilliam
0 siblings, 1 reply; 12+ messages in thread
From: Mark Kettenis @ 2005-11-03 1:31 UTC (permalink / raw)
To: pgilliam; +Cc: gdb-patches, drow
> Date: Wed, 2 Nov 2005 15:44:00 -0500
> From: Daniel Jacobowitz <drow@false.org>
>
> > + if (readbuf)
> > + {
> > + regcache_cooked_read (regcache, tdep->ppc_vr0_regnum+2, readbuf);
> > + }
> > + if (writebuf)
> > + {
> > + regcache_cooked_write(regcache, tdep->ppc_vr0_regnum+2, writebuf);
> > + }
>
> Useless braces; spaces before parentheses.
And before and after the +.
Mark
^ permalink raw reply [flat|nested] 12+ messages in thread
* [COMMIT] deal with vector return value for ppc68
2005-11-03 1:31 ` Mark Kettenis
@ 2005-11-07 21:42 ` Paul Gilliam
0 siblings, 0 replies; 12+ messages in thread
From: Paul Gilliam @ 2005-11-07 21:42 UTC (permalink / raw)
To: gdb-patches
Here is what I committed: It has all the corrections requestd by Danial and Mark.
2005-11-07 Paul Gilliam <pgilliam@us.ibm.com
* ppc-sysv-tdep.c (ppc64_sysv_abi_return_value): Copy code from
ppc_sysv_abi_return_value() to handle a vector return value.
Index: ppc-sysv-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ppc-sysv-tdep.c,v
retrieving revision 1.31
diff -a -u -p -r1.31 ppc-sysv-tdep.c
--- ppc-sysv-tdep.c 17 Aug 2005 07:44:13 -0000 1.31
+++ ppc-sysv-tdep.c 7 Nov 2005 20:29:22 -0000
@@ -906,11 +906,11 @@ ppc64_sysv_abi_return_value (struct gdba
}
return RETURN_VALUE_REGISTER_CONVENTION;
}
+ /* Integers in r3. */
if ((TYPE_CODE (valtype) == TYPE_CODE_INT
|| TYPE_CODE (valtype) == TYPE_CODE_ENUM)
&& TYPE_LENGTH (valtype) <= 8)
{
- /* Integers in r3. */
if (writebuf != NULL)
{
/* Be careful to sign extend the value. */
@@ -938,24 +938,37 @@ ppc64_sysv_abi_return_value (struct gdba
regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 3, readbuf);
return RETURN_VALUE_REGISTER_CONVENTION;
}
- if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY
- && TYPE_LENGTH (valtype) <= 8
- && TYPE_CODE (TYPE_TARGET_TYPE (valtype)) == TYPE_CODE_INT
- && TYPE_LENGTH (TYPE_TARGET_TYPE (valtype)) == 1)
+ /* Array type has more than one use. */
+ if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY)
{
/* Small character arrays are returned, right justified, in r3. */
- int offset = (register_size (gdbarch, tdep->ppc_gp0_regnum + 3)
- - TYPE_LENGTH (valtype));
- if (writebuf != NULL)
- regcache_cooked_write_part (regcache, tdep->ppc_gp0_regnum + 3,
- offset, TYPE_LENGTH (valtype), writebuf);
- if (readbuf != NULL)
- regcache_cooked_read_part (regcache, tdep->ppc_gp0_regnum + 3,
- offset, TYPE_LENGTH (valtype), readbuf);
- return RETURN_VALUE_REGISTER_CONVENTION;
+ if (TYPE_LENGTH (valtype) <= 8
+ && TYPE_CODE (TYPE_TARGET_TYPE (valtype)) == TYPE_CODE_INT
+ && TYPE_LENGTH (TYPE_TARGET_TYPE (valtype)) == 1)
+ {
+ int offset = (register_size (gdbarch, tdep->ppc_gp0_regnum + 3)
+ - TYPE_LENGTH (valtype));
+ if (writebuf != NULL)
+ regcache_cooked_write_part (regcache, tdep->ppc_gp0_regnum + 3,
+ offset, TYPE_LENGTH (valtype), writebuf);
+ if (readbuf != NULL)
+ regcache_cooked_read_part (regcache, tdep->ppc_gp0_regnum + 3,
+ offset, TYPE_LENGTH (valtype), readbuf);
+ return RETURN_VALUE_REGISTER_CONVENTION;
+ }
+ /* A VMX vector is returned in v2. */
+ if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY
+ && TYPE_VECTOR (valtype) && tdep->ppc_vr0_regnum >= 0)
+ {
+ if (readbuf)
+ regcache_cooked_read (regcache, tdep->ppc_vr0_regnum + 2, readbuf);
+ if (writebuf)
+ regcache_cooked_write (regcache, tdep->ppc_vr0_regnum + 2, writebuf);
+ return RETURN_VALUE_REGISTER_CONVENTION;
+ }
}
/* Big floating point values get stored in adjacent floating
- point registers. */
+ point registers, starting with F1. */
if (TYPE_CODE (valtype) == TYPE_CODE_FLT
&& (TYPE_LENGTH (valtype) == 16 || TYPE_LENGTH (valtype) == 32))
{
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] deal with vector return value for ppc68
2005-11-02 21:59 ` Kevin Buettner
@ 2005-11-07 23:33 ` Paul Gilliam
2005-11-08 0:10 ` Paul Gilliam
2005-11-08 17:46 ` Kevin Buettner
0 siblings, 2 replies; 12+ messages in thread
From: Paul Gilliam @ 2005-11-07 23:33 UTC (permalink / raw)
To: gdb-patches; +Cc: Kevin Buettner, gdb-patches
I have commited the patch (after some formatting corrections) to mainline
OK to commit to 6.4 branch?
I have never committed to a branch, so I would appreciate some pointers.
-=# Paul #=-
On Wednesday 02 November 2005 12:37, Kevin Buettner wrote:
> On Mon, 24 Oct 2005 16:06:10 -0700
> Paul Gilliam <pgilliam@us.ibm.com> wrote:
>
> > 2005-10-24 Paul Gilliam <pgilliam@us.ibm.com
> >
> > * ppc-sysv-tdep.c (ppc64_sysv_abi_return_value): Copy code from
> > ppc_sysv_abi_return_value() to handle a vector return value.
>
> Okay.
>
> Kevin
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] deal with vector return value for ppc68
2005-11-07 23:33 ` Paul Gilliam
@ 2005-11-08 0:10 ` Paul Gilliam
2005-11-08 17:46 ` Kevin Buettner
1 sibling, 0 replies; 12+ messages in thread
From: Paul Gilliam @ 2005-11-08 0:10 UTC (permalink / raw)
To: gdb-patches; +Cc: Kevin Buettner, gdb-patches
I have commited the patch (after some formatting corrections) to mainline
OK to commit to 6.4 branch?
I have never committed to a branch, so I would appreciate some pointers.
-=# Paul #=-
On Wednesday 02 November 2005 12:37, Kevin Buettner wrote:
> On Mon, 24 Oct 2005 16:06:10 -0700
> Paul Gilliam <pgilliam@us.ibm.com> wrote:
>
> > 2005-10-24 Paul Gilliam <pgilliam@us.ibm.com
> >
> > * ppc-sysv-tdep.c (ppc64_sysv_abi_return_value): Copy code from
> > ppc_sysv_abi_return_value() to handle a vector return value.
>
> Okay.
>
> Kevin
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] deal with vector return value for ppc68
2005-11-07 23:33 ` Paul Gilliam
2005-11-08 0:10 ` Paul Gilliam
@ 2005-11-08 17:46 ` Kevin Buettner
2005-11-09 6:56 ` Joel Brobecker
1 sibling, 1 reply; 12+ messages in thread
From: Kevin Buettner @ 2005-11-08 17:46 UTC (permalink / raw)
To: gdb-patches
On Mon, 7 Nov 2005 13:43:43 -0800
Paul Gilliam <pgilliam@us.ibm.com> wrote:
> OK to commit to 6.4 branch?
It's okay with me, but Joel is the one who sets the commit policy for the
release branch. (In other words, make sure it's okay with Joel first...)
> I have never committed to a branch, so I would appreciate some pointers.
Check out the branch, apply your patch to the branch, add suitable
ChangeLog entries, and then commit.
Kevin
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] deal with vector return value for ppc68
2005-11-08 17:46 ` Kevin Buettner
@ 2005-11-09 6:56 ` Joel Brobecker
2005-11-09 7:24 ` Kevin Buettner
0 siblings, 1 reply; 12+ messages in thread
From: Joel Brobecker @ 2005-11-09 6:56 UTC (permalink / raw)
To: Kevin Buettner; +Cc: gdb-patches
> > OK to commit to 6.4 branch?
>
> It's okay with me, but Joel is the one who sets the commit policy for the
> release branch. (In other words, make sure it's okay with Joel first...)
The policy is that MAINTAINERS still applies, so the relevant maintainers
are the ones who decide whether it can/should go to the branch. No need
to check with me.
--
Joel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] deal with vector return value for ppc68
2005-11-09 6:56 ` Joel Brobecker
@ 2005-11-09 7:24 ` Kevin Buettner
2005-11-15 4:10 ` [COMMIT (6.4)] " Paul Gilliam
0 siblings, 1 reply; 12+ messages in thread
From: Kevin Buettner @ 2005-11-09 7:24 UTC (permalink / raw)
To: gdb-patches
On Tue, 8 Nov 2005 09:28:35 -0800
Joel Brobecker <brobecker@adacore.com> wrote:
> > > OK to commit to 6.4 branch?
> >
> > It's okay with me, but Joel is the one who sets the commit policy for the
> > release branch. (In other words, make sure it's okay with Joel first...)
>
> The policy is that MAINTAINERS still applies, so the relevant maintainers
> are the ones who decide whether it can/should go to the branch. No need
> to check with me.
That being the case...
Paul's vector return value patch for ppc64 is approved to go onto the
release branch.
Kevin
^ permalink raw reply [flat|nested] 12+ messages in thread
* [COMMIT (6.4)] deal with vector return value for ppc68
2005-11-09 7:24 ` Kevin Buettner
@ 2005-11-15 4:10 ` Paul Gilliam
2005-11-15 4:40 ` Paul Gilliam
0 siblings, 1 reply; 12+ messages in thread
From: Paul Gilliam @ 2005-11-15 4:10 UTC (permalink / raw)
To: gdb-patches; +Cc: Kevin Buettner, gdb-patches
Here is what got committed to the 6.4 branch:
2005-11-14 Paul Gilliam <pgilliam@us.ibm.com>
* ppc-sysv-tdep.c (ppc64_sysv_abi_return_value): Copy code from
ppc_sysv_abi_return_value() to handle a vector return value.
Index: ppc-sysv-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ppc-sysv-tdep.c,v
retrieving revision 1.31
diff -a -u -p -r1.31 ppc-sysv-tdep.c
--- ppc-sysv-tdep.c 17 Aug 2005 07:44:13 -0000 1.31
+++ ppc-sysv-tdep.c 14 Nov 2005 22:14:37 -0000
@@ -906,11 +906,11 @@ ppc64_sysv_abi_return_value (struct gdba
}
return RETURN_VALUE_REGISTER_CONVENTION;
}
+ /* Integers in r3. */
if ((TYPE_CODE (valtype) == TYPE_CODE_INT
|| TYPE_CODE (valtype) == TYPE_CODE_ENUM)
&& TYPE_LENGTH (valtype) <= 8)
{
- /* Integers in r3. */
if (writebuf != NULL)
{
/* Be careful to sign extend the value. */
@@ -938,24 +938,36 @@ ppc64_sysv_abi_return_value (struct gdba
regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 3, readbuf);
return RETURN_VALUE_REGISTER_CONVENTION;
}
- if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY
- && TYPE_LENGTH (valtype) <= 8
- && TYPE_CODE (TYPE_TARGET_TYPE (valtype)) == TYPE_CODE_INT
- && TYPE_LENGTH (TYPE_TARGET_TYPE (valtype)) == 1)
+ /* Array type has more than one use. */
+ if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY)
{
/* Small character arrays are returned, right justified, in r3. */
- int offset = (register_size (gdbarch, tdep->ppc_gp0_regnum + 3)
- - TYPE_LENGTH (valtype));
- if (writebuf != NULL)
- regcache_cooked_write_part (regcache, tdep->ppc_gp0_regnum + 3,
- offset, TYPE_LENGTH (valtype), writebuf);
- if (readbuf != NULL)
- regcache_cooked_read_part (regcache, tdep->ppc_gp0_regnum + 3,
- offset, TYPE_LENGTH (valtype), readbuf);
- return RETURN_VALUE_REGISTER_CONVENTION;
+ if (TYPE_LENGTH (valtype) <= 8
+ && TYPE_CODE (TYPE_TARGET_TYPE (valtype)) == TYPE_CODE_INT
+ && TYPE_LENGTH (TYPE_TARGET_TYPE (valtype)) == 1)
+ {
+ int offset = (register_size (gdbarch, tdep->ppc_gp0_regnum + 3)
+ - TYPE_LENGTH (valtype));
+ if (writebuf != NULL)
+ regcache_cooked_write_part (regcache, tdep->ppc_gp0_regnum + 3,
+ offset, TYPE_LENGTH (valtype), writebuf);
+ if (readbuf != NULL)
+ regcache_cooked_read_part (regcache, tdep->ppc_gp0_regnum + 3,
+ offset, TYPE_LENGTH (valtype), readbuf);
+ return RETURN_VALUE_REGISTER_CONVENTION;
+ }
+ /* A VMX vector is returned in v2. */
+ if (TYPE_VECTOR (valtype) && tdep->ppc_vr0_regnum >= 0)
+ {
+ if (readbuf)
+ regcache_cooked_read (regcache, tdep->ppc_vr0_regnum + 2, readbuf);
+ if (writebuf)
+ regcache_cooked_write (regcache, tdep->ppc_vr0_regnum + 2, writebuf);
+ return RETURN_VALUE_REGISTER_CONVENTION;
+ }
}
/* Big floating point values get stored in adjacent floating
- point registers. */
+ point registers, starting with F1. */
if (TYPE_CODE (valtype) == TYPE_CODE_FLT
&& (TYPE_LENGTH (valtype) == 16 || TYPE_LENGTH (valtype) == 32))
{
^ permalink raw reply [flat|nested] 12+ messages in thread
* [COMMIT (6.4)] deal with vector return value for ppc68
2005-11-15 4:10 ` [COMMIT (6.4)] " Paul Gilliam
@ 2005-11-15 4:40 ` Paul Gilliam
0 siblings, 0 replies; 12+ messages in thread
From: Paul Gilliam @ 2005-11-15 4:40 UTC (permalink / raw)
To: gdb-patches; +Cc: Kevin Buettner, gdb-patches
Here is what got committed to the 6.4 branch:
2005-11-14 Paul Gilliam <pgilliam@us.ibm.com>
* ppc-sysv-tdep.c (ppc64_sysv_abi_return_value): Copy code from
ppc_sysv_abi_return_value() to handle a vector return value.
Index: ppc-sysv-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ppc-sysv-tdep.c,v
retrieving revision 1.31
diff -a -u -p -r1.31 ppc-sysv-tdep.c
--- ppc-sysv-tdep.c 17 Aug 2005 07:44:13 -0000 1.31
+++ ppc-sysv-tdep.c 14 Nov 2005 22:14:37 -0000
@@ -906,11 +906,11 @@ ppc64_sysv_abi_return_value (struct gdba
}
return RETURN_VALUE_REGISTER_CONVENTION;
}
+ /* Integers in r3. */
if ((TYPE_CODE (valtype) == TYPE_CODE_INT
|| TYPE_CODE (valtype) == TYPE_CODE_ENUM)
&& TYPE_LENGTH (valtype) <= 8)
{
- /* Integers in r3. */
if (writebuf != NULL)
{
/* Be careful to sign extend the value. */
@@ -938,24 +938,36 @@ ppc64_sysv_abi_return_value (struct gdba
regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 3, readbuf);
return RETURN_VALUE_REGISTER_CONVENTION;
}
- if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY
- && TYPE_LENGTH (valtype) <= 8
- && TYPE_CODE (TYPE_TARGET_TYPE (valtype)) == TYPE_CODE_INT
- && TYPE_LENGTH (TYPE_TARGET_TYPE (valtype)) == 1)
+ /* Array type has more than one use. */
+ if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY)
{
/* Small character arrays are returned, right justified, in r3. */
- int offset = (register_size (gdbarch, tdep->ppc_gp0_regnum + 3)
- - TYPE_LENGTH (valtype));
- if (writebuf != NULL)
- regcache_cooked_write_part (regcache, tdep->ppc_gp0_regnum + 3,
- offset, TYPE_LENGTH (valtype), writebuf);
- if (readbuf != NULL)
- regcache_cooked_read_part (regcache, tdep->ppc_gp0_regnum + 3,
- offset, TYPE_LENGTH (valtype), readbuf);
- return RETURN_VALUE_REGISTER_CONVENTION;
+ if (TYPE_LENGTH (valtype) <= 8
+ && TYPE_CODE (TYPE_TARGET_TYPE (valtype)) == TYPE_CODE_INT
+ && TYPE_LENGTH (TYPE_TARGET_TYPE (valtype)) == 1)
+ {
+ int offset = (register_size (gdbarch, tdep->ppc_gp0_regnum + 3)
+ - TYPE_LENGTH (valtype));
+ if (writebuf != NULL)
+ regcache_cooked_write_part (regcache, tdep->ppc_gp0_regnum + 3,
+ offset, TYPE_LENGTH (valtype), writebuf);
+ if (readbuf != NULL)
+ regcache_cooked_read_part (regcache, tdep->ppc_gp0_regnum + 3,
+ offset, TYPE_LENGTH (valtype), readbuf);
+ return RETURN_VALUE_REGISTER_CONVENTION;
+ }
+ /* A VMX vector is returned in v2. */
+ if (TYPE_VECTOR (valtype) && tdep->ppc_vr0_regnum >= 0)
+ {
+ if (readbuf)
+ regcache_cooked_read (regcache, tdep->ppc_vr0_regnum + 2, readbuf);
+ if (writebuf)
+ regcache_cooked_write (regcache, tdep->ppc_vr0_regnum + 2, writebuf);
+ return RETURN_VALUE_REGISTER_CONVENTION;
+ }
}
/* Big floating point values get stored in adjacent floating
- point registers. */
+ point registers, starting with F1. */
if (TYPE_CODE (valtype) == TYPE_CODE_FLT
&& (TYPE_LENGTH (valtype) == 16 || TYPE_LENGTH (valtype) == 32))
{
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2005-11-14 22:18 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-24 23:47 [PATCH] deal with vector return value for ppc68 Paul Gilliam
2005-11-02 21:59 ` Kevin Buettner
2005-11-07 23:33 ` Paul Gilliam
2005-11-08 0:10 ` Paul Gilliam
2005-11-08 17:46 ` Kevin Buettner
2005-11-09 6:56 ` Joel Brobecker
2005-11-09 7:24 ` Kevin Buettner
2005-11-15 4:10 ` [COMMIT (6.4)] " Paul Gilliam
2005-11-15 4:40 ` Paul Gilliam
2005-11-02 22:42 ` [PATCH] " Daniel Jacobowitz
2005-11-03 1:31 ` Mark Kettenis
2005-11-07 21:42 ` [COMMIT] " Paul Gilliam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox