summaryrefslogtreecommitdiffstats
path: root/gcc/config/sh
diff options
context:
space:
mode:
authoraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>2010-12-16 18:41:56 +0000
committeraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>2010-12-16 18:41:56 +0000
commita24f018482c9ea7fe6be5eef19aeb1e92751bd96 (patch)
tree103380eb3323f45fe185741536abd467e74ac707 /gcc/config/sh
parent01d1f82e58c1b1578736d8a818a0e9b534c846e7 (diff)
downloadppe42-gcc-a24f018482c9ea7fe6be5eef19aeb1e92751bd96.tar.gz
ppe42-gcc-a24f018482c9ea7fe6be5eef19aeb1e92751bd96.zip
* config/sh/sh.h (OUTPUT_ADDR_CONST_EXTRA): Remove.
* config/sh/sh.c (sh_asm_output_addr_const_extra): New function. (TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA): Define. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167951 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/sh')
-rw-r--r--gcc/config/sh/sh.c114
-rw-r--r--gcc/config/sh/sh.h108
2 files changed, 113 insertions, 109 deletions
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 034b171711f..2fdf03a7c25 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -204,6 +204,7 @@ static tree sh_handle_renesas_attribute (tree *, tree, tree, int, bool *);
static void sh_print_operand (FILE *, rtx, int);
static void sh_print_operand_address (FILE *, rtx);
static bool sh_print_operand_punct_valid_p (unsigned char code);
+static bool sh_asm_output_addr_const_extra (FILE *file, rtx x);
static void sh_output_function_epilogue (FILE *, HOST_WIDE_INT);
static void sh_insert_attributes (tree, tree *);
static const char *sh_check_pch_target_flags (int);
@@ -372,7 +373,9 @@ static const struct default_options sh_option_optimization_table[] =
#define TARGET_PRINT_OPERAND_ADDRESS sh_print_operand_address
#undef TARGET_PRINT_OPERAND_PUNCT_VALID_P
#define TARGET_PRINT_OPERAND_PUNCT_VALID_P sh_print_operand_punct_valid_p
-
+#undef TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA
+#define TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA sh_asm_output_addr_const_extra
+
#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE sh_output_function_epilogue
@@ -1453,6 +1456,115 @@ sh_print_operand_punct_valid_p (unsigned char code)
return (code == '.' || code == '#' || code == '@' || code == ','
|| code == '$' || code == '\'' || code == '>');
}
+
+/* Implement TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA. */
+
+static bool
+sh_asm_output_addr_const_extra (FILE *file, rtx x)
+{
+ if (GET_CODE (x) == UNSPEC)
+ {
+ switch (XINT (x, 1))
+ {
+ case UNSPEC_DATALABEL:
+ fputs ("datalabel ", file);
+ output_addr_const (file, XVECEXP (x, 0, 0));
+ break;
+ case UNSPEC_PIC:
+ /* GLOBAL_OFFSET_TABLE or local symbols, no suffix. */
+ output_addr_const (file, XVECEXP (x, 0, 0));
+ break;
+ case UNSPEC_GOT:
+ output_addr_const (file, XVECEXP (x, 0, 0));
+ fputs ("@GOT", file);
+ break;
+ case UNSPEC_GOTOFF:
+ output_addr_const (file, XVECEXP (x, 0, 0));
+ fputs ("@GOTOFF", file);
+ break;
+ case UNSPEC_PLT:
+ output_addr_const (file, XVECEXP (x, 0, 0));
+ fputs ("@PLT", file);
+ break;
+ case UNSPEC_GOTPLT:
+ output_addr_const (file, XVECEXP (x, 0, 0));
+ fputs ("@GOTPLT", file);
+ break;
+ case UNSPEC_DTPOFF:
+ output_addr_const (file, XVECEXP (x, 0, 0));
+ fputs ("@DTPOFF", file);
+ break;
+ case UNSPEC_GOTTPOFF:
+ output_addr_const (file, XVECEXP (x, 0, 0));
+ fputs ("@GOTTPOFF", file);
+ break;
+ case UNSPEC_TPOFF:
+ output_addr_const (file, XVECEXP (x, 0, 0));
+ fputs ("@TPOFF", file);
+ break;
+ case UNSPEC_CALLER:
+ {
+ char name[32];
+ /* LPCS stands for Label for PIC Call Site. */
+ targetm.asm_out.generate_internal_label (name, "LPCS",
+ INTVAL (XVECEXP (x, 0, 0)));
+ assemble_name (file, name);
+ }
+ break;
+ case UNSPEC_EXTRACT_S16:
+ case UNSPEC_EXTRACT_U16:
+ {
+ rtx val, shift;
+
+ val = XVECEXP (x, 0, 0);
+ shift = XVECEXP (x, 0, 1);
+ fputc ('(', file);
+ if (shift != const0_rtx)
+ fputc ('(', file);
+ if (GET_CODE (val) == CONST
+ || GET_RTX_CLASS (GET_CODE (val)) != RTX_OBJ)
+ {
+ fputc ('(', file);
+ output_addr_const (file, val);
+ fputc (')', file);
+ }
+ else
+ output_addr_const (file, val);
+ if (shift != const0_rtx)
+ {
+ fputs (" >> ", file);
+ output_addr_const (file, shift);
+ fputc (')', file);
+ }
+ fputs (" & 65535)", file);
+ }
+ break;
+ case UNSPEC_SYMOFF:
+ output_addr_const (file, XVECEXP (x, 0, 0));
+ fputc ('-', file);
+ if (GET_CODE (XVECEXP (x, 0, 1)) == CONST)
+ {
+ fputc ('(', file);
+ output_addr_const (file, XVECEXP (x, 0, 1));
+ fputc (')', file);
+ }
+ else
+ output_addr_const (file, XVECEXP (x, 0, 1));
+ break;
+ case UNSPEC_PCREL_SYMOFF:
+ output_addr_const (file, XVECEXP (x, 0, 0));
+ fputs ("-(", file);
+ output_addr_const (file, XVECEXP (x, 0, 1));
+ fputs ("-.)", file);
+ break;
+ default:
+ return false;
+ }
+ return true;
+ }
+ else
+ return false;
+}
/* Encode symbol attributes of a SYMBOL_REF into its
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index 9960ae12bc1..c07ff083d88 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -2353,114 +2353,6 @@ struct sh_args {
#define FINAL_PRESCAN_INSN(INSN, OPVEC, NOPERANDS) \
final_prescan_insn ((INSN), (OPVEC), (NOPERANDS))
-/* Recognize machine-specific patterns that may appear within
- constants. Used for PIC-specific UNSPECs. */
-#define OUTPUT_ADDR_CONST_EXTRA(STREAM, X, FAIL) \
- do \
- if (GET_CODE (X) == UNSPEC) \
- { \
- switch (XINT ((X), 1)) \
- { \
- case UNSPEC_DATALABEL: \
- fputs ("datalabel ", (STREAM)); \
- output_addr_const ((STREAM), XVECEXP ((X), 0, 0)); \
- break; \
- case UNSPEC_PIC: \
- /* GLOBAL_OFFSET_TABLE or local symbols, no suffix. */ \
- output_addr_const ((STREAM), XVECEXP ((X), 0, 0)); \
- break; \
- case UNSPEC_GOT: \
- output_addr_const ((STREAM), XVECEXP ((X), 0, 0)); \
- fputs ("@GOT", (STREAM)); \
- break; \
- case UNSPEC_GOTOFF: \
- output_addr_const ((STREAM), XVECEXP ((X), 0, 0)); \
- fputs ("@GOTOFF", (STREAM)); \
- break; \
- case UNSPEC_PLT: \
- output_addr_const ((STREAM), XVECEXP ((X), 0, 0)); \
- fputs ("@PLT", (STREAM)); \
- break; \
- case UNSPEC_GOTPLT: \
- output_addr_const ((STREAM), XVECEXP ((X), 0, 0)); \
- fputs ("@GOTPLT", (STREAM)); \
- break; \
- case UNSPEC_DTPOFF: \
- output_addr_const ((STREAM), XVECEXP ((X), 0, 0)); \
- fputs ("@DTPOFF", (STREAM)); \
- break; \
- case UNSPEC_GOTTPOFF: \
- output_addr_const ((STREAM), XVECEXP ((X), 0, 0)); \
- fputs ("@GOTTPOFF", (STREAM)); \
- break; \
- case UNSPEC_TPOFF: \
- output_addr_const ((STREAM), XVECEXP ((X), 0, 0)); \
- fputs ("@TPOFF", (STREAM)); \
- break; \
- case UNSPEC_CALLER: \
- { \
- char name[32]; \
- /* LPCS stands for Label for PIC Call Site. */ \
- ASM_GENERATE_INTERNAL_LABEL \
- (name, "LPCS", INTVAL (XVECEXP ((X), 0, 0))); \
- assemble_name ((STREAM), name); \
- } \
- break; \
- case UNSPEC_EXTRACT_S16: \
- case UNSPEC_EXTRACT_U16: \
- { \
- rtx val, shift; \
- \
- val = XVECEXP (X, 0, 0); \
- shift = XVECEXP (X, 0, 1); \
- fputc ('(', STREAM); \
- if (shift != const0_rtx) \
- fputc ('(', STREAM); \
- if (GET_CODE (val) == CONST \
- || GET_RTX_CLASS (GET_CODE (val)) != RTX_OBJ) \
- { \
- fputc ('(', STREAM); \
- output_addr_const (STREAM, val); \
- fputc (')', STREAM); \
- } \
- else \
- output_addr_const (STREAM, val); \
- if (shift != const0_rtx) \
- { \
- fputs (" >> ", STREAM); \
- output_addr_const (STREAM, shift); \
- fputc (')', STREAM); \
- } \
- fputs (" & 65535)", STREAM); \
- } \
- break; \
- case UNSPEC_SYMOFF: \
- output_addr_const (STREAM, XVECEXP (X, 0, 0)); \
- fputc ('-', STREAM); \
- if (GET_CODE (XVECEXP (X, 0, 1)) == CONST) \
- { \
- fputc ('(', STREAM); \
- output_addr_const (STREAM, XVECEXP (X, 0, 1)); \
- fputc (')', STREAM); \
- } \
- else \
- output_addr_const (STREAM, XVECEXP (X, 0, 1)); \
- break; \
- case UNSPEC_PCREL_SYMOFF: \
- output_addr_const (STREAM, XVECEXP (X, 0, 0)); \
- fputs ("-(", STREAM); \
- output_addr_const (STREAM, XVECEXP (X, 0, 1)); \
- fputs ("-.)", STREAM); \
- break; \
- default: \
- goto FAIL; \
- } \
- break; \
- } \
- else \
- goto FAIL; \
- while (0)
-
extern struct rtx_def *sh_compare_op0;
extern struct rtx_def *sh_compare_op1;
OpenPOWER on IntegriCloud