Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Fernando Nasser <fnasser@redhat.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [rfa/arm] Eliminate REGISTER_CONVERTIBLE() from ARM
Date: Fri, 02 Nov 2001 11:24:00 -0000	[thread overview]
Message-ID: <3BF1518C.B0BE34F6@redhat.com> (raw)
In-Reply-To: <3BEDC5F9.5000104@cygnus.com>

Andrew Cagney wrote:
> 
> Hello,
> 
> The attatched eliminates the macros:
>         REGISTER_CONVERTIBLE()
>         REGISTER_CONVERT_TO_RAW()
>         REGISTER_CONVERT_TO_VIRTUAL()
> for the ARM target.  Instead REGISTER_VIRTUAL_TYPE() returns what I'm
> *guessing* is the true type of the register.
> 
> ok to commit?
> Andrew
> 

Andrew, I will have to apply your patch and run some tests.  And we need
to hear from the Linux/ARM folks as well.

Or have you run the testsuite against a, lets say, arm-elf target
already
(ARMulator is enough)?

Fernando



>   ------------------------------------------------------------------------
> 2001-11-10  Andrew Cagney  <ac131313@redhat.com>
> 
>         * arm-tdep.c (arm_register_type): New function.
>         (arm_register_convertible): Delete.
>         (arm_register_convert_to_virtual): Delete.
>         (arm_register_convert_to_raw): Delete.
>         * config/arm/tm-arm.h (REGISTER_CONVERTIBLE): Delete.
>         (REGISTER_CONVERT_TO_VIRTUAL): Delete.
>         (REGISTER_CONVERT_TO_RAW): Delete.
>         (REGISTER_VIRTUAL_TYPE): Redefine as call to arm_register_type.
>         (arm_register_type): Declare.
> 
> Index: arm-tdep.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/arm-tdep.c,v
> retrieving revision 1.16
> diff -p -r1.16 arm-tdep.c
> *** arm-tdep.c  2001/10/21 17:19:36     1.16
> --- arm-tdep.c  2001/11/11 00:20:27
> *************** arm_float_info (void)
> *** 1437,1442 ****
> --- 1437,1456 ----
>     print_fpu_flags (status);
>   }
> 
> + struct type *
> + arm_register_type (int regnum)
> + {
> +   if (regnum >= F0_REGNUM && regnum < F0_REGNUM + NUM_FREGS)
> +     {
> +       if (TARGET_BYTE_ORDER == BIG_ENDIAN)
> +       return builtin_type_arm_ext_big;
> +       else
> +       return builtin_type_arm_ext_littlebyte_bigword;
> +     }
> +   else
> +     return builtin_type_int32;
> + }
> +
>   /* NOTE: cagney/2001-08-20: Both convert_from_extended() and
>      convert_to_extended() use floatformat_arm_ext_littlebyte_bigword.
>      It is thought that this is is the floating-point register format on
> *************** convert_to_extended (void *dbl, void *pt
> *** 1464,1503 ****
>     else
>       floatformat_from_doublest (&floatformat_arm_ext_littlebyte_bigword,
>                                &d, dbl);
> - }
> -
> - /* Nonzero if register N requires conversion from raw format to
> -    virtual format.  */
> -
> - int
> - arm_register_convertible (unsigned int regnum)
> - {
> -   return ((regnum - F0_REGNUM) < 8);
> - }
> -
> - /* Convert data from raw format for register REGNUM in buffer FROM to
> -    virtual format with type TYPE in buffer TO.  */
> -
> - void
> - arm_register_convert_to_virtual (unsigned int regnum, struct type *type,
> -                                void *from, void *to)
> - {
> -   double val;
> -
> -   convert_from_extended (from, &val);
> -   store_floating (to, TYPE_LENGTH (type), val);
> - }
> -
> - /* Convert data from virtual format with type TYPE in buffer FROM to
> -    raw format for register REGNUM in buffer TO.  */
> -
> - void
> - arm_register_convert_to_raw (unsigned int regnum, struct type *type,
> -                            void *from, void *to)
> - {
> -   double val = extract_floating (from, TYPE_LENGTH (type));
> -
> -   convert_to_extended (&val, to);
>   }
> 
>   static int
> --- 1478,1483 ----
> Index: gdbarch.sh
> ===================================================================
> RCS file: /cvs/src/src/gdb/gdbarch.sh,v
> retrieving revision 1.92
> diff -p -r1.92 gdbarch.sh
> *** gdbarch.sh  2001/11/08 01:33:04     1.92
> --- gdbarch.sh  2001/11/11 00:20:39
> *************** do
> *** 334,339 ****
> --- 334,345 ----
> 
>         # If PRINT_P is empty, ``1'' is always used.
> 
> +     replaced_by ) : ;;
> +
> +       # An optional indicator of what has replaced this method
> +
> +       # If present the first use of the method will get a warning.
> +
>       description ) : ;;
> 
>         # Currently unused.
> Index: config/arm/tm-arm.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/config/arm/tm-arm.h,v
> retrieving revision 1.7
> diff -p -r1.7 tm-arm.h
> *** tm-arm.h    2001/07/04 19:57:53     1.7
> --- tm-arm.h    2001/11/11 00:20:43
> *************** extern char **arm_register_names;
> *** 268,302 ****
>   /* Largest value REGISTER_VIRTUAL_SIZE can have.  */
>   #define MAX_REGISTER_VIRTUAL_SIZE FP_REGISTER_VIRTUAL_SIZE
> 
> - /* Nonzero if register N requires conversion from raw format to
> -    virtual format. */
> - extern int arm_register_convertible (unsigned int);
> - #define REGISTER_CONVERTIBLE(REGNUM) (arm_register_convertible (REGNUM))
> -
> - /* Convert data from raw format for register REGNUM in buffer FROM to
> -    virtual format with type TYPE in buffer TO. */
> -
> - extern void arm_register_convert_to_virtual (unsigned int regnum,
> -                                            struct type *type,
> -                                            void *from, void *to);
> - #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
> -      arm_register_convert_to_virtual (REGNUM, TYPE, FROM, TO)
> -
> - /* Convert data from virtual format with type TYPE in buffer FROM to
> -    raw format for register REGNUM in buffer TO.  */
> -
> - extern void arm_register_convert_to_raw (unsigned int regnum,
> -                                        struct type *type,
> -                                        void *from, void *to);
> - #define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \
> -      arm_register_convert_to_raw (REGNUM, TYPE, FROM, TO)
> -
>   /* Return the GDB type object for the "standard" data type of data in
>      register N.  */
> 
> ! #define REGISTER_VIRTUAL_TYPE(N) \
> !      (((unsigned)(N) - F0_REGNUM) < NUM_FREGS \
> !       ? builtin_type_double : builtin_type_int)
> 
>   /* The system C compiler uses a similar structure return convention to gcc */
>   extern use_struct_convention_fn arm_use_struct_convention;
> --- 268,278 ----
>   /* Largest value REGISTER_VIRTUAL_SIZE can have.  */
>   #define MAX_REGISTER_VIRTUAL_SIZE FP_REGISTER_VIRTUAL_SIZE
> 
>   /* Return the GDB type object for the "standard" data type of data in
>      register N.  */
> 
> ! extern struct type *arm_register_type (int regnum);
> ! #define REGISTER_VIRTUAL_TYPE(N) arm_register_type (N)
> 
>   /* The system C compiler uses a similar structure return convention to gcc */
>   extern use_struct_convention_fn arm_use_struct_convention;

-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


       reply	other threads:[~2001-11-13 17:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3BEDC5F9.5000104@cygnus.com>
2001-11-02 11:24 ` Fernando Nasser [this message]
2001-11-02 18:46   ` Andrew Cagney
2001-11-05  9:10     ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3BF1518C.B0BE34F6@redhat.com \
    --to=fnasser@redhat.com \
    --cc=ac131313@cygnus.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox