From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id A0FB63858D1E for ; Thu, 19 Oct 2023 21:49:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A0FB63858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A0FB63858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697752172; cv=none; b=tsRMSKfH4m7kRd3w0MagGINMjD7fd2nZaDdOPWuQdYyyRDzBiwnEIJe83upeAYGbK4ZX0qgiFOb6u0n0juEkYWtDt3GrTS3lvGukFNvqaG0s8GZjqxvnhWT7yeCRQcn6aZg+Skaz9SRFv1jFIqV9LrJvzTut7R6kOLXXOYGL+eY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697752172; c=relaxed/simple; bh=PKWryxkQtUMdU5/5yEMvSG4o1YN9DeTKkoiTEQfzFIU=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=bjKbeyjPzqbqdlSM87iNtcuUA0hJx3iGtemUjuZq7fWAiuHoL115ZjbH1pV5Y2VUXWmQA2y8FY2elqMNkil1aoX+23pWULmAe6kkEPx88fXmrXsRVEGkyX3U7AvWMr4Hr4zoW/bkkgf2tzgz2RBvJfTgw3J/PPHLigkLmCaNxLE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6D5C22F4; Thu, 19 Oct 2023 14:50:12 -0700 (PDT) Received: from localhost (unknown [10.32.110.65]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E59053F5A1; Thu, 19 Oct 2023 14:49:30 -0700 (PDT) From: Richard Sandiford To: Iain Sandoe Mail-Followup-To: Iain Sandoe ,GCC Development , richard.sandiford@arm.com Cc: GCC Development Subject: Re: Arm assembler crc issue References: <57A1A46D-12B5-4AC3-8E44-7D952B056E5F@sandoe.co.uk> Date: Thu, 19 Oct 2023 22:49:29 +0100 In-Reply-To: <57A1A46D-12B5-4AC3-8E44-7D952B056E5F@sandoe.co.uk> (Iain Sandoe's message of "Thu, 19 Oct 2023 17:41:24 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.9 required=5.0 tests=BAYES_00,KAM_DMARC_NONE,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_NONE,SPF_NONE,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: Iain Sandoe writes: > Hi Richard, > > > I am being bitten by a problem that falls out from the code that emits > > .arch Armv8.n-a+crc > > when the arch is less than Armv8-r. > The code that does this, in gcc/common/config/aarch64 is quite recent (2= 022-09). Heh. A workaround for one assembler bug triggers another assembler bug. The special treatment of CRC is much older than 2022-09 though. I think it dates back to 04a99ebecee885e42e56b6e0c832570e2a91c196 (2016-04), with 4ca82fc9f86fc1187ee112e3a637cb3ca5d2ef2a providing the more complete explanation. > > ------ > > (I admit the permutations are complex and I might have miss-analyzed) - b= ut it appears that llvm assembler (for mach-o, at least) sees an explict me= ntion of an attribute for a feature which is mandatory at a specified arch = level as demoting that arch to the minimum that made the explicit feature m= andatory. Of course, it could just be a bug in the handling of transitive = feature enables... > > the problem is that, for example: > > .arch Armv8.4-a+crc > > no longer recognises fp16 insns. (and appending +fp16 does not fix this). > > =3D=3D=3D=3D > > Even if upstream LLVM is deemed to be buggy (it does not do what I would = expect, at least), and fixed - I will still have a bunch of assembler versi= ons that are broken (before the fix percolates through to downstream xcode)= - and the LLVM assembler is the only current option for Darwin. > > So, it seems that this ought to be a reasonable configure test: > > .arch armv8.2-a > .text > m: > crc32b w0, w1, w2=20 > > and then emit HAS_GAS_AARCH64_CRC_BUG (for example) if that fails to asse= mble which can be used to make the +crc emit conditional on a broken assemb= ler. AIUI the problem was in the CPU descriptions, so I don't think this would test for the old gas bug that is being worked around. Perhaps instead we could have a configure test for the bug that you've found, and disable the crc workaround if so? Thanks, Richard > > - I am asking here before constructing the patch, in case there=E2=80=99s= some reason that doing this at configure time is not acceptable. > > thanks > Iain