From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id 027A23858CDA; Mon, 26 Sep 2022 14:12:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 027A23858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664201564; bh=9OzAKIlsGoe/tOn09DlhQ25NHnFz7bmznh3gi5bkz7A=; h=From:To:Subject:Date:From; b=GYAFZZzkG2KIKWzHZHkWoSEbVYYu42idepc93x6cf31AVpwo5W8JAKOxGlFL8W+OO igogNKJI0pFLNKiqAFGV6Dm/B1TPVzGtfhbRoe5Ankdb2ITbgbQc+xtHb3ZNS8Vkkg 6hmDoZwTPmMgAGoiBqA1JOp4HSIGN9R5Ebzow4Yo= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Thomas Schwinge To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-2873] nvptx: Make default '-misa=sm_30' explicit X-Act-Checkin: gcc X-Git-Author: Thomas Schwinge X-Git-Refname: refs/heads/master X-Git-Oldrev: 84072a2615ec1f5f35e994128a6dc22af5bf1322 X-Git-Newrev: 108b99b6c45ed8fbad6776539a639244b63191f5 Message-Id: <20220926141244.027A23858CDA@sourceware.org> Date: Mon, 26 Sep 2022 14:12:43 +0000 (GMT) List-Id: https://gcc.gnu.org/g:108b99b6c45ed8fbad6776539a639244b63191f5 commit r13-2873-g108b99b6c45ed8fbad6776539a639244b63191f5 Author: Thomas Schwinge Date: Sat Jun 11 12:28:36 2022 +0200 nvptx: Make default '-misa=sm_30' explicit ... primarily in preparation for later changes. gcc/ * config.gcc (with_arch) [nvptx]: Set to 'sm_30'. * config/nvptx/nvptx.cc (nvptx_option_override): Assert that '-misa' appeared. * config/nvptx/nvptx.h (OPTION_DEFAULT_SPECS): Define. * config/nvptx/nvptx.opt (misa=): Remove 'Init'. Diff: --- gcc/config.gcc | 16 ++++++++++++++++ gcc/config/nvptx/nvptx.cc | 4 ++++ gcc/config/nvptx/nvptx.h | 4 ++++ gcc/config/nvptx/nvptx.opt | 2 +- 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/gcc/config.gcc b/gcc/config.gcc index 27ffce3fb50..6a47661e647 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -3941,6 +3941,9 @@ if test x$with_arch = x ; then mips*-*-vxworks) with_arch=mips2 ;; + nvptx-*) + with_arch=sm_30 + ;; esac # Avoid overriding --with-arch-32 and --with-arch-64 values. @@ -5293,6 +5296,19 @@ case "${target}" in esac ;; + nvptx-*) + supported_defaults=arch + case $with_arch in + sm_30 ) + # OK; default. + ;; + * ) + echo "Unknown arch used in --with-arch=$with_arch" 1>&2 + exit 1 + ;; + esac + ;; + powerpc*-*-* | rs6000-*-*) supported_defaults="abi cpu cpu_32 cpu_64 float tune tune_32 tune_64 advance_toolchain" diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc index 49cc6814178..2fe120b3873 100644 --- a/gcc/config/nvptx/nvptx.cc +++ b/gcc/config/nvptx/nvptx.cc @@ -334,6 +334,10 @@ nvptx_option_override (void) { init_machine_status = nvptx_init_machine_status; + /* Via nvptx 'OPTION_DEFAULT_SPECS', '-misa' always appears on the command + line. */ + gcc_checking_assert (OPTION_SET_P (ptx_isa_option)); + handle_ptx_version_option (); /* Set toplevel_reorder, unless explicitly disabled. We need diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h index 0b0170d77b3..0afc83b10a3 100644 --- a/gcc/config/nvptx/nvptx.h +++ b/gcc/config/nvptx/nvptx.h @@ -27,6 +27,10 @@ /* Run-time Target. */ +/* Use '--with-arch' for default '-misa'. */ +#define OPTION_DEFAULT_SPECS \ + { "arch", "%{!misa=*:-misa=%(VALUE)}" }, \ + /* Assembler supports '-v' option; handle similar to '../../gcc.cc:asm_options', 'HAVE_GNU_AS'. */ #define ASM_SPEC "%{v}" diff --git a/gcc/config/nvptx/nvptx.opt b/gcc/config/nvptx/nvptx.opt index c5a5668fce5..71d3b68510b 100644 --- a/gcc/config/nvptx/nvptx.opt +++ b/gcc/config/nvptx/nvptx.opt @@ -53,7 +53,7 @@ Target Mask(GOMP) Generate code for OpenMP offloading: enables -msoft-stack and -muniform-simt. misa= -Target RejectNegative ToLower Joined Enum(ptx_isa) Var(ptx_isa_option) Init(PTX_ISA_SM30) +Target RejectNegative ToLower Joined Enum(ptx_isa) Var(ptx_isa_option) Specify the PTX ISA target architecture to use. march=