+2017-02-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
+
+ * gimple-pretty-print.c (dump_ternary_rhs): Adjust gimple dump format
+ for FMA_EXPR.
+
2017-02-18 Jakub Jelinek <jakub@redhat.com>
* final.c (last_columnnum, override_columnnum): New variables.
+2017-02-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
+
+ * gimple-parser.c (c_parser_gimple_postfix_expression): Handle
+ FMA_EXPR.
+
2017-02-16 Jakub Jelinek <jakub@redhat.com>
PR c++/79512
expr.value = fold_convert (type, val);
return expr;
}
+ else if (strcmp (IDENTIFIER_POINTER (id), "__FMA") == 0)
+ {
+ c_parser_consume_token (parser);
+ auto_vec<tree> args;
+
+ if (c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>"))
+ {
+ c_parser_gimple_expr_list (parser, &args);
+ c_parser_skip_until_found (parser, CPP_CLOSE_PAREN,
+ "expected %<)%>");
+ }
+ if (args.length () != 3)
+ {
+ error_at (loc, "invalid number of operands to __FMA");
+ expr.value = error_mark_node;
+ return expr;
+ }
+ expr.value = build3_loc (loc, FMA_EXPR, TREE_TYPE (args[0]),
+ args[0], args[1], args[2]);
+ return expr;
+ }
+
/* SSA name. */
unsigned version, ver_offset;
if (! lookup_name (id)
break;
case FMA_EXPR:
- dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false);
- pp_string (buffer, " * ");
- dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false);
- pp_string (buffer, " + ");
- dump_generic_node (buffer, gimple_assign_rhs3 (gs), spc, flags, false);
+ if (flags & TDF_GIMPLE)
+ {
+ pp_string (buffer, "__FMA (");
+ dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false);
+ pp_comma (buffer);
+ dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false);
+ pp_comma (buffer);
+ dump_generic_node (buffer, gimple_assign_rhs3 (gs), spc, flags, false);
+ pp_right_paren (buffer);
+ }
+ else
+ {
+ dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false);
+ pp_string (buffer, " * ");
+ dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false);
+ pp_string (buffer, " + ");
+ dump_generic_node (buffer, gimple_assign_rhs3 (gs), spc, flags, false);
+ }
break;
case DOT_PROD_EXPR:
+2017-02-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
+
+ * gcc.dg/gimplefe-26.c: New test.
+
2017-02-18 John David Anglin <danglin@gcc.gnu.org>
* g++.dg/tls/thread_local-order2.C: xfail on hppa*-*-hpux*.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O -fgimple -fdump-tree-ssa-gimple" } */
+
+#define foo(type, num) \
+type __GIMPLE () foo_##num (type a, type b, type c) \
+{ \
+ type t0; \
+ t0_1 = __FMA (a, b, c); \
+ return t0_1; \
+}
+
+foo(float, 1)
+foo(double, 2)
+foo(long double, 3)
+
+/* { dg-final { scan-tree-dump-times "__FMA" 3 "ssa" } } */