(casesi_2): Operand 0 is HImode; add SIGN_EXTEND when adding to pc.
authorRichard Kenner <kenner@gcc.gnu.org>
Wed, 17 Aug 1994 22:01:17 +0000 (18:01 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Wed, 17 Aug 1994 22:01:17 +0000 (18:01 -0400)
(casesi): Operand 0 is HImode.
(unnamed PC addition pattern): Add SIGN_EXTEND to add HImode offset to
SImode PC.

From-SVN: r7937

gcc/config/fx80/fx80.md

index b0c6bec..5ca6dab 100644 (file)
   "")
 
 (define_expand "casesi_2"
-  [(set (match_operand:SI 0 "" "") (mem:HI (match_operand:SI 1 "" "")))
+  [(set (match_operand:HI 0 "" "") (mem:HI (match_operand:SI 1 "" "")))
    ;; The USE here is so that at least one jump-insn will refer to the label,
    ;; to keep it alive in jump_optimize.
    (parallel [(set (pc)
-                  (plus:SI (pc) (match_dup 0)))
+                  (plus:SI (pc) (sign_extend:SI (match_dup 0))))
              (use (label_ref (match_operand 2 "" "")))])]
   ""
   "")
 (define_expand "casesi"
   ;; We don't use these for generating the RTL, but we must describe
   ;; the operands here.
-  [(match_operand:SI 0 "general_operand" "")
+  [(match_operand:HI 0 "general_operand" "")
    (match_operand:SI 1 "immediate_operand" "")
    (match_operand:SI 2 "general_operand" "")
    (match_operand 3 "" "")
 ;; Recognize one of the insns resulting from casesi_2.
 (define_insn ""
   [(set (pc)
-       (plus:SI (pc) (match_operand:HI 0 "general_operand" "r")))
+       (plus:SI (pc)
+                (sign_extend:SI (match_operand:HI 0 "general_operand" "r"))))
    (use (label_ref (match_operand 1 "" "")))]
   ""
   "*