]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
nvptx: Make default '-misa=sm_30' explicit
authorThomas Schwinge <thomas@codesourcery.com>
Sat, 11 Jun 2022 10:28:36 +0000 (12:28 +0200)
committerThomas Schwinge <thomas@codesourcery.com>
Mon, 26 Sep 2022 14:00:38 +0000 (16:00 +0200)
... 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'.

gcc/config.gcc
gcc/config/nvptx/nvptx.cc
gcc/config/nvptx/nvptx.h
gcc/config/nvptx/nvptx.opt

index 27ffce3fb500ce421ac9552d2685800272973f62..6a47661e647ff1aa71ddbd05e9685ff53fc139bc 100644 (file)
@@ -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"
 
index 49cc681417838b09660299cfea6fa273756dd89a..2fe120b387303887f0f7e4643e1f62b427fed574 100644 (file)
@@ -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
index 0b0170d77b3570b94bee5180bc62773e09ab7266..0afc83b10a3019b947fccbc563bee73bedee7904 100644 (file)
 
 /* 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}"
index c5a5668fce508b464bf8d4feddc164f0c97b0c39..71d3b68510bd88767073d8d578e6ca3194b38417 100644 (file)
@@ -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=