Skip to content
Snippets Groups Projects
Commit 0a8f32b8 authored by Richard Biener's avatar Richard Biener Committed by Naveen H.S
Browse files

fold-const.c (fold_binary_loc): Move (-A) * (-B) -> A * B to match.pd.


2015-10-20  Richard Biener  <rguenther@suse.de>
	    Naveen H.S  <Naveen.Hurugalawadi@caviumnetworks.com>

	* fold-const.c (fold_binary_loc) : Move (-A) * (-B) -> A * B
	to match.pd.
	Move (a * (1 << b)) is (a << b) to match.pd.
	Move convert (C1/X)*C2 into (C1*C2)/X to match.pd.
	Move ~X & X, (X == 0) & X, and !X & X are zero to match.pd.
	Move X & ~X , X & (X == 0), and X & !X are zero to match.pd.

	* match.pd (mult:c @0 (convert? (lshift integer_onep@1 @2))):
	New simplifier.
	(mult (rdiv:s REAL_CST@0 @1) REAL_CST@2): New simplifier.
	(bit_and:c (convert? @0) (convert? (bit_not @0))): New simplifier.
	(bit_ior (bit_and:s @0 (bit_not:s @1)) (bit_and:s (bit_not:s @0) @1))
	: New simplifier.
	(mult:c (convert1? (negate @0)) (convert2? negate_expr_p@1)):
	New simplifier.
	(match (logical_inverted_value @0) (truth_not @0)) : New Predicate.


Co-Authored-By: default avatarNaveen H.S <Naveen.Hurugalawadi@caviumnetworks.com>

From-SVN: r229107
parent d0761942
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment