From f99161f8ef62880e137b323b71b8b8742a5621b0 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Sat, 2 Apr 2005 00:43:48 +0000 Subject: [PATCH] Patch from David Mosberger, to avoid nop.f on Itanium2. * config/tc-ia64.c (ia64_handle_align): Move le_nop and le_nop_stop arrays and initializers to file scope. (md_begin): When generating code for anything other than Itanium 1, use MMI instead of MFI NOP bundles as a filler. --- gas/ChangeLog | 7 +++++++ gas/config/tc-ia64.c | 30 ++++++++++++++++++++++-------- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 2e3cd7d37..00c35526d 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2005-04-01 David Mosberger + + * config/tc-ia64.c (ia64_handle_align): Move le_nop and + le_nop_stop arrays and initializers to file scope. + (md_begin): When generating code for anything other than + Itanium 1, use MMI instead of MFI NOP bundles as a filler. + 2005-04-01 Jan Beulich * config/tc-i386.c (output_imm): Also set sign flag for 64-bit push diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c index d96d6f613..f458550e2 100644 --- a/gas/config/tc-ia64.c +++ b/gas/config/tc-ia64.c @@ -328,6 +328,21 @@ static struct } md; +/* These are not const, because they are modified to MMI for non-itanium1 + targets below. */ +/* MFI bundle of nops. */ +static unsigned char le_nop[16] = +{ + 0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00 +}; +/* MFI bundle of nops with stop-bit. */ +static unsigned char le_nop_stop[16] = +{ + 0x0d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00 +}; + /* application registers: */ #define AR_K0 0 @@ -7259,6 +7274,13 @@ md_begin () symbol_new (".", undefined_section, FUNC_IPLT_RELOC, &zero_address_frag); + if (md.tune != itanium1) + { + /* Convert MFI NOPs bundles into MMI NOPs bundles. */ + le_nop[0] = 0x8; + le_nop_stop[0] = 0x9; + } + /* Compute the table of best templates. We compute goodness as a base 4 value, in which each match counts for 3. Match-failures result in NOPs and we use extra_goodness() to pick the execution @@ -11516,14 +11538,6 @@ void ia64_handle_align (fragp) fragS *fragp; { - /* Use mfi bundle of nops with no stop bits. */ - static const unsigned char le_nop[] - = { 0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00}; - static const unsigned char le_nop_stop[] - = { 0x0d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00}; - int bytes; char *p; const unsigned char *nop; -- 2.11.4.GIT