diff options
author | Anatoly Sokolov <aesok@post.ru> | 2010-11-19 22:30:18 +0300 |
---|---|---|
committer | Anatoly Sokolov <aesok@gcc.gnu.org> | 2010-11-19 22:30:18 +0300 |
commit | 535bd17c2f200547ed8b4c8a243216f666919d20 (patch) | |
tree | cb72eb2c9ec2a945ea53d0d2e442bec027635300 | |
parent | a5cc92fdfb1bbd2508600e82782fa6c329208064 (diff) | |
download | gcc-535bd17c2f200547ed8b4c8a243216f666919d20.zip gcc-535bd17c2f200547ed8b4c8a243216f666919d20.tar.gz gcc-535bd17c2f200547ed8b4c8a243216f666919d20.tar.bz2 |
mn10300.h (OUTPUT_ADDR_CONST_EXTRA): Remove.
* config/mn10300/mn10300.h (OUTPUT_ADDR_CONST_EXTRA): Remove.
* config/mn10300/mn10300.c (mn10300_asm_output_addr_const_extra): New
function.
(TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA): Define.
From-SVN: r166955
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/mn10300/mn10300.c | 49 | ||||
-rw-r--r-- | gcc/config/mn10300/mn10300.h | 43 |
3 files changed, 56 insertions, 43 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index df40904..7f4a8d7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2010-11-19 Anatoly Sokolov <aesok@post.ru> + + * config/mn10300/mn10300.h (OUTPUT_ADDR_CONST_EXTRA): Remove. + * config/mn10300/mn10300.c (mn10300_asm_output_addr_const_extra): New + function. + (TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA): Define. + 2010-11-19 Uros Bizjak <ubizjak@gmail.com> * mode-switching.c (optimize_mode_switching): Use diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c index 868208a..a6310b5 100644 --- a/gcc/config/mn10300/mn10300.c +++ b/gcc/config/mn10300/mn10300.c @@ -523,6 +523,52 @@ mn10300_print_operand_address (FILE *file, rtx addr) } } +/* Implement TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA. + + Used for PIC-specific UNSPECs. */ + +static bool +mn10300_asm_output_addr_const_extra (FILE *file, rtx x) +{ + if (GET_CODE (x) == UNSPEC) + { + switch (XINT (x, 1)) + { + case UNSPEC_INT_LABEL: + asm_fprintf (file, ".%LLIL" HOST_WIDE_INT_PRINT_DEC, + INTVAL (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_GOTSYM_OFF: + assemble_name (file, GOT_SYMBOL_NAME); + fputs ("-(", file); + output_addr_const (file, XVECEXP (x, 0, 0)); + fputs ("-.)", file); + break; + default: + return false; + } + return true; + } + else + return false; +} + /* Count the number of FP registers that have to be saved. */ static int fp_regs_to_save (void) @@ -2451,6 +2497,9 @@ mn10300_adjust_sched_cost (rtx insn, rtx link, rtx dep, int cost) #undef TARGET_ASM_FILE_START_FILE_DIRECTIVE #define TARGET_ASM_FILE_START_FILE_DIRECTIVE true +#undef TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA +#define TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA mn10300_asm_output_addr_const_extra + #undef TARGET_DEFAULT_TARGET_FLAGS #define TARGET_DEFAULT_TARGET_FLAGS MASK_MULT_BUG | MASK_PTR_A0D0 #undef TARGET_HANDLE_OPTION diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h index 7367d1b..d52d0a1 100644 --- a/gcc/config/mn10300/mn10300.h +++ b/gcc/config/mn10300/mn10300.h @@ -599,49 +599,6 @@ struct cum_arg /* Non-global SYMBOL_REFs have SYMBOL_REF_FLAG enabled. */ #define MN10300_GLOBAL_P(X) (! SYMBOL_REF_FLAG (X)) - -/* 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_INT_LABEL: \ - asm_fprintf ((STREAM), ".%LLIL" HOST_WIDE_INT_PRINT_DEC, \ - INTVAL (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_GOTSYM_OFF: \ - assemble_name (STREAM, GOT_SYMBOL_NAME); \ - fputs ("-(", STREAM); \ - output_addr_const (STREAM, XVECEXP (X, 0, 0)); \ - fputs ("-.)", STREAM); \ - break; \ - default: \ - goto FAIL; \ - } \ - break; \ - } \ - else \ - goto FAIL; \ - while (0) #define SELECT_CC_MODE(OP, X, Y) mn10300_select_cc_mode (X) #define REVERSIBLE_CC_MODE(MODE) 0 |