From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14500 invoked by alias); 11 Aug 2014 13:12:21 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 14490 invoked by uid 89); 11 Aug 2014 13:12:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ie0-f171.google.com Received: from mail-ie0-f171.google.com (HELO mail-ie0-f171.google.com) (209.85.223.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 11 Aug 2014 13:12:19 +0000 Received: by mail-ie0-f171.google.com with SMTP id at1so9812681iec.30 for ; Mon, 11 Aug 2014 06:12:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=UhOEmkwaNrhVAnqOUQO9++DEY9BwwjAKbbS+fpGy99I=; b=NITXXgvBG8RxSaiXbOPQ/+p6GHa891HSPTm9RZ5rgZN2qoeslGCgpm8deWbDyoA7tt 8ROW+JkTCRt0R2ONwSag9GA+05mO5bIJ6aDZNVPFgq2sZ8LK8729ZbM2Pds7ADY5fEKT 5CgTgKogx7B87uI6ugp2Y0xu42IvqAM6QfG87ILV7iYwoBUMQrTnRgJp4V6T1yH+viIo 3vOkNUXOqFZj0LH8NO4bW6dCEprTxxOqRjNvAHmY6LYd7Mkz4jfN5gNpkLLGq1EZsQ64 M6bzWBhv09aIl1amHymN63mJRjR6QVkaXPIVpQ6xvjAGxZp9pnFqydAykPVh12/iCPJD LbRg== X-Gm-Message-State: ALoCoQkiUy9o6X75Q/pgLXQMvghpSKikT2bIHwoa0hiAFsuZYOdaCcowSEPHAmzVHVy8b9yr2ztT MIME-Version: 1.0 X-Received: by 10.42.214.207 with SMTP id hb15mr32768404icb.30.1407762737347; Mon, 11 Aug 2014 06:12:17 -0700 (PDT) Received: by 10.64.142.116 with HTTP; Mon, 11 Aug 2014 06:12:17 -0700 (PDT) In-Reply-To: <1407761487-9251-1-git-send-email-yao@codesourcery.com> References: <1407761487-9251-1-git-send-email-yao@codesourcery.com> Date: Mon, 11 Aug 2014 13:12:00 -0000 Message-ID: Subject: Re: [PATCH] Support _Complex in hard-VFP abi From: Will Newton To: Yao Qi Cc: "gdb-patches@sourceware.org" Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg00183.txt.bz2 On 11 August 2014 13:51, Yao Qi wrote: > 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-11 Yao Qi > > * arm-tdep.c (arm_vfp_cprc_sub_candidate): Handle _Complex > types. > --- > gdb/arm-tdep.c | 34 ++++++++++++++++++++++++++++++++-- > 1 file changed, 32 insertions(+), 2 deletions(-) Apart from a couple of minor nits below this looks ok to me. > diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c > index b6ec456..10e74cf 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). Vectors types are not currently supported, matching the This should be "Vector types". > + 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. > + 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.0 > -- Will Newton Toolchain Working Group, Linaro