From: Joern Rennecke Date: Mon, 8 Apr 2013 15:52:44 +0000 (+0000) Subject: constraints.md (CnL): New constraint. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fa7707d6e757b2a61aef76f42b05fead6e5b29ab;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 35188224b8d..3ad208c8daa 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 PR c++/34949 diff --git a/gcc/config/epiphany/constraints.md b/gcc/config/epiphany/constraints.md index bd3d935a275..d4d6049fe67 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 7c21a349c0c..e4750eeaab0 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 1ae5824f337..af60d7c73f7 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