diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-05-05 13:39:17 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-05-05 13:39:17 -0400 |
commit | 83a24b1d0d7894b76f1ad1e31dd149f2c6a79baf (patch) | |
tree | 8524451d1947c273c293ca2e6c2b7de6c39cf17c | |
parent | 0016a02db305538fdf351b6d1d2923ac7e5b0b39 (diff) | |
download | gcc-83a24b1d0d7894b76f1ad1e31dd149f2c6a79baf.zip gcc-83a24b1d0d7894b76f1ad1e31dd149f2c6a79baf.tar.gz gcc-83a24b1d0d7894b76f1ad1e31dd149f2c6a79baf.tar.bz2 |
(movhi): Simplify code involving jump-table reference.
(load_address): Handle case of jump-table reference; output required label.
From-SVN: r7215
-rw-r--r-- | gcc/config/m68k/m68k.md | 52 |
1 files changed, 41 insertions, 11 deletions
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md index 4365827..7e4d89e 100644 --- a/gcc/config/m68k/m68k.md +++ b/gcc/config/m68k/m68k.md @@ -832,19 +832,15 @@ /* Recognize the insn before a tablejump, one that refers to a table of offsets. Such an insn will need to refer to a label on the insn. So output one. Use the label-number - of the table of offsets to generate this label. */ + of the table of offsets to generate this label. This code, + and similar code below, assumes that there will be at most one + reference to each table. */ if (GET_CODE (operands[1]) == MEM && GET_CODE (XEXP (operands[1], 0)) == PLUS - && (GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == LABEL_REF - || GET_CODE (XEXP (XEXP (operands[1], 0), 1)) == LABEL_REF) - && GET_CODE (XEXP (XEXP (operands[1], 0), 0)) != PLUS - && GET_CODE (XEXP (XEXP (operands[1], 0), 1)) != PLUS) + && GET_CODE (XEXP (XEXP (operands[1], 0), 1)) == LABEL_REF + && GET_CODE (XEXP (XEXP (operands[1], 0), 0)) != PLUS) { - rtx labelref; - if (GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == LABEL_REF) - labelref = XEXP (XEXP (operands[1], 0), 0); - else - labelref = XEXP (XEXP (operands[1], 0), 1); + rtx labelref = XEXP (XEXP (operands[1], 0), 1); #if defined (MOTOROLA) && !defined (SGS_SWITCH_TABLES) #ifdef SGS asm_fprintf (asm_out_file, \"\\tset %LLI%d,.+2\\n\", @@ -4946,7 +4942,41 @@ [(set (match_operand:SI 0 "general_operand" "=a") (match_operand:QI 1 "address_operand" "p"))] "" - "lea %a1,%0") + "* +{ +#ifndef SGS_NO_LI + /* Recognize an insn that refers to a table of offsets. Such an insn will + need to refer to a label on the insn. So output one. Use the + label-number of the table of offsets to generate this label. This code, + and similar code above, assumes that there will be at most one reference + to each table. */ + if (GET_CODE (operands[1]) == PLUS + && GET_CODE (XEXP (operands[1], 1)) == LABEL_REF + && GET_CODE (XEXP (operands[1], 0)) != PLUS) + { + rtx labelref = XEXP (operands[1], 1); +#if defined (MOTOROLA) && !defined (SGS_SWITCH_TABLES) +#ifdef SGS + asm_fprintf (asm_out_file, \"\\tset %LLI%d,.+2\\n\", + CODE_LABEL_NUMBER (XEXP (labelref, 0))); +#else /* not SGS */ + asm_fprintf (asm_out_file, \"\\t.set %LLI%d,.+2\\n\", + CODE_LABEL_NUMBER (XEXP (labelref, 0))); +#endif /* not SGS */ +#else /* SGS_SWITCH_TABLES or not MOTOROLA */ + ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"LI\", + CODE_LABEL_NUMBER (XEXP (labelref, 0))); +#ifdef SGS_SWITCH_TABLES + /* Set flag saying we need to define the symbol + LD%n (with value L%n-LI%n) at the end of the switch table. */ + switch_table_difference_label_flag = 1; +#endif /* SGS_SWITCH_TABLES */ +#endif /* SGS_SWITCH_TABLES or not MOTOROLA */ + } +#endif /* SGS_NO_LI */ + + return \"lea %a1,%0\"; +}") ;; This is the first machine-dependent peephole optimization. ;; It is useful when a floating value is returned from a function call |