aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2019-11-04 22:29:11 +0000
committerTobias Burnus <burnus@gcc.gnu.org>2019-11-04 23:29:11 +0100
commit955cd057454b323419e06affa7df7d59dc3cd1fb (patch)
tree66884b067b9afbb1e0c765c0b1e2235f9744f975 /gcc
parent9ac6cb7eb016da3419f68cbd176769f6f10584bb (diff)
downloadgcc-955cd057454b323419e06affa7df7d59dc3cd1fb.zip
gcc-955cd057454b323419e06affa7df7d59dc3cd1fb.tar.gz
gcc-955cd057454b323419e06affa7df7d59dc3cd1fb.tar.bz2
Add gcc/config/gcn/t-omp-device for OpenMP declare variant kind/arch/isa
gcc/ * config/gcn/gcn.c (gcn_omp_device_kind_arch_isa): New function. (TARGET_OMP_DEVICE_KIND_ARCH_ISA): Redefine to gcn_omp_device_kind_arch_isa. * config/gcn/t-omp-device: New file. * configure.ac: Support gcn for omp_device_property. * configure: Regenerate. From-SVN: r277797
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/config/gcn/gcn.c32
-rwxr-xr-xgcc/configure8
-rw-r--r--gcc/configure.ac4
4 files changed, 51 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 32af8bb..a11c08f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2019-11-04 Tobias Burnus <tobias@codesourcery.com>
+
+ * config/gcn/gcn.c (gcn_omp_device_kind_arch_isa): New function.
+ (TARGET_OMP_DEVICE_KIND_ARCH_ISA): Redefine to
+ gcn_omp_device_kind_arch_isa.
+ * config/gcn/t-omp-device: New file.
+ * configure.ac: Support gcn for omp_device_property.
+ * configure: Regenerate.
+
2019-11-04 Aldy Hernandez <aldyh@redhat.com>
* tree-vrp.h (vrp_val_min): Remove handle_pointers argument.
diff --git a/gcc/config/gcn/gcn.c b/gcc/config/gcn/gcn.c
index b5f09da..cdd2427 100644
--- a/gcc/config/gcn/gcn.c
+++ b/gcc/config/gcn/gcn.c
@@ -2516,6 +2516,36 @@ gcn_gimplify_va_arg_expr (tree valist, tree type,
return t;
}
+/* Return 1 if TRAIT NAME is present in the OpenMP context's
+ device trait set, return 0 if not present in any OpenMP context in the
+ whole translation unit, or -1 if not present in the current OpenMP context
+ but might be present in another OpenMP context in the same TU. */
+
+int
+gcn_omp_device_kind_arch_isa (enum omp_device_kind_arch_isa trait,
+ const char *name)
+{
+ switch (trait)
+ {
+ case omp_device_kind:
+ return strcmp (name, "gpu") == 0;
+ case omp_device_arch:
+ return strcmp (name, "gcn") == 0;
+ case omp_device_isa:
+ if (strcmp (name, "carrizo") == 0)
+ return gcn_arch == PROCESSOR_CARRIZO;
+ if (strcmp (name, "fiji") == 0)
+ return gcn_arch == PROCESSOR_FIJI;
+ if (strcmp (name, "gfx900") == 0)
+ return gcn_arch == PROCESSOR_VEGA;
+ if (strcmp (name, "gfx906") == 0)
+ return gcn_arch == PROCESSOR_VEGA;
+ return 0;
+ default:
+ gcc_unreachable ();
+ }
+}
+
/* Calculate stack offsets needed to create prologues and epilogues. */
static struct machine_function *
@@ -6030,6 +6060,8 @@ print_operand (FILE *file, rtx x, int code)
#define TARGET_FUNCTION_VALUE_REGNO_P gcn_function_value_regno_p
#undef TARGET_GIMPLIFY_VA_ARG_EXPR
#define TARGET_GIMPLIFY_VA_ARG_EXPR gcn_gimplify_va_arg_expr
+#undef TARGET_OMP_DEVICE_KIND_ARCH_ISA
+#define TARGET_OMP_DEVICE_KIND_ARCH_ISA gcn_omp_device_kind_arch_isa
#undef TARGET_GOACC_ADJUST_PROPAGATION_RECORD
#define TARGET_GOACC_ADJUST_PROPAGATION_RECORD \
gcn_goacc_adjust_propagation_record
diff --git a/gcc/configure b/gcc/configure
index 6808c23..a2df82e 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -7896,6 +7896,10 @@ for tgt in `echo $enable_offload_targets | sed 's/,/ /g'`; do
omp_device_property=omp-device-properties-i386
omp_device_property_tmake_file="${omp_device_property_tmake_file} \$(srcdir)/config/i386/t-omp-device"
;;
+ gcn*-*)
+ omp_device_property=omp-device-properties-gcn
+ omp_device_property_tmake_file="${omp_device_property_tmake_file} \$(srcdir)/config/gcn/t-omp-device"
+ ;;
nvptx*-*)
omp_device_property=omp-device-properties-nvptx
omp_device_property_tmake_file="${omp_device_property_tmake_file} \$(srcdir)/config/nvptx/t-omp-device"
@@ -18933,7 +18937,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 18936 "configure"
+#line 18940 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -19039,7 +19043,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 19042 "configure"
+#line 19046 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 1a0d682..5f32fd4 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -1037,6 +1037,10 @@ for tgt in `echo $enable_offload_targets | sed 's/,/ /g'`; do
omp_device_property=omp-device-properties-i386
omp_device_property_tmake_file="${omp_device_property_tmake_file} \$(srcdir)/config/i386/t-omp-device"
;;
+ gcn*-*)
+ omp_device_property=omp-device-properties-gcn
+ omp_device_property_tmake_file="${omp_device_property_tmake_file} \$(srcdir)/config/gcn/t-omp-device"
+ ;;
nvptx*-*)
omp_device_property=omp-device-properties-nvptx
omp_device_property_tmake_file="${omp_device_property_tmake_file} \$(srcdir)/config/nvptx/t-omp-device"