aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/nvptx
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2022-06-11 12:28:36 +0200
committerThomas Schwinge <thomas@codesourcery.com>2022-09-26 16:00:38 +0200
commit108b99b6c45ed8fbad6776539a639244b63191f5 (patch)
treeea929fa90d73a3152af709c96f806948eb1dbe38 /gcc/config/nvptx
parent84072a2615ec1f5f35e994128a6dc22af5bf1322 (diff)
downloadgcc-108b99b6c45ed8fbad6776539a639244b63191f5.zip
gcc-108b99b6c45ed8fbad6776539a639244b63191f5.tar.gz
gcc-108b99b6c45ed8fbad6776539a639244b63191f5.tar.bz2
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'.
Diffstat (limited to 'gcc/config/nvptx')
-rw-r--r--gcc/config/nvptx/nvptx.cc4
-rw-r--r--gcc/config/nvptx/nvptx.h4
-rw-r--r--gcc/config/nvptx/nvptx.opt2
3 files changed, 9 insertions, 1 deletions
diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc
index 49cc681..2fe120b 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 0b0170d..0afc83b 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 c5a5668..71d3b68 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=