* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191066
138bc75d-0d04-0410-961f-
82ee72b054a4
+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.
long)nsecs;
}
-/* { dg-final { scan-assembler "umlal" } } */
+/* { dg-final { scan-assembler "smlal" } } */
return x + b * a;
}
-/* { dg-final { scan-assembler "smlaltb\\t" } } */
+/* { dg-final { scan-assembler "smlaltb\\t" { xfail *-*-* } } } */
return x + b * a;
}
-/* { dg-final { scan-assembler "smlaltt\\t" } } */
+/* { dg-final { scan-assembler "smlaltt\\t" { xfail *-*-* } } } */
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;