aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/aarch64/predicates.md
diff options
context:
space:
mode:
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>2014-09-02 15:53:08 +0000
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>2014-09-02 15:53:08 +0000
commitcd5660ab1229ff6b47987f81769d908970ea0950 (patch)
tree4a49b13722470fe0ae6029e3f651362067132e2a /gcc/config/aarch64/predicates.md
parentcec362c90b53bec41a0571220216401978b3a6ad (diff)
downloadgcc-cd5660ab1229ff6b47987f81769d908970ea0950.zip
gcc-cd5660ab1229ff6b47987f81769d908970ea0950.tar.gz
gcc-cd5660ab1229ff6b47987f81769d908970ea0950.tar.bz2
[AArch64] Use CC_Z and CC_NZ with csinc and similar instructions.
* config/aarch64/predicates.md (aarch64_comparison_operation): New special predicate. * config/aarch64/aarch64.md (*csinc2<mode>_insn): Use aarch64_comparison_operation instead of matching an operator. Update operand numbers. (csinc3<mode>_insn): Likewise. (*csinv3<mode>_insn): Likewise. (*csneg3<mode>_insn): Likewise. (ffs<mode>2): Update gen_csinc3<mode>_insn callsite. * config/aarch64/aarch64.c (aarch64_get_condition_code): Return -1 instead of aborting on invalid condition codes. (aarch64_print_operand): Update aarch64_get_condition_code callsites to assert that the returned condition code is valid. * config/aarch64/aarch64-protos.h (aarch64_get_condition_code): Export. From-SVN: r214824
Diffstat (limited to 'gcc/config/aarch64/predicates.md')
-rw-r--r--gcc/config/aarch64/predicates.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/config/aarch64/predicates.md b/gcc/config/aarch64/predicates.md
index 3dd83ca..c1510ca 100644
--- a/gcc/config/aarch64/predicates.md
+++ b/gcc/config/aarch64/predicates.md
@@ -202,6 +202,18 @@
(define_special_predicate "aarch64_comparison_operator"
(match_code "eq,ne,le,lt,ge,gt,geu,gtu,leu,ltu,unordered,ordered,unlt,unle,unge,ungt"))
+(define_special_predicate "aarch64_comparison_operation"
+ (match_code "eq,ne,le,lt,ge,gt,geu,gtu,leu,ltu,unordered,ordered,unlt,unle,unge,ungt")
+{
+ if (XEXP (op, 1) != const0_rtx)
+ return false;
+ rtx op0 = XEXP (op, 0);
+ if (!REG_P (op0) || REGNO (op0) != CC_REGNUM)
+ return false;
+ return aarch64_get_condition_code (op) >= 0;
+})
+
+
;; True if the operand is memory reference suitable for a load/store exclusive.
(define_predicate "aarch64_sync_memory_operand"
(and (match_operand 0 "memory_operand")