+2014-02-04 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * ppc-sysv-tdep.c (ppc64_sysv_abi_push_freg): Use correct order
+ within a register pair holding a DFP 128-bit value on little-endian.
+ (ppc64_sysv_abi_return_value_base): Likewise.
+ * rs6000-tdep.c (dfp_pseudo_register_read): Likewise.
+ (dfp_pseudo_register_write): Likewise.
+
2014-02-04 Ulrich Weigand <uweigand@de.ibm.com>
* ppc-sysv-tdep.c (ppc64_sysv_abi_push_freg): Use correct
if (argpos->regcache && argpos->freg <= 12)
{
int regnum = tdep->ppc_fp0_regnum + argpos->freg;
+ int lopart = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG ? 8 : 0;
+ int hipart = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG ? 0 : 8;
- regcache_cooked_write (argpos->regcache, regnum, val);
- regcache_cooked_write (argpos->regcache, regnum + 1, val + 8);
+ regcache_cooked_write (argpos->regcache, regnum, val + hipart);
+ regcache_cooked_write (argpos->regcache, regnum + 1, val + lopart);
}
argpos->freg += 2;
&& TYPE_CODE (valtype) == TYPE_CODE_DECFLOAT)
{
int regnum = tdep->ppc_fp0_regnum + 2 + 2 * index;
+ int lopart = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG ? 8 : 0;
+ int hipart = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG ? 0 : 8;
if (writebuf != NULL)
{
- regcache_cooked_write (regcache, regnum, writebuf);
- regcache_cooked_write (regcache, regnum + 1, writebuf + 8);
+ regcache_cooked_write (regcache, regnum, writebuf + hipart);
+ regcache_cooked_write (regcache, regnum + 1, writebuf + lopart);
}
if (readbuf != NULL)
{
- regcache_cooked_read (regcache, regnum, readbuf);
- regcache_cooked_read (regcache, regnum + 1, readbuf + 8);
+ regcache_cooked_read (regcache, regnum, readbuf + hipart);
+ regcache_cooked_read (regcache, regnum + 1, readbuf + lopart);
}
return 1;
}
else
{
status = regcache_raw_read (regcache, tdep->ppc_fp0_regnum +
- 2 * reg_index + 1, buffer + 8);
+ 2 * reg_index + 1, buffer);
if (status == REG_VALID)
status = regcache_raw_read (regcache, tdep->ppc_fp0_regnum +
- 2 * reg_index, buffer);
+ 2 * reg_index, buffer + 8);
}
return status;
else
{
regcache_raw_write (regcache, tdep->ppc_fp0_regnum +
- 2 * reg_index + 1, buffer + 8);
+ 2 * reg_index + 1, buffer);
regcache_raw_write (regcache, tdep->ppc_fp0_regnum +
- 2 * reg_index, buffer);
+ 2 * reg_index, buffer + 8);
}
}