From: Yao Qi <yao@codesourcery.com>
To: Will Newton <will.newton@linaro.org>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Support _Complex in hard-VFP abi
Date: Tue, 19 Aug 2014 13:16:00 -0000 [thread overview]
Message-ID: <53F34D56.5050705@codesourcery.com> (raw)
In-Reply-To: <CANu=Dmizt9SZmfLO=_yO6pwThFu+oAh8bbjPtXFAcmGDB+2amQ@mail.gmail.com>
On 08/11/2014 09:12 PM, Will Newton wrote:
>> - array). Vectors and complex types are not currently supported,
>> > - matching the generic AAPCS support. */
>> > + array). Vectors types are not currently supported, matching the
> This should be "Vector types".
>
Fixed.
>> > + generic AAPCS support. */
>> >
>> > static int
>> > arm_vfp_cprc_sub_candidate (struct type *t,
>> > @@ -3589,6 +3589,36 @@ arm_vfp_cprc_sub_candidate (struct type *t,
>> > }
>> > break;
>> >
>> > + case TYPE_CODE_COMPLEX:
>> > + /* Arguments of complex T where T is one of the types float or
>> > + double get treated as if they are implemented as:
>> > +
>> > + struct complexT
>> > + {
>> > + T real;
>> > + T imag;
>> > + };*/
> A line break before closing the comment might look nicer here.
>
I add two spaces before closing the comment, because we don't move
"*/" to a separated line. Patch was approved by Joel, and is pushed
in.
--
Yao (é½å°§)
Subject: [PATCH] Support _Complex in hard-VFP abi
Hi,
When we pass "-mfloat-abi=hard" flag in the GDB testing, we see the
following fails,
FAIL: gdb.base/callfuncs.exp: p t_float_complex_values(fc1, fc2)
FAIL: gdb.base/callfuncs.exp: p t_float_complex_many_args(fc1, fc2, fc3, fc4, fc1, fc2, fc3, fc4, fc1, fc2, fc3, fc4, fc1, fc2, fc3, fc4)
FAIL: gdb.base/callfuncs.exp: p t_double_complex_values(dc1, dc2)
FAIL: gdb.base/callfuncs.exp: p t_double_complex_many_args(dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4)
FAIL: gdb.base/callfuncs.exp: p t_long_double_complex_values(ldc1, ldc2)
FAIL: gdb.base/callfuncs.exp: p t_long_double_complex_many_args(ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4)
FAIL: gdb.base/callfuncs.exp: call inferior func with struct - returns float _Complex
FAIL: gdb.base/callfuncs.exp: call inferior func with struct - returns double _Complex
The hard-VFP ABI was supported by GDB overal, done by this patch
https://sourceware.org/ml/gdb-patches/2009-07/msg00686.html but
"vectors and complex types are not currently supported", mentioned in
the patch. As a result, these tests fail.
This patch is to support _Complex types in hard-VFP abi. As specified
in "7.1.1, Procedure Call Standard for the ARM Arch", the layout of
_Complex types is a struct, which is identical to the layout on amd64,
so I copy Mark's comments to amd64 support.
Regression tested on arm-none-eabi target. OK to apply?
gdb:
2014-08-19 Yao Qi <yao@codesourcery.com>
* arm-tdep.c (arm_vfp_cprc_sub_candidate): Handle _Complex
types.
---
gdb/ChangeLog | 5 +++++
gdb/arm-tdep.c | 34 ++++++++++++++++++++++++++++++++--
2 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7c3c582..8789fe8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2014-08-19 Yao Qi <yao@codesourcery.com>
+
+ * arm-tdep.c (arm_vfp_cprc_sub_candidate): Handle _Complex
+ types.
+
2014-08-19 Alan Modra <amodra@gmail.com>
* acinclude.m4 (GDB_AC_CHECK_BFD): Don't add -ldl.
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index b6ec456..2e2d6fd 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -3557,8 +3557,8 @@ arm_vfp_cprc_reg_char (enum arm_vfp_cprc_base_type b)
classified from *BASE_TYPE, or two types differently classified
from each other, return -1, otherwise return the total number of
base-type elements found (possibly 0 in an empty structure or
- array). Vectors and complex types are not currently supported,
- matching the generic AAPCS support. */
+ array). Vector types are not currently supported, matching the
+ generic AAPCS support. */
static int
arm_vfp_cprc_sub_candidate (struct type *t,
@@ -3589,6 +3589,36 @@ arm_vfp_cprc_sub_candidate (struct type *t,
}
break;
+ case TYPE_CODE_COMPLEX:
+ /* Arguments of complex T where T is one of the types float or
+ double get treated as if they are implemented as:
+
+ struct complexT
+ {
+ T real;
+ T imag;
+ }; */
+ switch (TYPE_LENGTH (t))
+ {
+ case 8:
+ if (*base_type == VFP_CPRC_UNKNOWN)
+ *base_type = VFP_CPRC_SINGLE;
+ else if (*base_type != VFP_CPRC_SINGLE)
+ return -1;
+ return 2;
+
+ case 16:
+ if (*base_type == VFP_CPRC_UNKNOWN)
+ *base_type = VFP_CPRC_DOUBLE;
+ else if (*base_type != VFP_CPRC_DOUBLE)
+ return -1;
+ return 2;
+
+ default:
+ return -1;
+ }
+ break;
+
case TYPE_CODE_ARRAY:
{
int count;
--
1.9.3
next prev parent reply other threads:[~2014-08-19 13:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-11 12:56 Yao Qi
2014-08-11 13:12 ` Will Newton
2014-08-19 13:16 ` Yao Qi [this message]
2014-08-19 22:44 ` Pedro Alves
2014-08-20 3:46 ` Yao Qi
2014-08-20 8:21 ` Pedro Alves
2014-08-20 10:26 ` Yao Qi
2014-08-19 0:55 ` Yao Qi
2014-08-19 7:00 ` Joel Brobecker
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=53F34D56.5050705@codesourcery.com \
--to=yao@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=will.newton@linaro.org \
/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