diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2017-07-30 10:51:37 +0200 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2017-07-30 10:51:37 +0200 |
commit | ec1895c1f3567ada2256a82282f5cbf109e63e51 (patch) | |
tree | e8845add693bbe723e3dcb5ea546fae62df0fec1 | |
parent | 218e5d04b322a58949f8d73e83976765de75e610 (diff) | |
download | gcc-ec1895c1f3567ada2256a82282f5cbf109e63e51.zip gcc-ec1895c1f3567ada2256a82282f5cbf109e63e51.tar.gz gcc-ec1895c1f3567ada2256a82282f5cbf109e63e51.tar.bz2 |
i386.h (ASM_PRINTF_EXTENSIONS): New macro.
* config/i386/i386.h (ASM_PRINTF_EXTENSIONS): New macro.
(ASM_OUTPUT_REG_PUSH): Rewrite with new operand modifiers.
(ASM_OUTPUT_REG_POP): Ditto.
* config/i386/i386.c (ix86_asm_output_function_label): Use fputs
instead of asm_fprintf to output pure string.
From-SVN: r250720
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 7 | ||||
-rw-r--r-- | gcc/config/i386/i386.h | 44 |
3 files changed, 35 insertions, 24 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ad347ad..3008579 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2017-07-30 Uros Bizjak <ubizjak@gmail.com> + + * config/i386/i386.h (ASM_PRINTF_EXTENSIONS): New macro. + (ASM_OUTPUT_REG_PUSH): Rewrite with new operand modifiers. + (ASM_OUTPUT_REG_POP): Ditto. + * config/i386/i386.c (ix86_asm_output_function_label): Use fputs + instead of asm_fprintf to output pure string. + 2017-07-29 Jakub Jelinek <jakub@redhat.com> * debug.h (struct gcc_debug_hooks): Add IMPLICIT argument diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index f1486ff..c0213a6 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -8777,16 +8777,15 @@ ix86_asm_output_function_label (FILE *asm_out_file, const char *fname, if (TARGET_64BIT) { /* leaq [%rsp + 0], %rsp */ - asm_fprintf (asm_out_file, ASM_BYTE - "0x48, 0x8d, 0xa4, 0x24, 0x00, 0x00, 0x00, 0x00\n"); + fputs (ASM_BYTE "0x48, 0x8d, 0xa4, 0x24, 0x00, 0x00, 0x00, 0x00\n", + asm_out_file); } else { /* movl.s %edi, %edi push %ebp movl.s %esp, %ebp */ - asm_fprintf (asm_out_file, ASM_BYTE - "0x8b, 0xff, 0x55, 0x8b, 0xec\n"); + fputs (ASM_BYTE "0x8b, 0xff, 0x55, 0x8b, 0xec\n", asm_out_file); } } } diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 682745a..61501dc 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -2196,29 +2196,33 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER]; #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \ asm_preferred_eh_data_format ((CODE), (GLOBAL)) -/* This is how to output an insn to push a register on the stack. - It need not be very fast code. */ - -#define ASM_OUTPUT_REG_PUSH(FILE, REGNO) \ -do { \ - if (TARGET_64BIT) \ - asm_fprintf ((FILE), "\tpush{q}\t%%r%s\n", \ - reg_names[(REGNO)] + (REX_INT_REGNO_P (REGNO) != 0)); \ - else \ - asm_fprintf ((FILE), "\tpush{l}\t%%e%s\n", reg_names[(REGNO)]); \ -} while (0) +/* These are a couple of extensions to the formats accepted + by asm_fprintf: + %z prints out opcode suffix for word-mode instruction + %r prints out word-mode name for reg_names[arg] */ +#define ASM_FPRINTF_EXTENSIONS(FILE, ARGS, P) \ + case 'z': \ + fputc (TARGET_64BIT ? 'q' : 'l', (FILE)); \ + break; \ + \ + case 'r': \ + { \ + unsigned int regno = va_arg ((ARGS), int); \ + if (LEGACY_INT_REGNO_P (regno)) \ + fputc (TARGET_64BIT ? 'r' : 'e', (FILE)); \ + fputs (reg_names[regno], (FILE)); \ + break; \ + } + +/* This is how to output an insn to push a register on the stack. */ -/* This is how to output an insn to pop a register from the stack. - It need not be very fast code. */ +#define ASM_OUTPUT_REG_PUSH(FILE, REGNO) \ + asm_fprintf ((FILE), "\tpush%z\t%%%r\n", (REGNO)) + +/* This is how to output an insn to pop a register from the stack. */ #define ASM_OUTPUT_REG_POP(FILE, REGNO) \ -do { \ - if (TARGET_64BIT) \ - asm_fprintf ((FILE), "\tpop{q}\t%%r%s\n", \ - reg_names[(REGNO)] + (REX_INT_REGNO_P (REGNO) != 0)); \ - else \ - asm_fprintf ((FILE), "\tpop{l}\t%%e%s\n", reg_names[(REGNO)]); \ -} while (0) + asm_fprintf ((FILE), "\tpop%z\t%%%r\n", (REGNO)) /* This is how to output an element of a case-vector that is absolute. */ |