aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorMatthew Gretton-Dann <matthew.gretton-dann@linaro.org>2013-05-14 09:13:58 +0000
committerMatthew Gretton-Dann <matthew.gretton-dann@linaro.org>2013-05-14 09:13:58 +0000
commitb4fcb647d8bd393cd85585e850892c9d1f741d8a (patch)
tree3101282b812fb9d1b65ed26ea8e23141631719df /gcc/config
parent49d58c0d67c6c0f631f6a414c8d22172f62144a3 (diff)
Backport from trunk r197838.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_8-branch@198865 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/aarch64/aarch64.c3
-rw-r--r--gcc/config/aarch64/aarch64.md15
2 files changed, 17 insertions, 1 deletions
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 501136b07fa..1615a16b53a 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -3087,7 +3087,8 @@ aarch64_select_cc_mode (RTX_CODE code, rtx x, rtx y)
if ((GET_MODE (x) == SImode || GET_MODE (x) == DImode)
&& y == const0_rtx
&& (code == EQ || code == NE || code == LT || code == GE)
- && (GET_CODE (x) == PLUS || GET_CODE (x) == MINUS || GET_CODE (x) == AND))
+ && (GET_CODE (x) == PLUS || GET_CODE (x) == MINUS || GET_CODE (x) == AND
+ || GET_CODE (x) == NEG))
return CC_NZmode;
/* A compare with a shifted operand. Because of canonicalization,
diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
index ff8fdc4193e..1564ce1de6a 100644
--- a/gcc/config/aarch64/aarch64.md
+++ b/gcc/config/aarch64/aarch64.md
@@ -2039,6 +2039,21 @@
(set_attr "mode" "SI")]
)
+(define_insn "*neg_<shift><mode>3_compare0"
+ [(set (reg:CC_NZ CC_REGNUM)
+ (compare:CC_NZ
+ (neg:GPI (ASHIFT:GPI
+ (match_operand:GPI 1 "register_operand" "r")
+ (match_operand:QI 2 "aarch64_shift_imm_<mode>" "n")))
+ (const_int 0)))
+ (set (match_operand:GPI 0 "register_operand" "=r")
+ (neg:GPI (ASHIFT:GPI (match_dup 1) (match_dup 2))))]
+ ""
+ "negs\\t%<w>0, %<w>1, <shift> %2"
+ [(set_attr "v8type" "alus_shift")
+ (set_attr "mode" "<MODE>")]
+)
+
(define_insn "*neg_<shift>_<mode>2"
[(set (match_operand:GPI 0 "register_operand" "=r")
(neg:GPI (ASHIFT:GPI