On 18/07/2014 12:34, Roman Gareev wrote:
I suggest you use the largest available integer mode via
>mode = mode_for_size (MAX_FIXED_MODE_SIZE, MODE_INT, 0);
>type = build_nonstandard_integer_type (GET_MODE_PRECISION (mode), [01]);
Thank you for the suggestion!

>Roman, can you give this a shot?
Maybe, we could use the following code:

static int max_mode_int_precision =
   GET_MODE_PRECISION (mode_for_size (MAX_FIXED_MODE_SIZE, MODE_INT, 0));
static int graphite_expression_type_precision = 128 <= max_mode_int_precision ?

128 : max_mode_int_precision;

This allows us to change the size during debugging and avoid using
unacceptable mode size. Tobias, what do you think about this?

One comment is unclear. Otherwise it is good.

If my proposed comment is OK, please update, commit and close the bug report.

Tobias

--
                                    Cheers, Roman Gareev


ChangeLog_entry.txt


2014-07-08  Roman Gareev<gareevro...@gmail.com>

        gcc/
        * graphite-isl-ast-to-gimple.c:
        Add using of build_nonstandard_integer_type instead of
        int128_integer_type_node.


patch.txt


Index: gcc/graphite-isl-ast-to-gimple.c
===================================================================
--- gcc/graphite-isl-ast-to-gimple.c    (revision 212804)
+++ gcc/graphite-isl-ast-to-gimple.c    (working copy)
@@ -62,10 +62,13 @@

  static bool graphite_regenerate_error;

-/* We always use signed 128, until isl is able to give information about
-types  */
+/* We always use signed 128, until it is not accpeted or isl is able to give
+   information about types.  */

This is not understandable.

What about;

/* We always try to use signed 128 bit types, but fall back to smaller types in case a platform does not provide types of this sizes. In the future we should use isl to derive the optimal type for each subexpression. */

-static tree *graphite_expression_size_type = &int128_integer_type_node;
+static int max_mode_int_precision =
+  GET_MODE_PRECISION (mode_for_size (MAX_FIXED_MODE_SIZE, MODE_INT, 0));
+static int graphite_expression_type_precision = 128 <= max_mode_int_precision ?
+                                               128 : max_mode_int_precision;

  /* Converts a GMP constant VAL to a tree and returns it.  */

@@ -494,7 +497,8 @@
    tree cond_expr;
    edge exit_edge;

-  *type = *graphite_expression_size_type;
+  *type =
+    build_nonstandard_integer_type (graphite_expression_type_precision, 0);
    isl_ast_expr *for_init = isl_ast_node_for_get_init (node_for);
    *lb = gcc_expression_from_isl_expression (*type, for_init, ip);
    isl_ast_expr *upper_bound = get_upper_bound (node_for);

Reply via email to