aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2011-07-10 21:42:08 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2011-07-10 14:42:08 -0700
commit9e419e387cb8f3dfef192b236e089a1446636bd0 (patch)
tree38386debdc43975f749cee923fc30856c20b762b
parent3db72de3129796a961e3d495ee559cc5abb23c18 (diff)
downloadgcc-9e419e387cb8f3dfef192b236e089a1446636bd0.zip
gcc-9e419e387cb8f3dfef192b236e089a1446636bd0.tar.gz
gcc-9e419e387cb8f3dfef192b236e089a1446636bd0.tar.bz2
Use movl instead of movabs for x32.
2011-07-10 H.J. Lu <hongjiu.lu@intel.com> * config/i386/i386.c (ix86_trampoline_init): Use movl instead of movabs for x32. From-SVN: r176129
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/i386/i386.c18
2 files changed, 19 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6f015ee..752e252 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2011-07-10 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/i386.c (ix86_trampoline_init): Use movl instead
+ of movabs for x32.
+
2011-07-10 Richard Henderson <rth@redhat.com>
* config/i386/i386.c (x86_output_mi_thunk): Generate rtl and
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index f948a32..a46101b 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -22730,7 +22730,7 @@ ix86_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
}
else
{
- int offset = 0;
+ int offset = 0, size;
/* Load the function address to r11. Try to load address using
the shorter movl instead of movabs. We may want to support
@@ -22759,11 +22759,21 @@ ix86_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
/* Load static chain using movabs to r10. */
mem = adjust_address (m_tramp, HImode, offset);
- emit_move_insn (mem, gen_int_mode (0xba49, HImode));
+ /* Use the shorter movl instead of movabs for x32. */
+ if (TARGET_X32)
+ {
+ size = 6;
+ emit_move_insn (mem, gen_int_mode (0xba41, HImode));
+ }
+ else
+ {
+ size = 10;
+ emit_move_insn (mem, gen_int_mode (0xba49, HImode));
+ }
- mem = adjust_address (m_tramp, DImode, offset + 2);
+ mem = adjust_address (m_tramp, ptr_mode, offset + 2);
emit_move_insn (mem, chain_value);
- offset += 10;
+ offset += size;
/* Jump to r11; the last (unused) byte is a nop, only there to
pad the write out to a single 32-bit store. */