diff options
author | Thomas Schwinge <tschwinge@baylibre.com> | 2024-11-10 17:47:16 +0100 |
---|---|---|
committer | Thomas Schwinge <tschwinge@baylibre.com> | 2024-12-06 12:26:45 +0100 |
commit | 7cff338e5ae478cf841a4394741587bdb6ca76a8 (patch) | |
tree | 8e0493861b97e9d0c3d58a8c27d75eb95d45da1b /gcc | |
parent | 7151d885c47ec93ba06f52a4be2a19a706f0750e (diff) | |
download | gcc-7cff338e5ae478cf841a4394741587bdb6ca76a8.zip gcc-7cff338e5ae478cf841a4394741587bdb6ca76a8.tar.gz gcc-7cff338e5ae478cf841a4394741587bdb6ca76a8.tar.bz2 |
nvptx: Support '-march=sm_52'
gcc/
* config/nvptx/nvptx-sm.def: Add '52'.
* config/nvptx/nvptx-gen.h: Regenerate.
* config/nvptx/nvptx-gen.opt: Likewise.
* config/nvptx/nvptx.cc (first_ptx_version_supporting_sm): Adjust.
* config/nvptx/nvptx.opt (-march-map=sm_52): Likewise.
* config.gcc: Likewise.
* doc/invoke.texi (Nvidia PTX Options): Document '-march=sm_52'.
* config/nvptx/gen-multilib-matches-tests: Extend.
gcc/testsuite/
* gcc.target/nvptx/march-map=sm_52.c: Adjust.
* gcc.target/nvptx/march=sm_52.c: New.
libgomp/
* testsuite/libgomp.c/declare-variant-3-sm52.c: New.
* testsuite/libgomp.c/declare-variant-3.h: Adjust.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config.gcc | 2 | ||||
-rw-r--r-- | gcc/config/nvptx/gen-multilib-matches-tests | 41 | ||||
-rw-r--r-- | gcc/config/nvptx/nvptx-gen.h | 1 | ||||
-rw-r--r-- | gcc/config/nvptx/nvptx-gen.opt | 3 | ||||
-rw-r--r-- | gcc/config/nvptx/nvptx-sm.def | 1 | ||||
-rw-r--r-- | gcc/config/nvptx/nvptx.cc | 1 | ||||
-rw-r--r-- | gcc/config/nvptx/nvptx.opt | 2 | ||||
-rw-r--r-- | gcc/doc/invoke.texi | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/nvptx/march-map=sm_52.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/nvptx/march=sm_52.c | 19 |
10 files changed, 65 insertions, 11 deletions
diff --git a/gcc/config.gcc b/gcc/config.gcc index b68ede9..21f3dcd 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -5643,7 +5643,7 @@ case "${target}" in case $nvptx_multilib in #TODO 'sm_[...]' list per 'nvptx-sm.def'. sm_30 | sm_35 | sm_37 \ - | sm_53 \ + | sm_52 | sm_53 \ | sm_70 | sm_75 \ | sm_80 ) TM_MULTILIB_CONFIG="$TM_MULTILIB_CONFIG $nvptx_multilib" diff --git a/gcc/config/nvptx/gen-multilib-matches-tests b/gcc/config/nvptx/gen-multilib-matches-tests index 8704504..13b1c5b 100644 --- a/gcc/config/nvptx/gen-multilib-matches-tests +++ b/gcc/config/nvptx/gen-multilib-matches-tests @@ -16,6 +16,7 @@ SMOIL sm_30 AEMM .=misa?sm_30 AEMM .=misa?sm_35 AEMM .=misa?sm_37 +AEMM .=misa?sm_52 AEMM .=misa?sm_53 AEMM .=misa?sm_70 AEMM .=misa?sm_75 @@ -28,14 +29,15 @@ SMOIL sm_30 sm_80 AEMM .=misa?sm_30 AEMM .=misa?sm_35 AEMM .=misa?sm_37 +AEMM .=misa?sm_52 AEMM .=misa?sm_53 AEMM .=misa?sm_70 AEMM .=misa?sm_75 CMMC -BEGIN '--with-arch=sm_30', '--with-multilib-list=sm_30,sm_35,sm_37,sm_53,sm_70,sm_75,sm_80' +BEGIN '--with-arch=sm_30', '--with-multilib-list=sm_30,sm_35,sm_37,sm_52,sm_53,sm_70,sm_75,sm_80' SMOID sm_30 -SMOIL sm_30 sm_35 sm_37 sm_53 sm_70 sm_75 sm_80 +SMOIL sm_30 sm_35 sm_37 sm_52 sm_53 sm_70 sm_75 sm_80 AEMM .=misa?sm_30 CMMC @@ -46,6 +48,7 @@ SMOIL sm_35 AEMM .=misa?sm_30 AEMM .=misa?sm_35 AEMM .=misa?sm_37 +AEMM .=misa?sm_52 AEMM .=misa?sm_53 AEMM .=misa?sm_70 AEMM .=misa?sm_75 @@ -57,6 +60,7 @@ SMOID sm_35 SMOIL sm_35 sm_30 AEMM .=misa?sm_35 AEMM .=misa?sm_37 +AEMM .=misa?sm_52 AEMM .=misa?sm_53 AEMM .=misa?sm_70 AEMM .=misa?sm_75 @@ -69,6 +73,7 @@ SMOID sm_37 SMOIL sm_37 sm_30 AEMM misa?sm_30=misa?sm_35 AEMM .=misa?sm_37 +AEMM .=misa?sm_52 AEMM .=misa?sm_53 AEMM .=misa?sm_70 AEMM .=misa?sm_75 @@ -76,11 +81,24 @@ AEMM .=misa?sm_80 CMMC +BEGIN '--with-arch=sm_52', '--with-multilib-list=sm_52,sm_75,sm_35' +SMOID sm_52 +SMOIL sm_52 sm_75 sm_35 +AEMM misa?sm_35=misa?sm_30 +AEMM misa?sm_35=misa?sm_37 +AEMM .=misa?sm_52 +AEMM .=misa?sm_53 +AEMM .=misa?sm_70 +AEMM misa?sm_75=misa?sm_80 +CMMC + + BEGIN '--with-arch=sm_53', '--with-multilib-list=sm_53,sm_30' SMOID sm_53 SMOIL sm_53 sm_30 AEMM misa?sm_30=misa?sm_35 AEMM misa?sm_30=misa?sm_37 +AEMM misa?sm_30=misa?sm_52 AEMM .=misa?sm_53 AEMM .=misa?sm_70 AEMM .=misa?sm_75 @@ -92,15 +110,16 @@ SMOID sm_53 SMOIL sm_53 sm_37 AEMM misa?sm_37=misa?sm_30 AEMM misa?sm_37=misa?sm_35 +AEMM misa?sm_37=misa?sm_52 AEMM .=misa?sm_53 AEMM .=misa?sm_70 AEMM .=misa?sm_75 AEMM .=misa?sm_80 CMMC -BEGIN '--with-arch=sm_53', '--with-multilib-list=sm_53,sm_30,sm_35,sm_37,sm_70,sm_75,sm_80' +BEGIN '--with-arch=sm_53', '--with-multilib-list=sm_53=sm_30,sm_35,sm_37,sm_52,sm_70,sm_75,sm_80' SMOID sm_53 -SMOIL sm_53 sm_30 sm_35 sm_37 sm_70 sm_75 sm_80 +SMOIL sm_53 sm_30 sm_35 sm_37 sm_52 sm_70 sm_75 sm_80 AEMM .=misa?sm_53 CMMC @@ -111,6 +130,7 @@ SMOIL sm_70 AEMM .=misa?sm_30 AEMM .=misa?sm_35 AEMM .=misa?sm_37 +AEMM .=misa?sm_52 AEMM .=misa?sm_53 AEMM .=misa?sm_70 AEMM .=misa?sm_75 @@ -122,6 +142,7 @@ SMOID sm_70 SMOIL sm_70 sm_30 AEMM misa?sm_30=misa?sm_35 AEMM misa?sm_30=misa?sm_37 +AEMM misa?sm_30=misa?sm_52 AEMM misa?sm_30=misa?sm_53 AEMM .=misa?sm_70 AEMM .=misa?sm_75 @@ -134,6 +155,7 @@ SMOIL sm_70 sm_53 AEMM misa?sm_53=misa?sm_30 AEMM misa?sm_53=misa?sm_35 AEMM misa?sm_53=misa?sm_37 +AEMM misa?sm_53=misa?sm_52 AEMM .=misa?sm_70 AEMM .=misa?sm_75 AEMM .=misa?sm_80 @@ -144,6 +166,7 @@ SMOID sm_70 SMOIL sm_70 sm_53 sm_30 AEMM misa?sm_30=misa?sm_35 AEMM misa?sm_30=misa?sm_37 +AEMM misa?sm_30=misa?sm_52 AEMM .=misa?sm_70 AEMM .=misa?sm_75 AEMM .=misa?sm_80 @@ -155,6 +178,7 @@ SMOID sm_75 SMOIL sm_75 sm_30 AEMM misa?sm_30=misa?sm_35 AEMM misa?sm_30=misa?sm_37 +AEMM misa?sm_30=misa?sm_52 AEMM misa?sm_30=misa?sm_53 AEMM misa?sm_30=misa?sm_70 AEMM .=misa?sm_75 @@ -167,6 +191,7 @@ SMOIL sm_75 sm_53 AEMM misa?sm_53=misa?sm_30 AEMM misa?sm_53=misa?sm_35 AEMM misa?sm_53=misa?sm_37 +AEMM misa?sm_53=misa?sm_52 AEMM misa?sm_53=misa?sm_70 AEMM .=misa?sm_75 AEMM .=misa?sm_80 @@ -177,6 +202,7 @@ SMOID sm_75 SMOIL sm_75 sm_30 sm_53 AEMM misa?sm_30=misa?sm_35 AEMM misa?sm_30=misa?sm_37 +AEMM misa?sm_30=misa?sm_52 AEMM misa?sm_53=misa?sm_70 AEMM .=misa?sm_75 AEMM .=misa?sm_80 @@ -189,6 +215,7 @@ SMOIL sm_80 AEMM .=misa?sm_30 AEMM .=misa?sm_35 AEMM .=misa?sm_37 +AEMM .=misa?sm_52 AEMM .=misa?sm_53 AEMM .=misa?sm_70 AEMM .=misa?sm_75 @@ -200,6 +227,7 @@ SMOID sm_80 SMOIL sm_80 sm_30 AEMM misa?sm_30=misa?sm_35 AEMM misa?sm_30=misa?sm_37 +AEMM misa?sm_30=misa?sm_52 AEMM misa?sm_30=misa?sm_53 AEMM misa?sm_30=misa?sm_70 AEMM misa?sm_30=misa?sm_75 @@ -212,13 +240,14 @@ SMOIL sm_80 sm_75 AEMM misa?sm_75=misa?sm_30 AEMM misa?sm_75=misa?sm_35 AEMM misa?sm_75=misa?sm_37 +AEMM misa?sm_75=misa?sm_52 AEMM misa?sm_75=misa?sm_53 AEMM misa?sm_75=misa?sm_70 AEMM .=misa?sm_80 CMMC -BEGIN '--with-arch=sm_80', '--with-multilib-list=sm_80,sm_30,sm_35,sm_37,sm_53,sm_70,sm_75' +BEGIN '--with-arch=sm_80', '--with-multilib-list=sm_80,sm_30,sm_35,sm_37,sm_52,sm_53,sm_70,sm_75' SMOID sm_80 -SMOIL sm_80 sm_30 sm_35 sm_37 sm_53 sm_70 sm_75 +SMOIL sm_80 sm_30 sm_35 sm_37 sm_52 sm_53 sm_70 sm_75 AEMM .=misa?sm_80 CMMC diff --git a/gcc/config/nvptx/nvptx-gen.h b/gcc/config/nvptx/nvptx-gen.h index 7f9b620..5f271a3 100644 --- a/gcc/config/nvptx/nvptx-gen.h +++ b/gcc/config/nvptx/nvptx-gen.h @@ -24,6 +24,7 @@ #define TARGET_SM30 (ptx_isa_option >= PTX_ISA_SM30) #define TARGET_SM35 (ptx_isa_option >= PTX_ISA_SM35) #define TARGET_SM37 (ptx_isa_option >= PTX_ISA_SM37) +#define TARGET_SM52 (ptx_isa_option >= PTX_ISA_SM52) #define TARGET_SM53 (ptx_isa_option >= PTX_ISA_SM53) #define TARGET_SM70 (ptx_isa_option >= PTX_ISA_SM70) #define TARGET_SM75 (ptx_isa_option >= PTX_ISA_SM75) diff --git a/gcc/config/nvptx/nvptx-gen.opt b/gcc/config/nvptx/nvptx-gen.opt index 9124bd1..0d76885 100644 --- a/gcc/config/nvptx/nvptx-gen.opt +++ b/gcc/config/nvptx/nvptx-gen.opt @@ -33,6 +33,9 @@ EnumValue Enum(ptx_isa) String(sm_37) Value(PTX_ISA_SM37) EnumValue +Enum(ptx_isa) String(sm_52) Value(PTX_ISA_SM52) + +EnumValue Enum(ptx_isa) String(sm_53) Value(PTX_ISA_SM53) EnumValue diff --git a/gcc/config/nvptx/nvptx-sm.def b/gcc/config/nvptx/nvptx-sm.def index 625007d..0fafc8a 100644 --- a/gcc/config/nvptx/nvptx-sm.def +++ b/gcc/config/nvptx/nvptx-sm.def @@ -23,6 +23,7 @@ NVPTX_SM (30, NVPTX_SM_SEP) NVPTX_SM (35, NVPTX_SM_SEP) NVPTX_SM (37, NVPTX_SM_SEP) +NVPTX_SM (52, NVPTX_SM_SEP) NVPTX_SM (53, NVPTX_SM_SEP) NVPTX_SM (70, NVPTX_SM_SEP) NVPTX_SM (75, NVPTX_SM_SEP) diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc index c3aba05..93402bf 100644 --- a/gcc/config/nvptx/nvptx.cc +++ b/gcc/config/nvptx/nvptx.cc @@ -216,6 +216,7 @@ first_ptx_version_supporting_sm (enum ptx_isa sm) case PTX_ISA_SM35: return PTX_VERSION_3_1; case PTX_ISA_SM37: + case PTX_ISA_SM52: return PTX_VERSION_4_1; case PTX_ISA_SM53: return PTX_VERSION_4_2; diff --git a/gcc/config/nvptx/nvptx.opt b/gcc/config/nvptx/nvptx.opt index e02a845..4d14eda 100644 --- a/gcc/config/nvptx/nvptx.opt +++ b/gcc/config/nvptx/nvptx.opt @@ -79,7 +79,7 @@ march-map=sm_50 Target RejectNegative Alias(misa=,sm_37) march-map=sm_52 -Target RejectNegative Alias(misa=,sm_37) +Target RejectNegative Alias(misa=,sm_52) march-map=sm_53 Target RejectNegative Alias(misa=,sm_53) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 8a91c57..92728a7 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -30047,7 +30047,7 @@ supported. Generate code for the specified PTX ISA target architecture. Valid architecture strings are @samp{sm_30}, @samp{sm_35}, @samp{sm_37}, -@samp{sm_53}, +@samp{sm_52}, @samp{sm_53}, @samp{sm_70}, @samp{sm_75}, and @samp{sm_80}. The default depends on how the compiler has been configured, see diff --git a/gcc/testsuite/gcc.target/nvptx/march-map=sm_52.c b/gcc/testsuite/gcc.target/nvptx/march-map=sm_52.c index 6dd8605..f37d13a 100644 --- a/gcc/testsuite/gcc.target/nvptx/march-map=sm_52.c +++ b/gcc/testsuite/gcc.target/nvptx/march-map=sm_52.c @@ -2,7 +2,7 @@ /* { dg-options {-march-map=sm_52 -mptx=_} } */ /* { dg-additional-options -save-temps } */ /* { dg-final { scan-assembler-times {(?n)^ \.version 6\.0$} 1 } } */ -/* { dg-final { scan-assembler-times {(?n)^ \.target sm_37$} 1 } } */ +/* { dg-final { scan-assembler-times {(?n)^ \.target sm_52$} 1 } } */ #if __PTX_ISA_VERSION_MAJOR__ != 6 #error wrong value for __PTX_ISA_VERSION_MAJOR__ @@ -12,7 +12,7 @@ #error wrong value for __PTX_ISA_VERSION_MINOR__ #endif -#if __PTX_SM__ != 370 +#if __PTX_SM__ != 520 #error wrong value for __PTX_SM__ #endif diff --git a/gcc/testsuite/gcc.target/nvptx/march=sm_52.c b/gcc/testsuite/gcc.target/nvptx/march=sm_52.c new file mode 100644 index 0000000..515f950 --- /dev/null +++ b/gcc/testsuite/gcc.target/nvptx/march=sm_52.c @@ -0,0 +1,19 @@ +/* { dg-do assemble } */ +/* { dg-options {-march=sm_52 -mptx=_} } */ +/* { dg-additional-options -save-temps } */ +/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.0$} 1 } } */ +/* { dg-final { scan-assembler-times {(?n)^ \.target sm_52$} 1 } } */ + +#if __PTX_ISA_VERSION_MAJOR__ != 6 +#error wrong value for __PTX_ISA_VERSION_MAJOR__ +#endif + +#if __PTX_ISA_VERSION_MINOR__ != 0 +#error wrong value for __PTX_ISA_VERSION_MINOR__ +#endif + +#if __PTX_SM__ != 520 +#error wrong value for __PTX_SM__ +#endif + +int dummy; |