From patchwork Thu Oct 26 19:31:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 158667 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp124944vqb; Thu, 26 Oct 2023 12:39:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE/01HbxvSlZeLvIP6RFZjJzwtOW18SieyR8BpLWtCUEYLViwmzvMJkTbSnZ378FRSGOPdO X-Received: by 2002:a05:620a:4089:b0:774:3436:aa22 with SMTP id f9-20020a05620a408900b007743436aa22mr285452qko.5.1698349177332; Thu, 26 Oct 2023 12:39:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698349177; cv=pass; d=google.com; s=arc-20160816; b=CL0BI9g3J4j6eVPOvoKWAX77HcuHr6J27yEaEr9fVttxg+cP+OYJmvgE1nOCUJVkNy aVUezARUUfO2c5vAAop7U722NP7VTsPKq2Ova6qfwlmqbuVy+ku2dfXeJWZiIgWHh6Np dnnqbQti4+LU0frUP8KPZAZ/5cRkb95+je3kMziuove+rafOlfhj8NrQVWlnqso0D8FD 8DuksDkMBB8aaVp0wxUEO0IJl+F17vF4XfQMPFm+W97a3x1GW40IoZISU7SRnMHTM9vr m23PvRy2eNNYzfDQ1GlDk50c3OT20K3nGdClOZ3IBrCyGelN8ZXecTFUwkqlsSUTLVVd f37g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:reply-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=Vtfm4L5hCicMYx8B1iRsSEiyof3ABnObbPaps8fphC4=; fh=B058kuIemY9jTFn+fyVjo2rs7zVVRS/qgH481EZMj9A=; b=P761NZiVTk4GS4nz8+ZToDf9bWTHCcL711lfpGBMSejQIZxGrhg2iul4pwou8/n20u 6At82VY4QXpAQzBMjW55sxRgw1RtdaEKgfcCFMYK5Q+eNPzlaV825esihnjxE0GkxTPt 1HQbQ0/AzUA6Uhwwutn57bf+4j6nTQP7jirwHK8viyJCvpfUhg2C+LbigvS+u2QVu0qT zFVtcPHVOXnjMzkfNmg1eAYNRZDVPhR7G48aM5g4M0IFrjs+WJNLYx5rUq7ordvyEI7a p09GmOm4r/J5CNMIlWgzojIr2eVoGDEWkGiz9EMsu2giF+TYvJlJ7pijnEXcwnlBeAc3 BsbQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=l1JYjqUE; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id d18-20020a05620a137200b007742c5c5584si9614177qkl.465.2023.10.26.12.39.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 12:39:37 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=l1JYjqUE; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1CB413858C36 for ; Thu, 26 Oct 2023 19:39:37 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id 351FD3858C41 for ; Thu, 26 Oct 2023 19:39:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 351FD3858C41 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 351FD3858C41 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698349152; cv=none; b=krzOXPi2nd8rHfnpKPZRKQ4KahXxkwkhF5iXIyQk2pmWJifwkC8Xayr+5LTQTBKMHFuLWt6jbw+r8lhvrBJ5tAYRfYZH+dZ/sbM0zs4/22UdrAdqdPRyYtdk+D7OKzMaEQeJcx05axrBkO29lzS8Bm/oecjo0SzLJREEBi8mLaQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698349152; c=relaxed/simple; bh=eW0u0bH/fy8r6GITBbbRECBrH4whKWZXx9U4X8/JIKI=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=udJz2y4axvwabLPIOe12GgF3OrcD/rfuszkffTMF/XoA1zraIEamqsX2OIYZmdBYTip/z97eL+zZk/+vXOBYjzzz6fOqWikKM7hkkU9WDP/c/yn2UP0A263KRYjv0jnoedp0zftCzpZwCo0Mlo0I7IF/cjER4Pds2rlQTC1RrB0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-31f71b25a99so813464f8f.2 for ; Thu, 26 Oct 2023 12:39:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698349150; x=1698953950; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=Vtfm4L5hCicMYx8B1iRsSEiyof3ABnObbPaps8fphC4=; b=l1JYjqUEB8mXpNO1J7HTRgNu3dI8mH7cuPXJOUEzDNd4YI2MuRwy9k2paX3SmzDieJ motolI9zCJdpn4vu+qEMhu74n2iQT6fOz60L4Z6+5dtqplSNjtF3f/yb/3vOF8V32/fX cPqKwcWeTpPUUygfwEk0tDOUpBGmJ1hIt7IlGzip3JGR4CqUH64lDqPhqA2l+4UonvcX jQCci4rSq6fYlcVXc1uz70VM5utANYvDCzYAPsHycwWd87dtR7sD0uxA/INHOPvpilpN I9+qFFrAUeQCwi5nwo07EYzP52QLRHNWSNl6d1unY1BG5d83FMHlZlpb1Rwr0WFTr+jv n6nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698349150; x=1698953950; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Vtfm4L5hCicMYx8B1iRsSEiyof3ABnObbPaps8fphC4=; b=sP9NdVNrq9xGUmrPo2DNOm4/MA9HNxsw9DYulrXXDPp0xIBnFqmzoAc882OhOXp9oY x59ce3jZwO8baijCCDXDS7LLPhsvbM7tEDmP4fJ8z5iAlT9X40sWJ/6bluGAYnbEmEna SYTd4hiR62lXINcBgS2/BwDLy8yMg1TrB0qDK+ula4b0J2xc3qhDkGgGTN22Flj6ENMG 1LVDZzybE4y4qU34Ol5OXWVCT8rW8KvXFf0AcPK34q9HLdpcJaQ8yWy09WFsIlFi+TEC kteO5BXcdfoMixrIimj/DFFi2JQqG2n6EwxYmGb6RGNVYbtDSxvRNxvtoRqxDbNXjnWr KX7w== X-Gm-Message-State: AOJu0YwGDEjZndApXSd9DIxY3Z4TOI9xuhrxOi1eUbLCGg3ggSFm42Gf mPwQAUUqlVOoS65BmiGFzWseJuHps50= X-Received: by 2002:a2e:a99f:0:b0:2c5:40a:5d92 with SMTP id x31-20020a2ea99f000000b002c5040a5d92mr519191ljq.28.1698348666025; Thu, 26 Oct 2023 12:31:06 -0700 (PDT) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id o2-20020a05600c378200b004083a105f27sm3263222wmr.26.2023.10.26.12.31.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 26 Oct 2023 12:31:05 -0700 (PDT) From: Iain Sandoe X-Google-Original-From: Iain Sandoe To: gcc-patches@gcc.gnu.org Cc: richard.sandiford@arm.com Subject: [PATCH] aarch64: Make assembler bug workaround configurable. Date: Thu, 26 Oct 2023 20:31:04 +0100 Message-Id: <20231026193104.58627-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.39.2 (Apple Git-143) MIME-Version: 1.0 X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: iain@sandoe.co.uk Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780848186774588683 X-GMAIL-MSGID: 1780848186774588683 This is an enablement patch (the initial use comes with the Darwin aarch64 port). Tested on aarch64-linux-gnu, aarch64-apple-darwin and x86_64-darwin just for good measure, OK for trunk? thanks Iain. --- 8< --- Some assmblers have a bug that requires +crc to be emitted even though the base architecture supports it. However, that also triggers a different bug in another assembler. So make the fix configurable. gcc/ChangeLog: * common/config/aarch64/aarch64-common.cc: Make the asm crc bug workaround configurable. Signed-off-by: Iain Sandoe --- gcc/common/config/aarch64/aarch64-common.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gcc/common/config/aarch64/aarch64-common.cc b/gcc/common/config/aarch64/aarch64-common.cc index 20bc4e1291b..4922a6b235c 100644 --- a/gcc/common/config/aarch64/aarch64-common.cc +++ b/gcc/common/config/aarch64/aarch64-common.cc @@ -301,8 +301,12 @@ aarch64_get_extension_string_for_isa_flags However, assemblers with Armv8-R AArch64 support should not have this issue, so we don't need this fix when targeting Armv8-R. */ - auto explicit_flags = (!(current_flags & AARCH64_FL_V8R) - ? AARCH64_FL_CRC : 0); + aarch64_feature_flags explicit_flags = +#ifndef DISABLE_AARCH64_AS_CRC_BUGFIX + (!(current_flags & AARCH64_ISA_V8R) ? AARCH64_FL_CRC : 0); +#else + 0; +#endif /* Add the features in isa_flags & ~current_flags using the smallest possible number of extensions. We can do this by iterating over the