Patchwork Couple of fixes to GRAPHITE-OpenCL

login
register
mail settings
Submitter Alexey Kravets
Date Nov. 14, 2011, 7:18 p.m.
Message ID <4EC16972.5090508@gmail.com>
Download mbox | patch
Permalink /patch/125592/
State New
Headers show

Comments

Alexey Kravets - Nov. 14, 2011, 7:18 p.m.
Hi guys,
These are couple of patches for Graphite-OpenCL.

First patch fixes lack of MINUS_EXPR processing in OpenCL kernel code 
generation.
The second one fixed VEC related issue, which caused ISE on some tests 
from NPB (NASA parallel benchmark).

ChangeLogs:
[1]
         * graphite-opencl-codegen.c (opencl_print_operand):
         Handle MINUS_EXPR in OpenCL kernel code generation.

[2]
         * graphite-opencl.c (opencl_postpass_data): Use correct
         vectors for processing postpass data in opencl_postpass_data

Patch

        * graphite-opencl-codegen.c (opencl_print_operand):
        Handle MINUS_EXPR in OpenCL kernel code generation.

diff --git a/gcc/graphite-opencl-codegen.c b/gcc/graphite-opencl-codegen.c
index 450eded..e7a8703 100644
--- a/gcc/graphite-opencl-codegen.c
+++ b/gcc/graphite-opencl-codegen.c
@@ -1146,6 +1146,20 @@  opencl_print_operand (tree node, bool lhs, opencl_main code_gen)
         opencl_append_string_to_body (")", code_gen);
         return 0;
       }
+    case MINUS_EXPR:
+      {
+        if (lhs)
+          return -1;
+
+        opencl_append_string_to_body ("(", code_gen);
+        opencl_print_operand (TREE_OPERAND (node, 0), false, code_gen);
+        opencl_append_string_to_body (" - ", code_gen);
+        opencl_print_operand (TREE_OPERAND (node, 1), false, code_gen);
+        opencl_append_string_to_body (")", code_gen);
+        return 0;
+      }
+
+

     case MULT_EXPR:
       {