From 6a5ea3f4ab7b16f12da8920a4cdd22f7eba52725 Mon Sep 17 00:00:00 2001 From: Chris Demetriou Date: Fri, 8 Feb 2002 22:46:27 +0000 Subject: [PATCH] mips.md (casesi_internal_di): Calculate the index into the target offset table correctly. 2002-02-07 Chris Demetriou * config/mips/mips.md (casesi_internal_di): Calculate the index into the target offset table correctly. From-SVN: r49623 --- gcc/ChangeLog | 5 +++++ gcc/config/mips/mips.md | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2d78c2699ab..5736247bb10 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-02-07 Chris Demetriou + + * config/mips/mips.md (casesi_internal_di): Calculate + the index into the target offset table correctly. + 2002-02-08 Richard Henderson * 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 4eadada89e7..ba3e9754c5b 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") -- 2.30.2