]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[nvptx] Fix missing mode warnings in nvptx.md, omp part
authorvries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 17 Jun 2019 14:50:21 +0000 (14:50 +0000)
committervries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 17 Jun 2019 14:50:21 +0000 (14:50 +0000)
Fix these warnings:
...
gcc/config/nvptx/nvptx.md:1074:1: warning: operand 0 missing mode?
gcc/config/nvptx/nvptx.md:1240:1: warning: operand 0 missing mode?
gcc/config/nvptx/nvptx.md:1240:1: warning: operand 1 missing mode?
gcc/config/nvptx/nvptx.md:1240:1: warning: operand 2 missing mode?
gcc/config/nvptx/nvptx.md:1268:1: warning: operand 0 missing mode?
...

Build and reg-tested on x86_64 with nvptx accelerator.

2019-06-17  Tom de Vries  <tdevries@suse.de>

* config/nvptx/nvptx-protos.h (gen_set_softstack_insn): Declare.
* config/nvptx/nvptx.c (gen_set_softstack_insn): New function.
* config/nvptx/nvptx.md (define_insn "set_softstack_insn"): Rename to
...
(define_insn "set_softstack_<mode>"): ... this.  Use P iterator on
match_operand 0.
(define_insn "omp_simt_enter_insn"): Rename to ...
(define_insn "omp_simt_enter_<mode>"): ... this.  Use P iterator on
match_operand 0, 1 and 2, as well as the unspec_volatile result.
(define_expand "omp_simt_enter): Use gen_omp_simt_enter_di and
gen_omp_simt_enter_si.
(define_expand "omp_simt_exit"): New.
(define_insn "omp_simt_exit"): Rename to ...
(define_insn "omp_simt_exit_<mode>"): ... this.  Use P iterator on
match_operand 0.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@272388 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/nvptx/nvptx-protos.h
gcc/config/nvptx/nvptx.c
gcc/config/nvptx/nvptx.md

index dfcf057efced41823ab403d4ea887dbc2022bb35..807ce3da874735d812b4df2eb25b0c8a0f135352 100644 (file)
@@ -1,3 +1,21 @@
+2019-06-17  Tom de Vries  <tdevries@suse.de>
+
+       * config/nvptx/nvptx-protos.h (gen_set_softstack_insn): Declare.
+       * config/nvptx/nvptx.c (gen_set_softstack_insn): New function.
+       * config/nvptx/nvptx.md (define_insn "set_softstack_insn"): Rename to
+       ...
+       (define_insn "set_softstack_<mode>"): ... this.  Use P iterator on
+       match_operand 0.
+       (define_insn "omp_simt_enter_insn"): Rename to ...
+       (define_insn "omp_simt_enter_<mode>"): ... this.  Use P iterator on
+       match_operand 0, 1 and 2, as well as the unspec_volatile result.
+       (define_expand "omp_simt_enter): Use gen_omp_simt_enter_di and
+       gen_omp_simt_enter_si.
+       (define_expand "omp_simt_exit"): New.
+       (define_insn "omp_simt_exit"): Rename to ...
+       (define_insn "omp_simt_exit_<mode>"): ... this.  Use P iterator on
+       match_operand 0.
+
 2019-06-17  Matthew Green  <mrg@eterna.com.au>
            Maya Rashish  <coypu@sdf.org>
 
index be09a15e49c65a665ae5e6a43c357d1408f76757..061897a39213dd249ecb4ffc890306b473d6f52d 100644 (file)
@@ -57,5 +57,6 @@ extern const char *nvptx_output_set_softstack (unsigned);
 extern const char *nvptx_output_simt_enter (rtx, rtx, rtx);
 extern const char *nvptx_output_simt_exit (rtx);
 extern const char *nvptx_output_red_partition (rtx, rtx);
+extern rtx gen_set_softstack_insn (rtx);
 #endif
 #endif
index c53a1ae9f26abf9d05231b9bb84753e4e9403a2f..aa4a67fbeadcd24151445986a8f9e3066a83605a 100644 (file)
@@ -112,6 +112,18 @@ enum nvptx_data_area
   DATA_AREA_MAX
 };
 
+rtx
+gen_set_softstack_insn (rtx op)
+{
+  gcc_assert (GET_MODE (op) == Pmode);
+  if (GET_MODE (op) == DImode)
+    return gen_set_softstack_di (op);
+  else if (GET_MODE (op) == SImode)
+    return gen_set_softstack_si (op);
+  else
+    gcc_unreachable ();
+}
+
 /*  We record the data area in the target symbol flags.  */
 #define SYMBOL_DATA_AREA(SYM) \
   (nvptx_data_area)((SYMBOL_REF_FLAGS (SYM) >> SYMBOL_FLAG_MACH_DEP_SHIFT) \
index 3ed5296db964370da6444db7cb8579defc86a583..84c0ea4543152e6a3b6f60e6ab8e31fa8410020a 100644 (file)
   DONE;
 })
 
