From patchwork Tue Jun 18 21:40:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick O'Neill X-Patchwork-Id: 1949497 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=mqTzi5ne; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W3gFg3QPyz20XW for ; Wed, 19 Jun 2024 07:42:13 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1FFB03883010 for ; Tue, 18 Jun 2024 21:42:11 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by sourceware.org (Postfix) with ESMTPS id BC77D3882ACB for ; Tue, 18 Jun 2024 21:41:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BC77D3882ACB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BC77D3882ACB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718746913; cv=none; b=I127237g/G1qvlqADv0dj1fi147KzwGdW/Pm/vrRtgsnNrTldY6XPxTtw0qAezxLZjl65mp9thAPznsT93d7kPSOoKfKKboj26P9qNOeWL0aKnWr9UsZzmaQPn6cHJjb8EHFwc/16VzGXMhwaSr+j1zD/gzEqT0820Jp5n1w+ck= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718746913; c=relaxed/simple; bh=AE03p+uHpUmGcKKTyt12Z2DsMZToN9m5anlIHJ8CNf4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=plxxg8EaqyJdS//oUHupll6zgcKS6HJZmYU0G0/yNkYamNHwpm9UL2CYtRO+U+C5WxstWZdiGteRSflr7vnem4jxWkFGSIsDG/ImCFRsp66pxQpL5UvXIvjSd3/ceTCRYBSAb1IXYNE7EdcL44Qznpr4Ma3DzVhQlP8johFd6i0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1f9aeb96b93so58245ad.3 for ; Tue, 18 Jun 2024 14:41:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1718746910; x=1719351710; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=FyHbpeECIQ/x65F5Q6FlUE4CsbdFVCkzJEFAXwodx0E=; b=mqTzi5ne4HEEy/jvyFMrEL91ucoeTWqb9OFthWiB36dvjkFtbv4dsL9Sqiypqh9I3X pTzLHN9hnD8ZPKgZBiS/Oj4KmvOllYjbAqaxqAIxcEu3s8oC360F9PV59pzhN/Mv59rR hHTJMXnoTt1sOGYawpoPd/dXT3ihd1ixTuerjJSR2wFwuUs6S58RTzVUcSnpEMqNsl6w u5RduoAww29ClB+KPwLgCwiA5JKCWolbKVXrGO/o1cnbOBg+U6kOls0shmI9JZtaJwDT QNJijEZE6Poh5RGdWa7EWCwIE63GSHuxmUR5K08nj0sonVacbzahdGZXsa8+6jSlpaaS Nzqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718746910; x=1719351710; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FyHbpeECIQ/x65F5Q6FlUE4CsbdFVCkzJEFAXwodx0E=; b=wXqJvaAfsmUHIlKCC3A+7e3Di5SasAZTl3/kzHRxXmyjiXUBmtqSJ4WCES8d+8wZ+i n0H3DXCFVyIY2ijniHE1lDNqLu94IilinkDIw2zpbe28V/v2PYRKvLhCovxr4NO5kSgk 71Rngqb0Tjmgamviw3tPjEPmxwrqFlBfw6IfjE5t4gZRorP+d6a1sbOLQu9nUC6JmUEk yjaWocu7LwZPrcJDaXgUjEt++wPZUhEBGprKCtIQHG3yOP8e3hsyx8VBQELIdcOjJnLR 0zveLDzBcZTJezu6nJ3JrsMqKOAGzsLNT3syyI3Gt2GJrkL4/tdSOuupzlP2Ic540XsP MJTA== X-Gm-Message-State: AOJu0Yzx3xGfPxgWUH5HmxcKzRlp2meFdGdftLZu71rNG4FFhePaAfts DftrZdBx2oEO9p3OuIF/Qgs4OhpwC371a1Qr81so4+3IecGXBwn3qB9X9/DikX33aPoFI8wOYx9 D X-Google-Smtp-Source: AGHT+IGo8UgTMv9HXb11J3+hmptvl/IeeKAmsQdKACS1znk45HrqZp4lV67XpDaxRvttG0o6Oq6uFQ== X-Received: by 2002:a17:902:ceca:b0:1f9:a778:3070 with SMTP id d9443c01a7336-1f9aa3bc827mr10734025ad.9.1718746910069; Tue, 18 Jun 2024 14:41:50 -0700 (PDT) Received: from patrick-ThinkPad-X1-Carbon-Gen-8.hq.rivosinc.com ([50.145.13.30]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f855ee8354sm102137735ad.149.2024.06.18.14.41.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 14:41:49 -0700 (PDT) From: Patrick O'Neill To: gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com, palmer@dabbelt.com, jeffreyalaw@gmail.com, pan2.li@intel.com, gnu-toolchain@rivosinc.com, Patrick O'Neill Subject: [PATCH v4] RISC-V: Promote Zaamo/Zalrsc to a when using an old binutils Date: Tue, 18 Jun 2024 14:40:15 -0700 Message-ID: <20240618214015.195546-1-patrick@rivosinc.com> X-Mailer: git-send-email 2.43.2 MIME-Version: 1.0 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Binutils 2.42 and before don't support Zaamo/Zalrsc. When users specify both Zaamo and Zalrsc, promote them to 'a' in the -march string. This does not affect testsuite results for users with old versions of binutils. Testcases that failed due to 'call'/isa string continue to fail after this PATCH when using an old version of binutils. gcc/ChangeLog: * common/config/riscv/riscv-common.cc: Add 'a' extension to riscv_combine_info. Signed-off-by: Patrick O'Neill --- We will emit calls if the user only specifies Zaamo or Zalrsc. To my knowledge there isn't a way to make a testcase for this in dejagnu. I used the most recent version of the 'a' extension arbitrarily since AFAICT the version of the extension doesn't affect the combine logic. --- gcc/common/config/riscv/riscv-common.cc | 1 + 1 file changed, 1 insertion(+) -- 2.34.1 diff --git a/gcc/common/config/riscv/riscv-common.cc b/gcc/common/config/riscv/riscv-common.cc index 1dc1d9904c7..410e673f5e0 100644 --- a/gcc/common/config/riscv/riscv-common.cc +++ b/gcc/common/config/riscv/riscv-common.cc @@ -401,6 +401,7 @@ static const struct riscv_ext_version riscv_ext_version_table[] = /* Combine extensions defined in this table */ static const struct riscv_ext_version riscv_combine_info[] = { + {"a", ISA_SPEC_CLASS_20191213, 2, 1}, {"zk", ISA_SPEC_CLASS_NONE, 1, 0}, {"zkn", ISA_SPEC_CLASS_NONE, 1, 0}, {"zks", ISA_SPEC_CLASS_NONE, 1, 0},