aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJoern Rennecke <joern.rennecke@embecosm.com>2013-04-08 15:52:44 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>2013-04-08 16:52:44 +0100
commitfa7707d6e757b2a61aef76f42b05fead6e5b29ab (patch)
tree92e84a124ce8dc29ed164aab47dc013c17d90253 /gcc
parent8afab2373c39baa4ca468217d194324f874ce50d (diff)
downloadgcc-fa7707d6e757b2a61aef76f42b05fead6e5b29ab.zip
gcc-fa7707d6e757b2a61aef76f42b05fead6e5b29ab.tar.gz
gcc-fa7707d6e757b2a61aef76f42b05fead6e5b29ab.tar.bz2
constraints.md (CnL): New constraint.
* config/epiphany/constraints.md (CnL): New constraint. * config/epiphany/epiphany.md (addsi3_i): Add r/r/CnL alternative. * config/epiphany/predicates.md (add_operand): Allow 1024. From-SVN: r197588
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/config/epiphany/constraints.md5
-rw-r--r--gcc/config/epiphany/epiphany.md14
-rw-r--r--gcc/config/epiphany/predicates.md2
4 files changed, 20 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3518822..3ad208c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -16,6 +16,10 @@
* config/epiphany/epiphany.md (cmpsf_ord): Make pattern
unconditional.
+ * config/epiphany/constraints.md (CnL): New constraint.
+ * config/epiphany/epiphany.md (addsi3_i): Add r/r/CnL alternative.
+ * config/epiphany/predicates.md (add_operand): Allow 1024.
+
2013-04-08 Jakub Jelinek <jakub@redhat.com>
PR c++/34949
diff --git a/gcc/config/epiphany/constraints.md b/gcc/config/epiphany/constraints.md
index bd3d935..d4d6049 100644
--- a/gcc/config/epiphany/constraints.md
+++ b/gcc/config/epiphany/constraints.md
@@ -39,6 +39,11 @@
(and (match_code "const_int")
(match_test "SIMM11 (ival)")))
+(define_constraint "CnL"
+ "A negated signed 11-bit constant."
+ (and (match_code "const_int")
+ (match_test "SIMM11 (-ival)")))
+
(define_constraint "Cm1"
"A signed 11-bit constant added to -1"
(and (match_code "const_int")
diff --git a/gcc/config/epiphany/epiphany.md b/gcc/config/epiphany/epiphany.md
index 7c21a34..e4750ee 100644
--- a/gcc/config/epiphany/epiphany.md
+++ b/gcc/config/epiphany/epiphany.md
@@ -430,13 +430,19 @@
DONE;
}")
+; The default case of epiphany_print_operand emits IMMEDIATE_PREFIX
+; where appropriate; however, 'n' is processed by output_asm_insn
+; which doesn't, so we have to explicitly emit the '# in the
+; r/r/CnL output template alternative.
(define_insn "addsi3_i"
- [(set (match_operand:SI 0 "add_reg_operand" "=r")
- (plus:SI (match_operand:SI 1 "add_reg_operand" "%r")
- (match_operand:SI 2 "add_operand" "rL")))
+ [(set (match_operand:SI 0 "add_reg_operand" "=r,r")
+ (plus:SI (match_operand:SI 1 "add_reg_operand" "%r,r")
+ (match_operand:SI 2 "add_operand" "rL,CnL")))
(clobber (reg:CC CC_REGNUM))]
""
- "add %0,%1,%2"
+ "@
+ add %0,%1,%2
+ sub %0,%1,#%n2"
[(set_attr "type" "misc")])
; We use a clobber of UNKNOWN_REGNUM here so that the peephole optimizers
diff --git a/gcc/config/epiphany/predicates.md b/gcc/config/epiphany/predicates.md
index 1ae5824..af60d7c 100644
--- a/gcc/config/epiphany/predicates.md
+++ b/gcc/config/epiphany/predicates.md
@@ -98,7 +98,7 @@
{
if (GET_CODE (op) == REG || GET_CODE (op) == SUBREG)
return add_reg_operand (op, mode);
- return satisfies_constraint_L (op);
+ return satisfies_constraint_L (op) || satisfies_constraint_CnL (op);
})
;; Ordinary 3rd operand for arithmetic operations