2015-08-21 Nathan Sidwell <nathan@codesourcery.com>
* config/nvptx/nvptx.md (oacc_fork, oacc_join): Adjust expand calls.
* config/nvptx/nvptx.c (nvptx_emit_forking, nvptx_emit_joining): New.
Broken out of ...
(nvptx_expand_oacc_fork, nvptx_expand_oacc_join): ... here.
Restore to take mode.
===================================================================
@@ -1165,11 +1165,10 @@ nvptx_expand_compare (rtx compare)
return gen_rtx_NE (BImode, pred, const0_rtx);
}
+/* Emit forking instructions for MASK. */
-/* Expand the oacc fork & join primitive into ptx-required unspecs. */
-
-void
-nvptx_expand_oacc_fork (unsigned mask)
+static void
+nvptx_emit_forking (unsigned mask)
{
mask &= (GOMP_DIM_MASK (GOMP_DIM_WORKER)
| GOMP_DIM_MASK (GOMP_DIM_VECTOR));
@@ -1184,8 +1183,10 @@ nvptx_expand_oacc_fork (unsigned mask)
}
}
-void
-nvptx_expand_oacc_join (unsigned mask)
+/* Emit joining instructions for MASK. */
+
+static void
+nvptx_emit_joining (unsigned mask)
{
mask &= (GOMP_DIM_MASK (GOMP_DIM_WORKER)
| GOMP_DIM_MASK (GOMP_DIM_VECTOR));
@@ -1199,6 +1200,20 @@ nvptx_expand_oacc_join (unsigned mask)
}
}
+/* Expand the oacc fork & join primitive into ptx-required unspecs. */
+
+void
+nvptx_expand_oacc_fork (unsigned mode)
+{
+ nvptx_emit_forking (GOMP_DIM_MASK (mode));
+}
+
+void
+nvptx_expand_oacc_join (unsigned mode)
+{
+ nvptx_emit_joining (GOMP_DIM_MASK (mode));
+}
+
/* Expander for reduction locking and unlocking. We expect SRC to be
gang or worker level. */
===================================================================
@@ -1418,7 +1418,7 @@
UNSPECV_FORKED)]
""
{
- nvptx_expand_oacc_fork (GOMP_DIM_MASK (INTVAL (operands[0])));
+ nvptx_expand_oacc_fork (INTVAL (operands[0]));
DONE;
})
@@ -1427,7 +1427,7 @@
UNSPECV_JOIN)]
""
{
- nvptx_expand_oacc_join (GOMP_DIM_MASK (INTVAL (operands[0])));
+ nvptx_expand_oacc_join (INTVAL (operands[0]));
DONE;
})