This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC][03/19] Target FP: Complete tdep move to convert_typed_floating
- From: Simon Marchi <simon dot marchi at polymtl dot ca>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 20 Sep 2017 09:35:26 +0200
- Subject: Re: [RFC][03/19] Target FP: Complete tdep move to convert_typed_floating
- Authentication-results: sourceware.org; auth=none
- References: <20170905182045.22009D8086F@oc3748833570.ibm.com>
On 2017-09-05 20:20, Ulrich Weigand wrote:
[RFC][03/19] Target FP: Complete tdep move to convert_typed_floating
Many tdep files need to perform conversions between two floating-point
types, usually when accessing FP registers. Most targets now use the
convert_typed_floating helper routine to do so. However, a small
number
still use the old method of converting via a DOUBLEST. Since we want
to get rid of DOUBLEST, these targets need to be moves to the new
method as well.
The main obstacle is that for convert_typed_floating we need an actual
*type*, not just a floatformat.
In arm-tdep.c, this is very straightforward, since there is already a
type using the ARM extended floatformat.
For sh-tdep.c and sh64-tdep.c, no such type already exists, so I've
added one to the gdbarch_tdep struct as done on other targets.
So far the patches look like good cleanups on their own own,
independently of the rest of the series.
Index: binutils-gdb/gdb/sh-tdep.c
===================================================================
--- binutils-gdb.orig/gdb/sh-tdep.c
+++ binutils-gdb/gdb/sh-tdep.c
@@ -33,7 +33,6 @@
#include "dis-asm.h"
#include "inferior.h"
#include "arch-utils.h"
-#include "floatformat.h"
#include "regcache.h"
#include "doublest.h"
#include "osabi.h"
@@ -1552,6 +1551,19 @@ sh_register_reggroup_p (struct gdbarch *
The other pseudo registers (the FVs) also don't pose a problem
because they are stored as 4 individual FP elements. */
+static struct type *
+sh_littlebyte_bigword_type (struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ if (!tdep->sh_littlebyte_bigword_type)
Nit, use == NULL.
+ tdep->sh_littlebyte_bigword_type
+ = arch_float_type (gdbarch, -1,
"builtin_type_sh_littlebyte_bigword",
+ floatformats_arm_ext);
This refers to arm, is it right?
Same comments for sh64.
Thanks,
Simon