From 41d9ec3c24885c2d9731fe99244104758ed44453 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Tue, 10 Nov 2015 18:48:31 +0100 Subject: [PATCH] i386.c (ix86_print_operand): Remove dead code that tried to avoid (%rip) for call operands. * config/i386/i386.c (ix86_print_operand): Remove dead code that tried to avoid (%rip) for call operands. * config/i386/i386.c (ix86_print_operand_address_as): Add no_rip argument. Do not use RIP relative addressing when no_rip is set. (ix86_print_operand): Update call to ix86_print_operand_address_as. (ix86_print_operand_address): Ditto. * config/i386/i386.md (*movabs_1): Use %P modifier for absolute movabs operand 0. Add square braces for -masm=intel. (*movabs_2): Ditto for operand 1. From-SVN: r230117 --- gcc/ChangeLog | 12 ++++++++++++ gcc/config/i386/i386.c | 21 ++++++++------------- gcc/config/i386/i386.md | 4 ++-- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5eca05d37ab..b5808c10115 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2015-11-10 Uros Bizjak + + * config/i386/i386.c (ix86_print_operand): Remove dead code that + tried to avoid (%rip) for call operands. + +2015-11-10 Uros Bizjak + + * config/i386/i386.c (ix86_print_operand_address_as): Add no_rip + argument. Do not use RIP relative addressing when no_rip is set. + (ix86_print_operand): Update call to ix86_print_operand_address_as. + (ix86_print_operand_address): Ditto. + 2015-11-10 Kyrylo Tkachov * config/arm/arm.c (arm_new_rtx_costs, FIX case): Handle diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index b84a11d433f..9205d497f5a 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -80,7 +80,7 @@ along with GCC; see the file COPYING3. If not see static rtx legitimize_dllimport_symbol (rtx, bool); static rtx legitimize_pe_coff_extern_decl (rtx, bool); static rtx legitimize_pe_coff_symbol (rtx, bool); -static void ix86_print_operand_address_as (FILE *file, rtx addr, addr_space_t); +static void ix86_print_operand_address_as (FILE *, rtx, addr_space_t, bool); #ifndef CHECK_STACK_LIMIT #define CHECK_STACK_LIMIT (-1) @@ -17131,13 +17131,6 @@ ix86_print_operand (FILE *file, rtx x, int code) { rtx addr = XEXP (x, 0); - /* Avoid (%rip) for call operands. */ - if (code == 'P' && CONSTANT_ADDRESS_P (x) && !CONST_INT_P (x)) - { - output_addr_const (file, addr); - return; - } - /* No `byte ptr' prefix for call instructions ... */ if (ASSEMBLER_DIALECT == ASM_INTEL && code != 'X' && code != 'P') { @@ -17187,7 +17180,8 @@ ix86_print_operand (FILE *file, rtx x, int code) if (this_is_asm_operands && ! address_operand (addr, VOIDmode)) output_operand_lossage ("invalid constraints for operand"); else - ix86_print_operand_address_as (file, addr, MEM_ADDR_SPACE (x)); + ix86_print_operand_address_as + (file, addr, MEM_ADDR_SPACE (x), code == 'p' || code == 'P'); } else if (CONST_DOUBLE_P (x) && GET_MODE (x) == SFmode) @@ -17272,7 +17266,8 @@ ix86_print_operand_punct_valid_p (unsigned char code) /* Print a memory operand whose address is ADDR. */ static void -ix86_print_operand_address_as (FILE *file, rtx addr, addr_space_t as) +ix86_print_operand_address_as (FILE *file, rtx addr, + addr_space_t as, bool no_rip) { struct ix86_address parts; rtx base, index, disp; @@ -17346,7 +17341,7 @@ ix86_print_operand_address_as (FILE *file, rtx addr, addr_space_t as) } /* Use one byte shorter RIP relative addressing for 64bit mode. */ - if (TARGET_64BIT && !base && !index) + if (TARGET_64BIT && !base && !index && !no_rip) { rtx symbol = disp; @@ -17360,10 +17355,10 @@ ix86_print_operand_address_as (FILE *file, rtx addr, addr_space_t as) && SYMBOL_REF_TLS_MODEL (symbol) == 0)) base = pc_rtx; } + if (!base && !index) { /* Displacement only requires special attention. */ - if (CONST_INT_P (disp)) { if (ASSEMBLER_DIALECT == ASM_INTEL && parts.seg == ADDR_SPACE_GENERIC) @@ -17505,7 +17500,7 @@ ix86_print_operand_address_as (FILE *file, rtx addr, addr_space_t as) static void ix86_print_operand_address (FILE *file, machine_mode /*mode*/, rtx addr) { - ix86_print_operand_address_as (file, addr, ADDR_SPACE_GENERIC); + ix86_print_operand_address_as (file, addr, ADDR_SPACE_GENERIC, false); } /* Implementation of TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA. */ diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 52dd03717b4..a236199699a 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -2601,7 +2601,7 @@ switch (which_alternative) { case 0: - return "movabs{}\t{%1, %0|%0, %1}"; + return "movabs{}\t{%1, %P0|[%P0], %1}"; case 1: return "mov{}\t{%1, %0|%0, %1}"; default: @@ -2625,7 +2625,7 @@ switch (which_alternative) { case 0: - return "movabs{}\t{%1, %0|%0, %1}"; + return "movabs{}\t{%P1, %0|%0, [%P1]}"; case 1: return "mov{}\t{%1, %0|%0, %1}"; default: -- 2.30.2