Skip to content
Snippets Groups Projects
Commit c2bb84be authored by Sudi Das's avatar Sudi Das Committed by Omar Tahir
Browse files

[PATCH 2/5][Arm] New pattern for CSINV instructions


This patch adds a new pattern, *thumb2_csinv, for generating CSINV nstructions.

This pattern relies on a few general changes that will be used throughout
the following patches:
	- A new macro, TARGET_COND_ARITH, which is only true on 8.1-M Mainline
	  and represents the existence of these conditional instructions.
	- A change to the cond exec hook, arm_have_conditional_execution, which
	  now returns false if TARGET_COND_ARITH before reload. This allows for
	  some ifcvt transformations when they would usually be disabled. I've
	  written a rather verbose comment (with the risk of over-explaining)
	  as it's a bit of a confusing change.
	- One new predicate.
	- *thumb2_movcond has been restricted to only match if !TARGET_COND_ARITH,
	  otherwise it triggers undesirable combines.

gcc/ChangeLog:

	* config/arm/arm.h (TARGET_COND_ARITH): New macro.
	* config/arm/arm.c (arm_have_conditional_execution): Return false if
	TARGET_COND_ARITH before reload.
	* config/arm/predicates.md (arm_comparison_operation): Returns true if
	comparing CC_REGNUM with constant zero.
	* config/arm/thumb2.md (*thumb2_csinv): New.
	(*thumb2_movcond): Don't match if TARGET_COND_ARITH.

gcc/testsuite/ChangeLog:

	* gcc.target/arm/csinv-1.c: New test.

Co-authored-by: default avatarOmar Tahir <omar.tahir@arm.com>
parent 3c7c5f1d
No related branches found
No related tags found
Loading
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