aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1993-05-26 15:39:50 -0700
committerJim Wilson <wilson@gcc.gnu.org>1993-05-26 15:39:50 -0700
commit2b7794ad0be64f46c4ad99ca580a5eabe86a3d37 (patch)
tree2a67a2b99ed2ad51b71966af88d239703024c278 /gcc
parent4055b808f5c0ba445811a205d3b67c24299df4e1 (diff)
downloadgcc-2b7794ad0be64f46c4ad99ca580a5eabe86a3d37.zip
gcc-2b7794ad0be64f46c4ad99ca580a5eabe86a3d37.tar.gz
gcc-2b7794ad0be64f46c4ad99ca580a5eabe86a3d37.tar.bz2
(ashlsi3): Use shlo instead of shli.
From-SVN: r4577
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/i960/i960.md10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/config/i960/i960.md b/gcc/config/i960/i960.md
index 191cee9..dd52829 100644
--- a/gcc/config/i960/i960.md
+++ b/gcc/config/i960/i960.md
@@ -2092,12 +2092,20 @@
;; Arithmetic shift instructions.
+;; The shli instruction generates an overflow fault if the sign changes.
+;; In the case of overflow, it does not give the natural result, it instead
+;; gives the last shift value before the overflow. We can not use this
+;; instruction because gcc thinks that arithmetic left shift and logical
+;; left shift are identical, and sometimes canonicalizes the logical left
+;; shift to an arithmetic left shift. Therefore we must always use the
+;; logical left shift instruction.
+
(define_insn "ashlsi3"
[(set (match_operand:SI 0 "register_operand" "=d")
(ashift:SI (match_operand:SI 1 "arith_operand" "dI")
(match_operand:SI 2 "arith_operand" "dI")))]
""
- "shli %2,%1,%0"
+ "shlo %2,%1,%0"
[(set_attr "type" "alu2")])
(define_insn "ashrsi3"