From patchwork Thu Mar 31 07:40:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 1611603 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=C6jY23ds; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KTZxX29B5z9sGD for ; Thu, 31 Mar 2022 18:41:34 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5F6053857018 for ; Thu, 31 Mar 2022 07:41:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5F6053857018 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1648712492; bh=w5/xKI3F2LfPCaUhR6AtfG0TjM884Y2fetoQK1YYJ1o=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=C6jY23dsOZ0fNc2PHfB4vMRV984NQCXAb4CCT9WgevKisC93Zq1lPpivleyH326QE CHUPFhnGzwVLBcZt1sk956BfiF6H61/leA2OxA7Wv2kjOS5IzEe2YRV6uRiEaAKyZp PkRXD07nDGJk05QqSjHCodbW4ygIUm6VDH1YroQI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 73D103858C50 for ; Thu, 31 Mar 2022 07:40:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 73D103858C50 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id DC38C1F869 for ; Thu, 31 Mar 2022 07:40:48 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C9B81139C2 for ; Thu, 31 Mar 2022 07:40:48 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id pPsUMABbRWKPbAAAMHmgww (envelope-from ) for ; Thu, 31 Mar 2022 07:40:48 +0000 Date: Thu, 31 Mar 2022 09:40:47 +0200 To: gcc-patches@gcc.gnu.org Subject: [committed][nvptx] Fix ASM_SPEC workaround for sm_30 Message-ID: <20220331074045.GA29630@delia.home> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tom de Vries via Gcc-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi, Newer versions of CUDA no longer support sm_30, and nvptx-tools as currently doesn't handle that gracefully when verifying ( https://github.com/MentorEmbedded/nvptx-tools/issues/30 ). There's a --no-verify work-around in place in ASM_SPEC, but that one doesn't work when using -Wa,--verify on the command line. Use a more robust workaround: verify using sm_35 when misa=sm_30 is specified (either implicitly or explicitly). Tested on nvptx. Committed to trunk. Thanks, - Tom [nvptx] Fix ASM_SPEC workaround for sm_30 gcc/ChangeLog: 2022-03-30 Tom de Vries * config/nvptx/nvptx.h (ASM_SPEC): Use "-m sm_35" for -misa=sm_30. --- gcc/config/nvptx/nvptx.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h index 75ac7a666b1..3b06f33032f 100644 --- a/gcc/config/nvptx/nvptx.h +++ b/gcc/config/nvptx/nvptx.h @@ -29,10 +29,24 @@ #define STARTFILE_SPEC "%{mmainkernel:crt0.o}" -/* Default needs to be in sync with default for misa in nvptx.opt. - We add a default here to work around a hard-coded sm_30 default in - nvptx-as. */ -#define ASM_SPEC "%{misa=*:-m %*; :-m sm_35}%{misa=sm_30:--no-verify}" +/* Newer versions of CUDA no longer support sm_30, and nvptx-tools as + currently doesn't handle that gracefully when verifying + ( https://github.com/MentorEmbedded/nvptx-tools/issues/30 ). Work around + this by verifying with sm_35 when having misa=sm_30 (either implicitly + or explicitly). */ +#define ASM_SPEC \ + "%{" \ + /* Explict misa=sm_30. */ \ + "misa=sm_30:-m sm_35" \ + /* Separator. */ \ + "; " \ + /* Catch-all. */ \ + "misa=*:-m %*" \ + /* Separator. */ \ + "; " \ + /* Implicit misa=sm_30. */ \ + ":-m sm_35" \ + "}" #define TARGET_CPU_CPP_BUILTINS() nvptx_cpu_cpp_builtins ()