Commit e919e5bf by Richard Earnshaw Committed by Richard Earnshaw

re PR tree-optimization/54295 (Widening multiply-accumulate operation uses wrong value extension)

	PR tree-ssa/54295
	* tree-ssa-math-opts.c (widening_mult_conversion_strippable_p):
	Sign-extension of a zero-extended value can be simplified to
	just zero-extension.

testsuite:
	* gcc.target/arm/pr50318-1.c: Scan for smlal.
	* gcc.target/arm/smlaltb-1.c: XFAIL test.
	* gcc.target/arm/smlaltt-1.c: Likewise.

From-SVN: r191066
parent 81ab7312
2012-09-07 Richard Earnshaw <rearnsha@arm.com>
PR tree-ssa/54295
* tree-ssa-math-opts.c (widening_mult_conversion_strippable_p):
Sign-extension of a zero-extended value can be simplified to
just zero-extension.
2012-09-07 Richard Guenther <rguenther@suse.de>
PR middle-end/53667
......
2012-09-07 Richard Earnshaw <rearnsha@arm.com>
* gcc.target/arm/pr50318-1.c: Scan for smlal.
* gcc.target/arm/smlaltb-1.c: XFAIL test.
* gcc.target/arm/smlaltt-1.c: Likewise.
2012-09-07 Eric Botcazou <ebotcazou@adacore.com>
* gcc.dg/pr44194-1.c: Skip on Alpha and adjust regexp for SPARC64.
......
......@@ -8,4 +8,4 @@ long long test (unsigned int sec, unsigned long long nsecs)
long)nsecs;
}
/* { dg-final { scan-assembler "umlal" } } */
/* { dg-final { scan-assembler "smlal" } } */
......@@ -11,4 +11,4 @@ foo (long long x, int in)
return x + b * a;
}
/* { dg-final { scan-assembler "smlaltb\\t" } } */
/* { dg-final { scan-assembler "smlaltb\\t" { xfail *-*-* } } } */
......@@ -11,4 +11,4 @@ foo (long long x, int in1, int in2)
return x + b * a;
}
/* { dg-final { scan-assembler "smlaltt\\t" } } */
/* { dg-final { scan-assembler "smlaltt\\t" { xfail *-*-* } } } */
......@@ -1985,7 +1985,11 @@ widening_mult_conversion_strippable_p (tree result_type, gimple stmt)
the operation and doesn't narrow the range. */
inner_op_type = TREE_TYPE (gimple_assign_rhs1 (stmt));
if (TYPE_UNSIGNED (op_type) == TYPE_UNSIGNED (inner_op_type)
/* If the inner-most type is unsigned, then we can strip any
intermediate widening operation. If it's signed, then the
intermediate widening operation must also be signed. */
if ((TYPE_UNSIGNED (inner_op_type)
|| TYPE_UNSIGNED (op_type) == TYPE_UNSIGNED (inner_op_type))
&& TYPE_PRECISION (op_type) > TYPE_PRECISION (inner_op_type))
return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment