2003-10-06 Andrew Cagney <cagney@redhat.com>
* ppc-sysv-tdep.c: Re-indent.
This commit is contained in:
parent
9f0a53037d
commit
944fcfab56
2 changed files with 60 additions and 66 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2003-10-06 Andrew Cagney <cagney@redhat.com>
|
||||||
|
|
||||||
|
* ppc-sysv-tdep.c: Re-indent.
|
||||||
|
|
||||||
2003-10-06 J. Brobecker <brobecker@gnat.com>
|
2003-10-06 J. Brobecker <brobecker@gnat.com>
|
||||||
|
|
||||||
* language.h (default_word_break_characters): Add prototype.
|
* language.h (default_word_break_characters): Add prototype.
|
||||||
|
|
|
@ -99,8 +99,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
|
||||||
char *val = VALUE_CONTENTS (arg);
|
char *val = VALUE_CONTENTS (arg);
|
||||||
|
|
||||||
if (TYPE_CODE (type) == TYPE_CODE_FLT
|
if (TYPE_CODE (type) == TYPE_CODE_FLT
|
||||||
&& ppc_floating_point_unit_p (current_gdbarch)
|
&& ppc_floating_point_unit_p (current_gdbarch) && len <= 8)
|
||||||
&& len <= 8)
|
|
||||||
{
|
{
|
||||||
/* Floating point value converted to "double" then
|
/* Floating point value converted to "double" then
|
||||||
passed in an FP register, when the registers run out,
|
passed in an FP register, when the registers run out,
|
||||||
|
@ -146,10 +145,8 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
|
||||||
argoffset += 8;
|
argoffset += 8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (len == 8
|
else if (len == 8 && (TYPE_CODE (type) == TYPE_CODE_INT /* long long */
|
||||||
&& (TYPE_CODE (type) == TYPE_CODE_INT /* long long */
|
|| (!ppc_floating_point_unit_p (current_gdbarch) && TYPE_CODE (type) == TYPE_CODE_FLT))) /* double */
|
||||||
|| (!ppc_floating_point_unit_p (current_gdbarch)
|
|
||||||
&& TYPE_CODE (type) == TYPE_CODE_FLT))) /* double */
|
|
||||||
{
|
{
|
||||||
/* "long long" or "double" passed in an odd/even
|
/* "long long" or "double" passed in an odd/even
|
||||||
register pair with the low addressed word in the odd
|
register pair with the low addressed word in the odd
|
||||||
|
@ -169,8 +166,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
|
||||||
{
|
{
|
||||||
if (write_pass)
|
if (write_pass)
|
||||||
regcache_cooked_write (regcache,
|
regcache_cooked_write (regcache,
|
||||||
tdep->ppc_gp0_regnum + greg,
|
tdep->ppc_gp0_regnum + greg, val);
|
||||||
val);
|
|
||||||
greg += 1;
|
greg += 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -192,8 +188,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
|
||||||
}
|
}
|
||||||
else if (len == 16
|
else if (len == 16
|
||||||
&& TYPE_CODE (type) == TYPE_CODE_ARRAY
|
&& TYPE_CODE (type) == TYPE_CODE_ARRAY
|
||||||
&& TYPE_VECTOR (type)
|
&& TYPE_VECTOR (type) && tdep->ppc_vr0_regnum >= 0)
|
||||||
&& tdep->ppc_vr0_regnum >= 0)
|
|
||||||
{
|
{
|
||||||
/* Vector parameter passed in an Altivec register, or
|
/* Vector parameter passed in an Altivec register, or
|
||||||
when that runs out, 16 byte aligned stack location. */
|
when that runs out, 16 byte aligned stack location. */
|
||||||
|
@ -201,8 +196,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
|
||||||
{
|
{
|
||||||
if (write_pass)
|
if (write_pass)
|
||||||
regcache_cooked_write (current_regcache,
|
regcache_cooked_write (current_regcache,
|
||||||
tdep->ppc_vr0_regnum + vreg,
|
tdep->ppc_vr0_regnum + vreg, val);
|
||||||
val);
|
|
||||||
vreg++;
|
vreg++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -215,8 +209,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
|
||||||
}
|
}
|
||||||
else if (len == 8
|
else if (len == 8
|
||||||
&& TYPE_CODE (type) == TYPE_CODE_ARRAY
|
&& TYPE_CODE (type) == TYPE_CODE_ARRAY
|
||||||
&& TYPE_VECTOR (type)
|
&& TYPE_VECTOR (type) && tdep->ppc_ev0_regnum >= 0)
|
||||||
&& tdep->ppc_ev0_regnum >= 0)
|
|
||||||
{
|
{
|
||||||
/* Vector parameter passed in an e500 register, or when
|
/* Vector parameter passed in an e500 register, or when
|
||||||
that runs out, 8 byte aligned stack location. Note
|
that runs out, 8 byte aligned stack location. Note
|
||||||
|
@ -229,8 +222,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
|
||||||
{
|
{
|
||||||
if (write_pass)
|
if (write_pass)
|
||||||
regcache_cooked_write (current_regcache,
|
regcache_cooked_write (current_regcache,
|
||||||
tdep->ppc_ev0_regnum + greg,
|
tdep->ppc_ev0_regnum + greg, val);
|
||||||
val);
|
|
||||||
greg++;
|
greg++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -275,8 +267,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
|
||||||
{
|
{
|
||||||
if (write_pass)
|
if (write_pass)
|
||||||
regcache_cooked_write (regcache,
|
regcache_cooked_write (regcache,
|
||||||
tdep->ppc_gp0_regnum + greg,
|
tdep->ppc_gp0_regnum + greg, word);
|
||||||
word);
|
|
||||||
greg++;
|
greg++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -359,8 +350,7 @@ ppc64_sysv_abi_return_value (struct type *valtype, struct regcache *regcache,
|
||||||
{
|
{
|
||||||
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
|
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
|
||||||
/* Floats and doubles in F1. */
|
/* Floats and doubles in F1. */
|
||||||
if (TYPE_CODE (valtype) == TYPE_CODE_FLT
|
if (TYPE_CODE (valtype) == TYPE_CODE_FLT && TYPE_LENGTH (valtype) <= 8)
|
||||||
&& TYPE_LENGTH (valtype) <= 8)
|
|
||||||
{
|
{
|
||||||
char regval[MAX_REGISTER_SIZE];
|
char regval[MAX_REGISTER_SIZE];
|
||||||
struct type *regtype = register_type (current_gdbarch, FP0_REGNUM);
|
struct type *regtype = register_type (current_gdbarch, FP0_REGNUM);
|
||||||
|
@ -376,8 +366,7 @@ ppc64_sysv_abi_return_value (struct type *valtype, struct regcache *regcache,
|
||||||
}
|
}
|
||||||
return RETURN_VALUE_REGISTER_CONVENTION;
|
return RETURN_VALUE_REGISTER_CONVENTION;
|
||||||
}
|
}
|
||||||
if (TYPE_CODE (valtype) == TYPE_CODE_INT
|
if (TYPE_CODE (valtype) == TYPE_CODE_INT && TYPE_LENGTH (valtype) <= 8)
|
||||||
&& TYPE_LENGTH (valtype) <= 8)
|
|
||||||
{
|
{
|
||||||
/* Integers in r3. */
|
/* Integers in r3. */
|
||||||
if (inval != NULL)
|
if (inval != NULL)
|
||||||
|
@ -426,8 +415,7 @@ ppc64_sysv_abi_return_value (struct type *valtype, struct regcache *regcache,
|
||||||
/* Big floating point values get stored in adjacent floating
|
/* Big floating point values get stored in adjacent floating
|
||||||
point registers. */
|
point registers. */
|
||||||
if (TYPE_CODE (valtype) == TYPE_CODE_FLT
|
if (TYPE_CODE (valtype) == TYPE_CODE_FLT
|
||||||
&& (TYPE_LENGTH (valtype) == 16
|
&& (TYPE_LENGTH (valtype) == 16 || TYPE_LENGTH (valtype) == 32))
|
||||||
|| TYPE_LENGTH (valtype) == 32))
|
|
||||||
{
|
{
|
||||||
if (inval || outval != NULL)
|
if (inval || outval != NULL)
|
||||||
{
|
{
|
||||||
|
@ -454,18 +442,22 @@ ppc64_sysv_abi_return_value (struct type *valtype, struct regcache *regcache,
|
||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
char regval[MAX_REGISTER_SIZE];
|
char regval[MAX_REGISTER_SIZE];
|
||||||
struct type *regtype = register_type (current_gdbarch, FP0_REGNUM);
|
struct type *regtype =
|
||||||
|
register_type (current_gdbarch, FP0_REGNUM);
|
||||||
if (inval != NULL)
|
if (inval != NULL)
|
||||||
{
|
{
|
||||||
convert_typed_floating ((const bfd_byte *) inval + i * (TYPE_LENGTH (valtype) / 2),
|
convert_typed_floating ((const bfd_byte *) inval +
|
||||||
|
i * (TYPE_LENGTH (valtype) / 2),
|
||||||
valtype, regval, regtype);
|
valtype, regval, regtype);
|
||||||
regcache_cooked_write (regcache, FP0_REGNUM + 1 + i, regval);
|
regcache_cooked_write (regcache, FP0_REGNUM + 1 + i,
|
||||||
|
regval);
|
||||||
}
|
}
|
||||||
if (outval != NULL)
|
if (outval != NULL)
|
||||||
{
|
{
|
||||||
regcache_cooked_read (regcache, FP0_REGNUM + 1 + i, regval);
|
regcache_cooked_read (regcache, FP0_REGNUM + 1 + i, regval);
|
||||||
convert_typed_floating (regval, regtype,
|
convert_typed_floating (regval, regtype,
|
||||||
(bfd_byte *) outval + i * (TYPE_LENGTH (valtype) / 2),
|
(bfd_byte *) outval +
|
||||||
|
i * (TYPE_LENGTH (valtype) / 2),
|
||||||
valtype);
|
valtype);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -473,8 +465,7 @@ ppc64_sysv_abi_return_value (struct type *valtype, struct regcache *regcache,
|
||||||
return RETURN_VALUE_REGISTER_CONVENTION;
|
return RETURN_VALUE_REGISTER_CONVENTION;
|
||||||
}
|
}
|
||||||
/* Big complex values get stored in f1:f4. */
|
/* Big complex values get stored in f1:f4. */
|
||||||
if (TYPE_CODE (valtype) == TYPE_CODE_COMPLEX
|
if (TYPE_CODE (valtype) == TYPE_CODE_COMPLEX && TYPE_LENGTH (valtype) == 32)
|
||||||
&& TYPE_LENGTH (valtype) == 32)
|
|
||||||
{
|
{
|
||||||
if (regcache != NULL)
|
if (regcache != NULL)
|
||||||
{
|
{
|
||||||
|
@ -503,8 +494,7 @@ ppc64_sysv_abi_use_struct_convention (int gcc_p, struct type *value_type)
|
||||||
|
|
||||||
void
|
void
|
||||||
ppc64_sysv_abi_extract_return_value (struct type *valtype,
|
ppc64_sysv_abi_extract_return_value (struct type *valtype,
|
||||||
struct regcache *regbuf,
|
struct regcache *regbuf, void *valbuf)
|
||||||
void *valbuf)
|
|
||||||
{
|
{
|
||||||
if (ppc64_sysv_abi_return_value (valtype, regbuf, NULL, valbuf)
|
if (ppc64_sysv_abi_return_value (valtype, regbuf, NULL, valbuf)
|
||||||
!= RETURN_VALUE_REGISTER_CONVENTION)
|
!= RETURN_VALUE_REGISTER_CONVENTION)
|
||||||
|
|
Loading…
Add table
Reference in a new issue