MSP430 target has the large memory model enabled (@code{-mlarge}).
@end table
+@subsubsection nvptx-specific attributes
+
+@table @code
+@item nvptx_default_ptx_isa_version_at_least_6_0
+nvptx code by default compiles for at least PTX ISA version 6.0.
+
+@item nvptx_runtime_alias_ptx
+The nvptx runtime environment supports the PTX ISA directive
+@code{.alias}.
+@end table
+
@subsubsection PowerPC-specific attributes
@table @code
@code{mips16} function attributes.
Only MIPS targets support this feature, and only then in certain modes.
+@item nvptx_alias_ptx
+Enable using the PTX ISA directive @code{.alias} on nvptx targets.
+
@item riscv_a
Add the 'A' extension to the -march string on RISC-V targets.
/* { dg-do link } */
-/* { dg-do run { target runtime_ptx_alias } } */
+/* { dg-do run { target nvptx_runtime_alias_ptx } } */
/* { dg-options "-save-temps" } */
-/* { dg-add-options ptx_alias } */
+/* { dg-add-options nvptx_alias_ptx } */
int v;
/* { dg-do link } */
-/* { dg-do run { target runtime_ptx_alias } } */
+/* { dg-do run { target nvptx_runtime_alias_ptx } } */
/* { dg-options "-save-temps -O2" } */
-/* { dg-add-options ptx_alias } */
+/* { dg-add-options nvptx_alias_ptx } */
#include "alias-1.c"
/* { dg-do link } */
-/* { dg-do run { target runtime_ptx_alias } } */
+/* { dg-do run { target nvptx_runtime_alias_ptx } } */
/* { dg-options "-save-temps" } */
-/* { dg-add-options ptx_alias } */
+/* { dg-add-options nvptx_alias_ptx } */
/* Copy of alias-1.c, with static __f and f. */
/* { dg-do link } */
-/* { dg-do run { target runtime_ptx_alias } } */
+/* { dg-do run { target nvptx_runtime_alias_ptx } } */
/* { dg-options "-save-temps -O2" } */
-/* { dg-add-options ptx_alias } */
+/* { dg-add-options nvptx_alias_ptx } */
#include "alias-3.c"
/* Alias to alias; 'libgomp.c-c++-common/pr96390.c'. */
/* { dg-do compile } */
-/* { dg-add-options ptx_alias } */
+/* { dg-add-options nvptx_alias_ptx } */
int v;
/* { dg-do compile } */
-/* { dg-add-options ptx_alias } */
+/* { dg-add-options nvptx_alias_ptx } */
void __f ()
{
# Load support procs.
load_lib gcc-dg.exp
-# Return 1 if code by default compiles for at least PTX ISA version
-# major.minor.
-proc check_effective_target_default_ptx_isa_version_at_least { major minor } {
- set name default_ptx_isa_version_at_least_${major}_${minor}
-
- set supported_p \
- [concat \
- "((__PTX_ISA_VERSION_MAJOR__ == $major" \
- " && __PTX_ISA_VERSION_MINOR__ >= $minor)" \
- " || (__PTX_ISA_VERSION_MAJOR__ > $major))"]
-
- set src \
- [list \
- "#if $supported_p" \
- "#else" \
- "#error unsupported" \
- "#endif"]
- set src [join $src "\n"]
-
- set res [check_no_compiler_messages $name assembly $src ""]
-
- return $res
-}
-
-# Return 1 if code by default compiles for at least PTX ISA version 6.0.
-proc check_effective_target_default_ptx_isa_version_at_least_6_0 { } {
- return [check_effective_target_default_ptx_isa_version_at_least 6 0]
-}
-
-# Return 1 if code with PTX ISA version major.minor or higher can be run.
-proc check_effective_target_runtime_ptx_isa_version_at_least { major minor } {
- set name runtime_ptx_isa_version_${major}_${minor}
-
- set default \
- [check_effective_target_default_ptx_isa_version_at_least \
- ${major} ${minor}]
-
- if { $default } {
- set flag ""
- } else {
- set flag "-mptx=$major.$minor"
- }
-
- set res [check_runtime $name {
- int main (void) { return 0; }
- } $flag]
-
- return $res
-}
-
-# Return 1 if runtime environment support the PTX ISA directive .alias.
-proc check_effective_target_runtime_ptx_alias { } {
- return [check_effective_target_runtime_ptx_isa_version_at_least 6 3]
-}
-
-# Add options to enable using PTX ISA directive .alias.
-proc add_options_for_ptx_alias { flags } {
- append flags " -malias"
-
- if { ![check_effective_target_default_ptx_isa_version_at_least 6 3] } {
- append flags " -mptx=6.3"
- }
-
- return $flags
-}
-
# If a testcase doesn't have special options, use these.
global DEFAULT_CFLAGS
if ![info exists DEFAULT_CFLAGS] then {
/* Per 'omp_simt_exit':
- 'nvptx_warpsync'
- { dg-final { scan-assembler-times {bar\.warp\.sync\t0xffffffff;} 1 { target default_ptx_isa_version_at_least_6_0 } } }
+ { dg-final { scan-assembler-times {bar\.warp\.sync\t0xffffffff;} 1 { target nvptx_default_ptx_isa_version_at_least_6_0 } } }
- 'nvptx_uniform_warp_check'
- { dg-final { scan-assembler-times {vote\.all\.pred\t%r_sync, 1;} 1 { target { ! default_ptx_isa_version_at_least_6_0 } } } }
+ { dg-final { scan-assembler-times {vote\.all\.pred\t%r_sync, 1;} 1 { target { ! nvptx_default_ptx_isa_version_at_least_6_0 } } } }
*/
return 0;
}
}
+
+# Return 1 if nvptx code by default compiles for at least PTX ISA version
+# major.minor.
+
+proc check_nvptx_default_ptx_isa_version_at_least { major minor } {
+ set name nvptx_default_ptx_isa_version_at_least_${major}_${minor}
+
+ set supported_p \
+ [concat \
+ "((__PTX_ISA_VERSION_MAJOR__ == $major" \
+ " && __PTX_ISA_VERSION_MINOR__ >= $minor)" \
+ " || (__PTX_ISA_VERSION_MAJOR__ > $major))"]
+
+ set src \
+ [list \
+ "#if $supported_p" \
+ "#else" \
+ "#error unsupported" \
+ "#endif"]
+ set src [join $src "\n"]
+
+ set res [check_no_compiler_messages $name assembly $src ""]
+
+ return $res
+}
+
+# Return 1 if nvptx code by default compiles for at least PTX ISA version 6.0.
+
+proc check_effective_target_nvptx_default_ptx_isa_version_at_least_6_0 { } {
+ return [check_nvptx_default_ptx_isa_version_at_least 6 0]
+}
+
+# Return 1 if nvptx code with PTX ISA version major.minor or higher can be run.
+
+proc check_nvptx_runtime_ptx_isa_version_at_least { major minor } {
+ set name nvptx_runtime_ptx_isa_version_${major}_${minor}
+
+ set default \
+ [check_nvptx_default_ptx_isa_version_at_least \
+ ${major} ${minor}]
+
+ if { $default } {
+ set flag ""
+ } else {
+ set flag "-mptx=$major.$minor"
+ }
+
+ set res [check_runtime $name {
+ int main (void) { return 0; }
+ } $flag]
+
+ return $res
+}
+
+# Return 1 if the nvptx runtime environment supports the PTX ISA directive
+# '.alias'.
+
+proc check_effective_target_nvptx_runtime_alias_ptx { } {
+ return [check_nvptx_runtime_ptx_isa_version_at_least 6 3]
+}
+
+# Add options to enable nvptx using the PTX ISA directive '.alias'.
+
+proc add_options_for_nvptx_alias_ptx { flags } {
+ append flags " -malias"
+
+ if { ![check_nvptx_default_ptx_isa_version_at_least 6 3] } {
+ append flags " -mptx=6.3"
+ }
+
+ return $flags
+}