Commit 0088e8ba by Richard Kenner

(ashlsi3, ashrsi3, lshrsi3): Use arith_operand instead of shift_operand.

(ashlsi3, ashrsi3, lshrsi3): Use arith_operand instead of
shift_operand.  Truncate shift counts to 5 bits.

From-SVN: r6182
parent 1438de58
;;- Machine description for SPARC chip for GNU C compiler ;;- Machine description for SPARC chip for GNU C compiler
;; Copyright (C) 1987, 1988, 1989, 1992 Free Software Foundation, Inc. ;; Copyright (C) 1987, 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
;; Contributed by Michael Tiemann (tiemann@cygnus.com) ;; Contributed by Michael Tiemann (tiemann@cygnus.com)
;; This file is part of GNU CC. ;; This file is part of GNU CC.
...@@ -2525,9 +2525,16 @@ ...@@ -2525,9 +2525,16 @@
(define_insn "ashlsi3" (define_insn "ashlsi3"
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r")
(ashift:SI (match_operand:SI 1 "register_operand" "r") (ashift:SI (match_operand:SI 1 "register_operand" "r")
(match_operand:SI 2 "shift_operand" "rI")))] (match_operand:SI 2 "arith_operand" "rI")))]
"" ""
"sll %1,%2,%0") "*
{
if (GET_CODE (operands[2]) == CONST_INT
&& (unsigned) INTVAL (operands[2]) > 31)
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
return \"sll %1,%2,%0\";
}")
(define_insn "" (define_insn ""
[(set (reg:CC_NOOV 0) [(set (reg:CC_NOOV 0)
...@@ -2551,16 +2558,30 @@ ...@@ -2551,16 +2558,30 @@
(define_insn "ashrsi3" (define_insn "ashrsi3"
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r")
(ashiftrt:SI (match_operand:SI 1 "register_operand" "r") (ashiftrt:SI (match_operand:SI 1 "register_operand" "r")
(match_operand:SI 2 "shift_operand" "rI")))] (match_operand:SI 2 "arith_operand" "rI")))]
"" ""
"sra %1,%2,%0") "*
{
if (GET_CODE (operands[2]) == CONST_INT
&& (unsigned) INTVAL (operands[2]) > 31)
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
return \"sra %1,%2,%0\";
}")
(define_insn "lshrsi3" (define_insn "lshrsi3"
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r")
(lshiftrt:SI (match_operand:SI 1 "register_operand" "r") (lshiftrt:SI (match_operand:SI 1 "register_operand" "r")
(match_operand:SI 2 "shift_operand" "rI")))] (match_operand:SI 2 "arith_operand" "rI")))]
"" ""
"srl %1,%2,%0") "*
{
if (GET_CODE (operands[2]) == CONST_INT
&& (unsigned) INTVAL (operands[2]) > 31)
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
return \"srl %1,%2,%0\";
}")
;; Unconditional and other jump instructions ;; Unconditional and other jump instructions
;; On the Sparc, by setting the annul bit on an unconditional branch, the ;; On the Sparc, by setting the annul bit on an unconditional branch, the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment