+2017-11-06 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * i386-tdep.c: Include "target-float.h". Do not include "doublest.h".
+ (i386_extract_return_value): Use target_float_convert.
+ (i386_store_return_value): Likewise.
+ * i387-tdep.c (i387_register_to_value): Use target_float_convert.
+ (i387_value_to_register): Likewise.
+ * ia64-tdep.c: Include "target-float.h". Do not include "doublest.h".
+ (ia64_register_to_value): Use target_float_convert.
+ (ia64_value_to_register): Likewise.
+ (ia64_extract_return_value): Likewise.
+ (ia64_store_return_value): Likewise.
+ (ia64_push_dummy_call): Likewise.
+ * m68k-tdep.c: Include "target-float.h".
+ (m68k_register_to_value): Use target_float_convert.
+ (m68k_value_to_register): Likewise.
+ (m68k_svr4_extract_return_value): Likewise.
+ (m68k_svr4_store_return_value): Likewise.
+ * ppc-sysv-tdep.c: Include "target-float.h".
+ (ppc_sysv_abi_push_dummy_call): Use target_float_convert.
+ (do_ppc_sysv_return_value): Likewise.
+ (ppc64_sysv_abi_push_freg): Likewise.
+ (ppc64_sysv_abi_return_value_base): Likewise.
+ * rs6000-aix-tdep.c: Include "target-float.h".
+ (rs6000_push_dummy_call): Use target_float_convert.
+ (rs6000_return_value): Likewise.
+ * rs6000-lynx178-tdep.c: Include "target-float.h".
+ (rs6000_lynx178_push_dummy_call): Use target_float_convert.
+ (rs6000_lynx178_return_value): Likewise.
+ * rs6000-tdep.c: Include "target-float.h". Do not include "doublest.h".
+ (rs6000_register_to_value): Use target_float_convert.
+ (rs6000_value_to_register): Likewise.
+ * arm-tdep.c: Include "target-float.h". Do not include "doublest.h".
+ (arm_extract_return_value): Use target_float_convert.
+ (arm_store_return_value): Likewise.
+ * sh-tdep.c: Include "target-float.h". Do not include "doublest.h".
+ (sh_register_convert_to_virtual): Use target_float_convert.
+ (sh_register_convert_to_raw): Likewise.
+ * sh64-tdep.c: Include "target-float.h".
+ (sh64_extract_return_value): Use target_float_convert.
+ (sh64_register_convert_to_virtual): Likewise.
+ (sh64_register_convert_to_raw): Likewise. Fix argument types.
+
2017-11-06 Ulrich Weigand <uweigand@de.ibm.com>
* target-float.c (floatformat_to_host_double): New function.
#include "disasm.h"
#include "regcache.h"
#include "reggroups.h"
-#include "doublest.h"
+#include "target-float.h"
#include "value.h"
#include "arch-utils.h"
#include "osabi.h"
bfd_byte tmpbuf[FP_REGISTER_SIZE];
regcache_cooked_read (regs, ARM_F0_REGNUM, tmpbuf);
- convert_typed_floating (tmpbuf, arm_ext_type (gdbarch),
- valbuf, type);
+ target_float_convert (tmpbuf, arm_ext_type (gdbarch),
+ valbuf, type);
}
break;
{
case ARM_FLOAT_FPA:
- convert_typed_floating (valbuf, type, buf, arm_ext_type (gdbarch));
+ target_float_convert (valbuf, type, buf, arm_ext_type (gdbarch));
regcache_cooked_write (regs, ARM_F0_REGNUM, buf);
break;
#include "command.h"
#include "dummy-frame.h"
#include "dwarf2-frame.h"
-#include "doublest.h"
#include "frame.h"
#include "frame-base.h"
#include "frame-unwind.h"
#include "symfile.h"
#include "symtab.h"
#include "target.h"
+#include "target-float.h"
#include "value.h"
#include "dis-asm.h"
#include "disasm.h"
exactly how it would happen on the target itself, but it is
the best we can do. */
regcache_raw_read (regcache, I386_ST0_REGNUM, buf);
- convert_typed_floating (buf, i387_ext_type (gdbarch), valbuf, type);
+ target_float_convert (buf, i387_ext_type (gdbarch), valbuf, type);
}
else
{
floating-point format used by the FPU. This is probably
not exactly how it would happen on the target itself, but
it is the best we can do. */
- convert_typed_floating (valbuf, type, buf, i387_ext_type (gdbarch));
+ target_float_convert (valbuf, type, buf, i387_ext_type (gdbarch));
regcache_raw_write (regcache, I386_ST0_REGNUM, buf);
/* Set the top of the floating-point register stack to 7. The
from, optimizedp, unavailablep))
return 0;
- convert_typed_floating (from, i387_ext_type (gdbarch), to, type);
+ target_float_convert (from, i387_ext_type (gdbarch), to, type);
*optimizedp = *unavailablep = 0;
return 1;
}
}
/* Convert from TYPE. */
- convert_typed_floating (from, type, to, i387_ext_type (gdbarch));
+ target_float_convert (from, type, to, i387_ext_type (gdbarch));
put_frame_register (frame, regnum, to);
}
\f
#include "frame.h"
#include "frame-base.h"
#include "frame-unwind.h"
-#include "doublest.h"
+#include "target-float.h"
#include "value.h"
#include "objfiles.h"
#include "elf/common.h" /* for DT_PLTGOT value */
in, optimizedp, unavailablep))
return 0;
- convert_typed_floating (in, ia64_ext_type (gdbarch), out, valtype);
+ target_float_convert (in, ia64_ext_type (gdbarch), out, valtype);
*optimizedp = *unavailablep = 0;
return 1;
}
{
struct gdbarch *gdbarch = get_frame_arch (frame);
gdb_byte out[IA64_FP_REGISTER_SIZE];
- convert_typed_floating (in, valtype, out, ia64_ext_type (gdbarch));
+ target_float_convert (in, valtype, out, ia64_ext_type (gdbarch));
put_frame_register (frame, regnum, out);
}
while (n-- > 0)
{
regcache_cooked_read (regcache, regnum, from);
- convert_typed_floating (from, ia64_ext_type (gdbarch),
- (char *)valbuf + offset, float_elt_type);
+ target_float_convert (from, ia64_ext_type (gdbarch),
+ valbuf + offset, float_elt_type);
offset += TYPE_LENGTH (float_elt_type);
regnum++;
}
while (n-- > 0)
{
- convert_typed_floating ((char *)valbuf + offset, float_elt_type,
- to, ia64_ext_type (gdbarch));
+ target_float_convert (valbuf + offset, float_elt_type,
+ to, ia64_ext_type (gdbarch));
regcache_cooked_write (regcache, regnum, to);
offset += TYPE_LENGTH (float_elt_type);
regnum++;
while (len > 0 && floatreg < IA64_FR16_REGNUM)
{
gdb_byte to[IA64_FP_REGISTER_SIZE];
- convert_typed_floating (value_contents (arg) + argoffset,
- float_elt_type, to,
- ia64_ext_type (gdbarch));
+ target_float_convert (value_contents (arg) + argoffset,
+ float_elt_type, to,
+ ia64_ext_type (gdbarch));
regcache_cooked_write (regcache, floatreg, to);
floatreg++;
argoffset += TYPE_LENGTH (float_elt_type);
#include "dis-asm.h"
#include "target-descriptions.h"
#include "floatformat.h"
+#include "target-float.h"
#include "m68k-tdep.h"
\f
from, optimizedp, unavailablep))
return 0;
- convert_typed_floating (from, fpreg_type, to, type);
+ target_float_convert (from, fpreg_type, to, type);
*optimizedp = *unavailablep = 0;
return 1;
}
}
/* Convert from TYPE. */
- convert_typed_floating (from, type, to, fpreg_type);
+ target_float_convert (from, type, to, fpreg_type);
put_frame_register (frame, regnum, to);
}
{
struct type *fpreg_type = register_type (gdbarch, M68K_FP0_REGNUM);
regcache_raw_read (regcache, M68K_FP0_REGNUM, buf);
- convert_typed_floating (buf, fpreg_type, valbuf, type);
+ target_float_convert (buf, fpreg_type, valbuf, type);
}
else if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_LENGTH (type) == 4)
regcache_raw_read (regcache, M68K_A0_REGNUM, valbuf);
{
struct type *fpreg_type = register_type (gdbarch, M68K_FP0_REGNUM);
gdb_byte buf[M68K_MAX_REGISTER_SIZE];
- convert_typed_floating (valbuf, type, buf, fpreg_type);
+ target_float_convert (valbuf, type, buf, fpreg_type);
regcache_raw_write (regcache, M68K_FP0_REGNUM, buf);
}
else if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_LENGTH (type) == 4)
#include "objfiles.h"
#include "infcall.h"
#include "dwarf2.h"
+#include "target-float.h"
#include <algorithm>
gdb_byte regval[PPC_MAX_REGISTER_SIZE];
struct type *regtype
= register_type (gdbarch, tdep->ppc_fp0_regnum + freg);
- convert_typed_floating (val, type, regval, regtype);
+ target_float_convert (val, type, regval, regtype);
regcache_cooked_write (regcache,
tdep->ppc_fp0_regnum + freg,
regval);
gdb_byte regval[PPC_MAX_REGISTER_SIZE];
struct type *regtype
= register_type (gdbarch, regnum);
- convert_typed_floating (elval, eltype,
- regval, regtype);
+ target_float_convert (elval, eltype,
+ regval, regtype);
regcache_cooked_write (regcache, regnum, regval);
}
freg++;
struct type *regtype = register_type (gdbarch,
tdep->ppc_fp0_regnum + 1);
regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 1, regval);
- convert_typed_floating (regval, regtype, readbuf, type);
+ target_float_convert (regval, regtype, readbuf, type);
}
if (writebuf)
{
the register's "double" type. */
gdb_byte regval[PPC_MAX_REGISTER_SIZE];
struct type *regtype = register_type (gdbarch, tdep->ppc_fp0_regnum);
- convert_typed_floating (writebuf, type, regval, regtype);
+ target_float_convert (writebuf, type, regval, regtype);
regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1, regval);
}
return RETURN_VALUE_REGISTER_CONVENTION;
if (writebuf != NULL)
{
- convert_typed_floating (writebuf + offset, eltype,
- regval, regtype);
+ target_float_convert (writebuf + offset, eltype,
+ regval, regtype);
regcache_cooked_write (regcache, regnum, regval);
}
if (readbuf != NULL)
{
regcache_cooked_read (regcache, regnum, regval);
- convert_typed_floating (regval, regtype,
- readbuf + offset, eltype);
+ target_float_convert (regval, regtype,
+ readbuf + offset, eltype);
}
}
else
struct type *regtype = register_type (gdbarch, regnum);
gdb_byte regval[PPC_MAX_REGISTER_SIZE];
- convert_typed_floating (val, type, regval, regtype);
+ target_float_convert (val, type, regval, regtype);
regcache_cooked_write (argpos->regcache, regnum, regval);
}
if (writebuf != NULL)
{
- convert_typed_floating (writebuf, valtype, regval, regtype);
+ target_float_convert (writebuf, valtype, regval, regtype);
regcache_cooked_write (regcache, regnum, regval);
}
if (readbuf != NULL)
{
regcache_cooked_read (regcache, regnum, regval);
- convert_typed_floating (regval, regtype, readbuf, valtype);
+ target_float_convert (regval, regtype, readbuf, valtype);
}
return 1;
}
#include "xcoffread.h"
#include "solib.h"
#include "solib-aix.h"
+#include "target-float.h"
#include "xml-utils.h"
/* If the kernel has to deliver a signal, it pushes a sigcontext
gdb_assert (len <= 8);
- convert_typed_floating (value_contents (arg), type,
- reg_val, reg_type);
+ target_float_convert (value_contents (arg), type, reg_val, reg_type);
regcache_cooked_write (regcache, fp_regnum, reg_val);
++f_argno;
}
if (readbuf)
{
regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 1, regval);
- convert_typed_floating (regval, regtype, readbuf, valtype);
+ target_float_convert (regval, regtype, readbuf, valtype);
}
if (writebuf)
{
- convert_typed_floating (writebuf, valtype, regval, regtype);
+ target_float_convert (writebuf, valtype, regval, regtype);
regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1, regval);
}
#include "gdbtypes.h"
#include "infcall.h"
#include "ppc-tdep.h"
+#include "target-float.h"
#include "value.h"
#include "xcoffread.h"
gdb_assert (len <= 8);
- convert_typed_floating (value_contents (arg), type,
- reg_val, reg_type);
+ target_float_convert (value_contents (arg), type, reg_val, reg_type);
regcache_cooked_write (regcache, fp_regnum, reg_val);
++f_argno;
}
if (readbuf)
{
regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 1, regval);
- convert_typed_floating (regval, regtype, readbuf, valtype);
+ target_float_convert (regval, regtype, readbuf, valtype);
}
if (writebuf)
{
- convert_typed_floating (writebuf, valtype, regval, regtype);
+ target_float_convert (writebuf, valtype, regval, regtype);
regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1, regval);
}
#include "arch-utils.h"
#include "regcache.h"
#include "regset.h"
-#include "doublest.h"
+#include "target-float.h"
#include "value.h"
#include "parser-defs.h"
#include "osabi.h"
from, optimizedp, unavailablep))
return 0;
- convert_typed_floating (from, builtin_type (gdbarch)->builtin_double,
- to, type);
+ target_float_convert (from, builtin_type (gdbarch)->builtin_double,
+ to, type);
*optimizedp = *unavailablep = 0;
return 1;
}
gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT);
- convert_typed_floating (from, type,
- to, builtin_type (gdbarch)->builtin_double);
+ target_float_convert (from, type,
+ to, builtin_type (gdbarch)->builtin_double);
put_frame_register (frame, regnum, to);
}
#include "inferior.h"
#include "arch-utils.h"
#include "regcache.h"
-#include "doublest.h"
+#include "target-float.h"
#include "osabi.h"
#include "reggroups.h"
#include "regset.h"
}
if (regnum >= DR0_REGNUM && regnum <= DR_LAST_REGNUM)
- convert_typed_floating (from, sh_littlebyte_bigword_type (gdbarch),
- to, type);
+ target_float_convert (from, sh_littlebyte_bigword_type (gdbarch),
+ to, type);
else
error
("sh_register_convert_to_virtual called with non DR register number");
}
if (regnum >= DR0_REGNUM && regnum <= DR_LAST_REGNUM)
- convert_typed_floating (from, type,
- to, sh_littlebyte_bigword_type (gdbarch));
+ target_float_convert (from, type,
+ to, sh_littlebyte_bigword_type (gdbarch));
else
error (_("sh_register_convert_to_raw called with non DR register number"));
}
#include "osabi.h"
#include "target-float.h"
#include "valprint.h"
+#include "target-float.h"
#include "elf-bfd.h"
gdb_byte buf[8];
regcache_cooked_read (regcache, DR0_REGNUM, buf);
- convert_typed_floating (buf, sh64_littlebyte_bigword_type (gdbarch),
- valbuf, type);
+ target_float_convert (buf, sh64_littlebyte_bigword_type (gdbarch),
+ valbuf, type);
}
}
else
&& regnum <= DR_LAST_REGNUM)
|| (regnum >= DR0_C_REGNUM
&& regnum <= DR_LAST_C_REGNUM))
- convert_typed_floating (from, sh64_littlebyte_bigword_type (gdbarch),
- to, type);
+ target_float_convert (from, sh64_littlebyte_bigword_type (gdbarch),
+ to, type);
else
error (_("sh64_register_convert_to_virtual "
"called with non DR register number"));
static void
sh64_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type,
- int regnum, const void *from, void *to)
+ int regnum, const gdb_byte *from, gdb_byte *to)
{
if (gdbarch_byte_order (gdbarch) != BFD_ENDIAN_LITTLE)
{
&& regnum <= DR_LAST_REGNUM)
|| (regnum >= DR0_C_REGNUM
&& regnum <= DR_LAST_C_REGNUM))
- convert_typed_floating (from, type,
- to, sh64_littlebyte_bigword_type (gdbarch));
+ target_float_convert (from, type,
+ to, sh64_littlebyte_bigword_type (gdbarch));
else
error (_("sh64_register_convert_to_raw called "
"with non DR register number"));