From: H.J. Lu Date: Tue, 21 Jul 2009 17:50:21 +0000 (+0000) Subject: gas/ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=711eedefee89e6a9cb45e4967a523a7f9d516751;p=binutils-gdb.git gas/ 2009-07-21 H.J. Lu PR gas/10420 * config/tc-i386.c (i386_align_code): Tune for 32bit nops in 64bit. (i386_target_format): Set cpu_arch_isa_flags.bitfield.cpulm for 64bit. gas/testsuite/ 2009-07-21 H.J. Lu PR gas/10420 * gas/i386/i386.exp: Run x86-64-nops-1-pentium. * gas/i386/x86-64-nops-1-pentium.d: New. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 1f4f666eb52..b35df95804d 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,11 @@ +2009-07-21 H.J. Lu + + PR gas/10420 + * config/tc-i386.c (i386_align_code): Tune for 32bit nops in + 64bit. + (i386_target_format): Set cpu_arch_isa_flags.bitfield.cpulm + for 64bit. + 2009-07-17 H.J. Lu * config/tc-i386.c (md_assemble): Update operand types. diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index d00424a9f6f..42a95ffdfb3 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -1042,8 +1042,16 @@ i386_align_code (fragS *fragP, int count) { /* If the padding is less than 15 bytes, we use the normal ones. Otherwise, we use a jump instruction and adjust - its offset. */ - if (count < 15) + its offset. */ + int limit; + + /* For 64bit, the limit is 3 bytes. */ + if (flag_code == CODE_64BIT + && fragP->tc_frag_data.isa_flags.bitfield.cpulm) + limit = 3; + else + limit = 15; + if (count < limit) memcpy (fragP->fr_literal + fragP->fr_fix, patt[count - 1], count); else @@ -7935,6 +7943,7 @@ i386_target_format (void) cpu_arch_isa_flags.bitfield.cpummx= 1; cpu_arch_isa_flags.bitfield.cpusse = 1; cpu_arch_isa_flags.bitfield.cpusse2 = 1; + cpu_arch_isa_flags.bitfield.cpulm = 1; } if (cpu_flags_all_zero (&cpu_arch_tune_flags)) { diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 4337a61ce47..a5d0bdb91f2 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2009-07-21 H.J. Lu + + PR gas/10420 + * gas/i386/i386.exp: Run x86-64-nops-1-pentium. + + * gas/i386/x86-64-nops-1-pentium.d: New. + 2009-07-16 H.J. Lu * gas/i386/i386.exp: Run ifunc and x86-64-ifunc. diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp index 72ce8600b2d..5595afd52b2 100644 --- a/gas/testsuite/gas/i386/i386.exp +++ b/gas/testsuite/gas/i386/i386.exp @@ -250,6 +250,7 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t run_dump_test "x86-64-nops-1-k8" run_dump_test "x86-64-nops-1-nocona" run_dump_test "x86-64-nops-1-merom" + run_dump_test "x86-64-nops-1-pentium" run_dump_test "x86-64-nops-2" run_dump_test "x86-64-nops-3" run_dump_test "x86-64-nops-4" diff --git a/gas/testsuite/gas/i386/x86-64-nops-1-pentium.d b/gas/testsuite/gas/i386/x86-64-nops-1-pentium.d new file mode 100644 index 00000000000..c080695a6ed --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-nops-1-pentium.d @@ -0,0 +1,247 @@ +#as: -mtune=pentium +#source: nops-1.s +#objdump: -drw +#name: x86-64 -mtune=pentium nops 1 + +.*: +file format .* + +Disassembly of section .text: + +0+ : +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: eb 0d jmp 10 +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop + +0+10 : +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: eb 0c jmp 20 +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop + +0+20 : +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: eb 0b jmp 30 +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop + +0+30 : +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: eb 0a jmp 40 +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop + +0+40 : +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: eb 09 jmp 50 +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop + +0+50 : +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: eb 08 jmp 60 +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop + +0+60 : +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: eb 07 jmp 70 +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop + +0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f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 90 nop +[ ]*[a-f0-9]+: 66 90 xchg %ax,%ax +#pass