diff options
author | Jeff Law <law@gcc.gnu.org> | 1992-12-08 09:54:51 -0700 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1992-12-08 09:54:51 -0700 |
commit | 9bb77117a9a608c39ce1fe0bbe5c8ff9006597c5 (patch) | |
tree | 6b244a8ca981b9eae06271552b44006d564a1794 | |
parent | a603c4aa001a2620029526f8dca77b3e53dcb54c (diff) | |
download | gcc-9bb77117a9a608c39ce1fe0bbe5c8ff9006597c5.zip gcc-9bb77117a9a608c39ce1fe0bbe5c8ff9006597c5.tar.gz gcc-9bb77117a9a608c39ce1fe0bbe5c8ff9006597c5.tar.bz2 |
* pa.c (shadd_operand): Newfunction.
From-SVN: r2850
-rw-r--r-- | gcc/config/pa/pa.c | 15 | ||||
-rw-r--r-- | gcc/config/pa/pa.md | 8 |
2 files changed, 19 insertions, 4 deletions
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 8b32e19..0cd4576 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -2520,3 +2520,18 @@ function_label_operand (op, mode) { return GET_CODE (op) == SYMBOL_REF && FUNCTION_NAME_P (XSTR (op, 0)); } + +/* Return 1 if OP is suitable for the second add operand (the unshifed + operand) in an shadd instruction. Allow CONST_INT to work around + a reload bug. */ +int +shadd_operand (op, mode) + rtx op; + enum machine_mode mode; +{ + if (GET_CODE (op) == REG) + return 1; + if (GET_CODE (op) == CONST_INT) + return 1; + return 0; +} diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index 1eff359..cf95448 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -2039,13 +2039,13 @@ [(set_attr "type" "load") (set_attr "length" "1")]) -;; Using nonmemory_operand works around a bug in reload. For 2.4 fix +;; Using shadd_operand works around a bug in reload. For 2.4 fix ;; reload and use register_operand instead. (define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (plus:SI (mult:SI (match_operand:SI 2 "register_operand" "r") (const_int 2)) - (match_operand:SI 1 "nonmemory_operand" "r")))] + (match_operand:SI 1 "shadd_operand" "r")))] "" "sh1add %2,%1,%0") @@ -2053,7 +2053,7 @@ [(set (match_operand:SI 0 "register_operand" "=r") (plus:SI (mult:SI (match_operand:SI 2 "register_operand" "r") (const_int 4)) - (match_operand:SI 1 "nonmemory_operand" "r")))] + (match_operand:SI 1 "shadd_operand" "r")))] "" "sh2add %2,%1,%0") @@ -2061,7 +2061,7 @@ [(set (match_operand:SI 0 "register_operand" "=r") (plus:SI (mult:SI (match_operand:SI 2 "register_operand" "r") (const_int 8)) - (match_operand:SI 1 "nonmemory_operand" "r")))] + (match_operand:SI 1 "shadd_operand" "r")))] "" "sh3add %2,%1,%0") |