complex floats, adjust some related comments and tighten a related
assertion.
(sparc64_extract_return_value): Handle complex floats.
+2012-04-07 Mark Kettenis <kettenis@gnu.org>
+
+ * sparc64-tdep.c (sparc64_store_arguments): Fix handling of
+ complex floats, adjust some related comments and tighten a related
+ assertion.
+ (sparc64_extract_return_value): Handle complex floats.
+
2012-04-07 Doug Evans <dje@google.com>
* dwarf2read.c (load_partial_dies): Change condition to assert.
2012-04-07 Doug Evans <dje@google.com>
* dwarf2read.c (load_partial_dies): Change condition to assert.
struct type *type = value_type (args[i]);
int len = TYPE_LENGTH (type);
struct type *type = value_type (args[i]);
int len = TYPE_LENGTH (type);
- if (sparc64_structure_or_union_p (type))
+ if (sparc64_structure_or_union_p (type) ||
+ (sparc64_complex_floating_p (type) && len == 32))
{
/* Structure or Union arguments. */
if (len <= 16)
{
/* Structure or Union arguments. */
if (len <= 16)
- else if (sparc64_floating_p (type))
+ else if (sparc64_floating_p (type) || sparc64_complex_floating_p (type))
{
/* Floating arguments. */
{
/* Floating arguments. */
if (len == 16)
{
/* The psABI says that "Each quad-precision parameter
if (len == 16)
{
/* The psABI says that "Each quad-precision parameter
int regnum = -1;
gdb_byte buf[16];
int regnum = -1;
gdb_byte buf[16];
- if (sparc64_structure_or_union_p (type))
+ if (sparc64_structure_or_union_p (type) ||
+ (sparc64_complex_floating_p (type) && len == 32))
{
/* Structure or Union arguments. */
gdb_assert (len <= 16);
{
/* Structure or Union arguments. */
gdb_assert (len <= 16);
/* The psABI says "Each single-precision parameter value
will be assigned to one extended word in the
parameter array, and right-justified within that
/* The psABI says "Each single-precision parameter value
will be assigned to one extended word in the
parameter array, and right-justified within that
- word; the left half (even floatregister) is
+ word; the left half (even float register) is
undefined." Even though the psABI says that "the
left half is undefined", set it to zero here. */
memset (buf, 0, 4);
undefined." Even though the psABI says that "the
left half is undefined", set it to zero here. */
memset (buf, 0, 4);
}
else if (regnum >= SPARC64_Q0_REGNUM && regnum <= SPARC64_Q8_REGNUM)
{
}
else if (regnum >= SPARC64_Q0_REGNUM && regnum <= SPARC64_Q8_REGNUM)
{
- gdb_assert (element < 6);
+ gdb_assert (element < 5);
regnum = SPARC_O0_REGNUM + element;
regcache_cooked_write (regcache, regnum, valbuf);
regcache_cooked_write (regcache, regnum + 1, valbuf + 8);
regnum = SPARC_O0_REGNUM + element;
regcache_cooked_write (regcache, regnum, valbuf);
regcache_cooked_write (regcache, regnum + 1, valbuf + 8);
sparc64_extract_floating_fields (regcache, type, buf, 0);
memcpy (valbuf, buf, len);
}
sparc64_extract_floating_fields (regcache, type, buf, 0);
memcpy (valbuf, buf, len);
}
- else if (sparc64_floating_p (type))
+ else if (sparc64_floating_p (type) || sparc64_complex_floating_p (type))
{
/* Floating return values. */
for (i = 0; i < len / 4; i++)
{
/* Floating return values. */
for (i = 0; i < len / 4; i++)