aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Demetriou <cgd@broadcom.com>2002-02-08 22:46:27 +0000
committerChris Demetriou <cgd@gcc.gnu.org>2002-02-08 14:46:27 -0800
commit6a5ea3f4ab7b16f12da8920a4cdd22f7eba52725 (patch)
treecff0f47ee9d3538eba678b4947cf3768d44fce3d
parentfdf473ae1b7e9b775418aa69918641dd651d0150 (diff)
downloadgcc-6a5ea3f4ab7b16f12da8920a4cdd22f7eba52725.zip
gcc-6a5ea3f4ab7b16f12da8920a4cdd22f7eba52725.tar.gz
gcc-6a5ea3f4ab7b16f12da8920a4cdd22f7eba52725.tar.bz2
mips.md (casesi_internal_di): Calculate the index into the target offset table correctly.
2002-02-07 Chris Demetriou <cgd@broadcom.com> * config/mips/mips.md (casesi_internal_di): Calculate the index into the target offset table correctly. From-SVN: r49623
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/mips/mips.md6
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2d78c26..5736247 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2002-02-07 Chris Demetriou <cgd@broadcom.com>
+
+ * config/mips/mips.md (casesi_internal_di): Calculate
+ the index into the target offset table correctly.
+
2002-02-08 Richard Henderson <rth@redhat.com>
* expr.c (expand_expr): Mind EXPAND_INITIALIZER for truncation also.
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index 4eadada..ba3e975 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -9481,16 +9481,18 @@ lw\\t%2,%1-%S1(%2)\;addu\\t%2,%2,$31\;j\\t%2"
(set_attr "mode" "none")
(set_attr "length" "24")])
+;; This code assumes that the table index will never be >= 29 bits wide,
+;; which allows the 'sign extend' from SI to DI be a no-op.
(define_insn "casesi_internal_di"
[(set (pc)
(mem:DI (plus:DI (sign_extend:DI
(mult:SI (match_operand:SI 0 "register_operand" "d")
- (const_int 4)))
+ (const_int 8)))
(label_ref (match_operand 1 "" "")))))
(clobber (match_operand:DI 2 "register_operand" "=d"))
(clobber (reg:DI 31))]
"TARGET_EMBEDDED_PIC"
- "%(bal\\t%S1\;sll\\t%2,%0,2\\n%~%S1:\;addu\\t%2,%2,$31%)\;\\
+ "%(bal\\t%S1\;sll\\t%2,%0,3\\n%~%S1:\;daddu\\t%2,%2,$31%)\;\\
ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j\\t%2"
[(set_attr "type" "jump")
(set_attr "mode" "none")