From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id D69BE3858412; Mon, 26 Sep 2022 14:20:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D69BE3858412 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664202058; bh=P2qjhJtdef6aTrS15yTm50d4Sf+y9xYMUCku6AbwcbI=; h=From:To:Subject:Date:From; b=bpC0g/AixxvXyfLunkItJIzv+gXx27QHrjGv23pm783A03UZ5DsEvqAOITxUX1WRp 6j3aE+zWzte8SnbPFgM10Z4o+PYzOi7dFtAEoLpmfQHb4WENSQhjKXOEMAU4sDGnNN Al6iQfUxBczAoBiV0+ZG1Xir05BVbEmxi8tqAZyU= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Thomas Schwinge To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/omp/gcc-12] nvptx: Make default '-misa=sm_30' explicit X-Act-Checkin: gcc X-Git-Author: Thomas Schwinge X-Git-Refname: refs/heads/devel/omp/gcc-12 X-Git-Oldrev: dc09f5738e67bf5cccb2118b99c7632f3b5b0b05 X-Git-Newrev: 38a225f9d39f494f5dba718befef39631eb5768c Message-Id: <20220926142058.D69BE3858412@sourceware.org> Date: Mon, 26 Sep 2022 14:20:58 +0000 (GMT) List-Id: https://gcc.gnu.org/g:38a225f9d39f494f5dba718befef39631eb5768c commit 38a225f9d39f494f5dba718befef39631eb5768c 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'. (cherry picked from commit 108b99b6c45ed8fbad6776539a639244b63191f5) Diff: --- gcc/ChangeLog.omp | 11 +++++++++++ gcc/config.gcc | 16 ++++++++++++++++ gcc/config/nvptx/nvptx.cc | 4 ++++ gcc/config/nvptx/nvptx.h | 4 ++++ gcc/config/nvptx/nvptx.opt | 2 +- 5 files changed, 36 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog.omp b/gcc/ChangeLog.omp index 662430dd6ec..7f5f932b9d6 100644 --- a/gcc/ChangeLog.omp +++ b/gcc/ChangeLog.omp @@ -1,3 +1,14 @@ +2022-09-26 Thomas Schwinge + + Backported from master: + 2022-09-26 Thomas Schwinge + + * 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'. + 2022-09-26 Thomas Schwinge Backported from master: diff --git a/gcc/config.gcc b/gcc/config.gcc index 16d304286d7..3b1bde78391 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -4043,6 +4043,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. @@ -5436,6 +5439,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 0c2f7012327..854ebe10bbd 100644 --- a/gcc/config/nvptx/nvptx.cc +++ b/gcc/config/nvptx/nvptx.cc @@ -335,6 +335,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 9c883ba272a..cfde6f191a4 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=