From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id 8181D3852C66 for ; Thu, 17 Nov 2022 20:15:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8181D3852C66 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=googlemail.com Received: by mail-wr1-x42e.google.com with SMTP id i12so1845851wrb.0 for ; Thu, 17 Nov 2022 12:15:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=fsI2UBmeBDVHG5KQ7CTttIOGOavIw2FE4DmSgNDDPQQ=; b=NE3K/T/Agm0j28QVYH46ynNVgt3c3PISz/LIbdShUJU5Kz/RHLfHa15ncSeNWWvnji 771LiEbneHX+5YO4/BCvZGc2CBdfO4Ei3W7YDhn7OOq6pWv72rqQea5J70IvxLufdShc kzBiY0NjB8X3Im8LH4Xk4b5h5jeICN/Iz6ipR/ExY2/RNTFamPDuWX19U4DSuUrXxsB6 7cQvybcCAHHoe5mvUvtU4Vcyl0xWMUPDaKFxxrFhzjdv/dpkD0grrLC9IvbqxT0mf4Bq U+dczj7PfnV950Gf/3JJTufPavHSCirYp9sEjtWA7x9fZW1uWuK3qb1ef1ekqnVDztSZ PZ1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fsI2UBmeBDVHG5KQ7CTttIOGOavIw2FE4DmSgNDDPQQ=; b=trvEYYYgtDK/wCDOHYx+JHO8HZASqgJ8UpldMVP+wB2LFBsFemoEWCbuUfIUb3DZ9v WaCeJUkiFmhBX42j1/yKEqXrr7g7bwzB2NIbqnjR++1r5TUonGqGUrHxtt4qcWSnLBkx aT+D6o9QylY9V4ngk9ZR9+zouaTYam9B0cn1xyIjwOav0Tigu5Q2U7ANqhQf1NsuHwGw VdRogIwFhaRq4GJBUGxrZakTfRsyIzWiJNd9oRIRUABiKbqbjwdmKsn+P33L5QPIzvLE wieKW72LE0FdXhlZhSKCNk4kwPe/LrM7tN2SzHQUBuWDT5TETp9s5GGsJylH8uiYXswV qdFA== X-Gm-Message-State: ANoB5pnU4lEBW+5g2mRo8Czp7emtPEbVo4ZhkUMaL99c8eklJbB6IXX8 XE1OgpnLtNs9dW+KaD748Sa+TRXzIbQb4gkZUbo= X-Google-Smtp-Source: AA0mqf4RJi1gGnOQVrwtDr3/QBRJpltNmDqAzvHOzX1Dyhf04ek4Mmb4W+fys+dBp7Y/JyIs9RxpDflr1xTJnwmKThY= X-Received: by 2002:a5d:408e:0:b0:22e:3397:2e96 with SMTP id o14-20020a5d408e000000b0022e33972e96mr2426203wrp.535.1668716129175; Thu, 17 Nov 2022 12:15:29 -0800 (PST) MIME-Version: 1.0 References: <4119381e-5b4e-5132-8822-e88f8fbb8fc1@foss.arm.com> In-Reply-To: From: Ramana Radhakrishnan Date: Thu, 17 Nov 2022 20:15:18 +0000 Message-ID: Subject: Re: [Patch Arm] Fix PR 92999 To: Richard Earnshaw Cc: gcc-patches , Richard Earnshaw , Alex Coplan Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_NUMSUBJECT,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, Nov 11, 2022 at 9:50 PM Ramana Radhakrishnan wrote: > > On Thu, Nov 10, 2022 at 7:46 PM Ramana Radhakrishnan > wrote: > > > > On Thu, Nov 10, 2022 at 6:03 PM Richard Earnshaw > > wrote: > > > > > > > > > > > > On 10/11/2022 17:21, Richard Earnshaw via Gcc-patches wrote: > > > > > > > > > > > > On 08/11/2022 18:20, Ramana Radhakrishnan via Gcc-patches wrote: > > > >> PR92999 is a case where the VFP calling convention does not allocate > > > >> enough FP registers for a homogenous aggregate containing FP16 values. > > > >> I believe this is the complete fix but would appreciate another set of > > > >> eyes on this. > > > >> > > > >> Could I get a hand with a regression test run on an armhf environment > > > >> while I fix my environment ? > > > >> > > > >> gcc/ChangeLog: > > > >> > > > >> PR target/92999 > > > >> * config/arm/arm.c (aapcs_vfp_allocate_return_reg): Adjust to handle > > > >> aggregates with elements smaller than SFmode. > > > >> > > > >> gcc/testsuite/ChangeLog: > > > >> > > > >> * gcc.target/arm/pr92999.c: New test. > > > >> > > > >> > > > >> Thanks, > > > >> Ramana > > > >> > > > >> Signed-off-by: Ramana Radhakrishnan > > > > > > > > I'm not sure about this. The AAPCS does not mention a base type of a > > > > half-precision FP type as an appropriate homogeneous aggregate for using > > > > VFP registers for either calling or returning. > > > > Ooh interesting, thanks for taking a look and poking at the AAPCS and > > that's a good catch. BF16 should also have the same behaviour as FP16 > > , I suspect ? > > I suspect I got caught out by the definition of the Homogenous > aggregate from Section 5.3.5 > ((https://github.com/ARM-software/abi-aa/blob/2982a9f3b512a5bfdc9e3fea5d3b298f9165c36b/aapcs32/aapcs32.rst#homogeneous-aggregates) > which simply suggests it's an aggregate of fundamental types which > lists half precision floating point . > > FTR, ideally I should have read 7.1.2.1 > https://github.com/ARM-software/abi-aa/blob/2982a9f3b512a5bfdc9e3fea5d3b298f9165c36b/aapcs32/aapcs32.rst#procedure-calling) > :) > > > > > > > > > > > > > So perhaps the bug is that we try to treat this as a homogeneous > > > > aggregate at all. > > > > Yep I agree - I'll take a look again tomorrow and see if I can get a fix. > > > > (And thanks Alex for the test run, I might trouble you again while I > > still (slowly) get some of my boards back up) > > > and as promised take 2. I'd really prefer another review on this one > to see if I've not missed anything in the cases below. Ping ? Ramana > > regards > Ramana > > > > > > regards, > > Ramana > > > > > > > > > > R.