diff options
author | Jeff Law <law@gcc.gnu.org> | 1993-01-03 12:02:27 -0700 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1993-01-03 12:02:27 -0700 |
commit | 2c871711c3e85fc89e67b24e39199f1ac0f18b02 (patch) | |
tree | 42266e9434e60b77edfa9fbe0234cdfcb5f96630 /gcc | |
parent | 9d32f4a54a6978fe264486c3405ed0f380d1f3f7 (diff) | |
download | gcc-2c871711c3e85fc89e67b24e39199f1ac0f18b02.zip gcc-2c871711c3e85fc89e67b24e39199f1ac0f18b02.tar.gz gcc-2c871711c3e85fc89e67b24e39199f1ac0f18b02.tar.bz2 |
pa.md (fmpyadd peepholes): New peepholes to issue independent floating point multiply and add instructions...
* pa.md (fmpyadd peepholes): New peepholes to issue independent
floating point multiply and add instructions at the same time.
(fmpysub peepholes): Likewise for multiply and subtract instructions.
From-SVN: r3069
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/pa/pa.md | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index 1743b3d..af805d5 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -2532,6 +2532,79 @@ (const_int 5)))))]) +;; The next four peepholes take advantage of the new 5 operand +;; fmpy{add,sub} instructions available on 1.1 CPUS. Basically +;; fmpyadd performs a multiply and add/sub of independent operands +;; at the same time. Because the operands must be independent +;; combine will not try to combine such insns... Thus we have +;; to use a peephole. +(define_peephole + [(set (match_operand 0 "register_operand" "=fx") + (mult (match_operand 1 "register_operand" "fx") + (match_operand 2 "register_operand" "fx"))) + (set (match_operand 3 "register_operand" "+fx") + (plus (match_operand 4 "register_operand" "fx") + (match_operand 5 "register_operand" "fx")))] + "TARGET_SNAKE && fmpyaddoperands (operands)" + "* +{ + if (GET_MODE (operands[0]) == DFmode) + return \"fmpyadd,dbl %1,%2,%0,%4,%3\"; + else + return \"fmpyadd,sgl %1,%2,%0,%4,%3\"; +}") + + +(define_peephole + [(set (match_operand 3 "register_operand" "+fx") + (plus (match_operand 4 "register_operand" "fx") + (match_operand 5 "register_operand" "fx"))) + (set (match_operand 0 "register_operand" "=fx") + (mult (match_operand 1 "register_operand" "fx") + (match_operand 2 "register_operand" "fx")))] + "TARGET_SNAKE && fmpyaddoperands (operands)" + "* +{ + if (GET_MODE (operands[0]) == DFmode) + return \"fmpyadd,dbl %1,%2,%0,%4,%3\"; + else + return \"fmpyadd,sgl %1,%2,%0,%4,%3\"; +}") + +;; Note fsub subtracts the second operand from the first while fmpysub +;; does the opposite for the subtraction operands! +(define_peephole + [(set (match_operand 0 "register_operand" "=fx") + (mult (match_operand 1 "register_operand" "fx") + (match_operand 2 "register_operand" "fx"))) + (set (match_operand 3 "register_operand" "+fx") + (minus (match_operand 4 "register_operand" "fx") + (match_operand 5 "register_operand" "fx")))] + "TARGET_SNAKE && fmpysuboperands (operands)" + "* +{ + if (GET_MODE (operands[0]) == DFmode) + return \"fmpysub,dbl %1,%2,%0,%5,%3\"; + else + return \"fmpysub,sgl %1,%2,%0,%5,%3\"; +}") + +(define_peephole + [(set (match_operand 3 "register_operand" "+fx") + (minus (match_operand 4 "register_operand" "fx") + (match_operand 5 "register_operand" "fx"))) + (set (match_operand 0 "register_operand" "=fx") + (mult (match_operand 1 "register_operand" "fx") + (match_operand 2 "register_operand" "fx")))] + "TARGET_SNAKE && fmpysuboperands (operands)" + "* +{ + if (GET_MODE (operands[0]) == DFmode) + return \"fmpysub,dbl %1,%2,%0,%5,%3\"; + else + return \"fmpysub,sgl %1,%2,%0,%5,%3\"; +}") + ;;- Local variables: ;;- mode:emacs-lisp |