]> 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:18:51 +0000 (16:18 +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'.

(cherry picked from commit 108b99b6c45ed8fbad6776539a639244b63191f5)

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

index 662430dd6ec579591d726c67b8e010d8d60621c5..7f5f932b9d6a2b157130fd38ce0ad50db0839440 100644 (file)
@@ -1,3 +1,14 @@
+2022-09-26  Thomas Schwinge  <thomas@codesourcery.com>
+
+       Backported from master:
+       2022-09-26  Thomas Schwinge  <thomas@codesourcery.com>
+
+       * 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  <thomas@codesourcery.com>
 
        Backported from master:
index 16d304286d72a5ef7836d7cab65798d981e7abd0..3b1bde783919179910d835d83c00b50bba199396 100644 (file)
@@ -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"
 
index 0c2f70123273fd9465d19c8583dbf024fae5e9b1..854ebe10bbdc1964f6635fd4023f625187fc1b8c 100644 (file)
@@ -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
index 9c883ba272a9dd5b53fa040dc87af1e081a85d05..cfde6f191a48da32a6e786bf006a6abf9a578621 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=