-(define_insn "set_softstack_insn"
-  [(unspec [(match_operand 0 "nvptx_register_operand" "R")]
+(define_insn "set_softstack_<mode>"
+  [(unspec [(match_operand:P 0 "nvptx_register_operand" "R")]
           UNSPEC_SET_SOFTSTACK)]
   "TARGET_SOFT_STACK"
 {
 
 ;; Patterns for OpenMP SIMD-via-SIMT lowering
 
-(define_insn "omp_simt_enter_insn"
-  [(set (match_operand 0 "nvptx_register_operand" "=R")
-       (unspec_volatile [(match_operand 1 "nvptx_nonmemory_operand" "Ri")
-                           (match_operand 2 "nvptx_nonmemory_operand" "Ri")]
+(define_insn "omp_simt_enter_<mode>"
+  [(set (match_operand:P 0 "nvptx_register_operand" "=R")
+       (unspec_volatile:P [(match_operand:P 1 "nvptx_nonmemory_operand" "Ri")
+                           (match_operand:P 2 "nvptx_nonmemory_operand" "Ri")]
                           UNSPECV_SIMT_ENTER))]
   ""
 {
   cfun->machine->simt_stack_align = MAX (UINTVAL (operands[2]),
                                         cfun->machine->simt_stack_align);
   cfun->machine->has_simtreg = true;
-  emit_insn (gen_omp_simt_enter_insn (operands[0], operands[1], operands[2]));
+  gcc_assert (GET_MODE (operands[0]) == Pmode);
+  if (GET_MODE (operands[0]) == DImode)
+    emit_insn (gen_omp_simt_enter_di (operands[0], operands[1], operands[2]));
+  else if (GET_MODE (operands[0]) == SImode)
+    emit_insn (gen_omp_simt_enter_si (operands[0], operands[1], operands[2]));
+  else
+    gcc_unreachable ();
+  DONE;
+})
+
+(define_expand "omp_simt_exit"
+  [(match_operand 0 "nvptx_register_operand" "R")]
+  ""
+{
+  gcc_assert (GET_MODE (operands[0]) == Pmode);
+  if (GET_MODE (operands[0]) == DImode)
+    emit_insn (gen_omp_simt_exit_di (operands[0]));
+  else if (GET_MODE (operands[0]) == SImode)
+    emit_insn (gen_omp_simt_exit_si (operands[0]));
+  else
+    gcc_unreachable ();
   DONE;
 })
 
-(define_insn "omp_simt_exit"
-  [(unspec_volatile [(match_operand 0 "nvptx_register_operand" "R")]
+(define_insn "omp_simt_exit_<mode>"
+  [(unspec_volatile [(match_operand:P 0 "nvptx_register_operand" "R")]
                    UNSPECV_SIMT_EXIT)]
   ""
 {