summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2012-03-12 16:49:36 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2012-03-12 09:49:36 -0700
commit79eeab23486b56d4ba004a609b7f10ae89b7300a (patch)
tree5b894be0e2b909b2f2a5806d3912f73e6c7e8ac2 /gcc
parent0738fdbda99f9b8cc639a2a461512e41ba205ab5 (diff)
downloadgcc-79eeab23486b56d4ba004a609b7f10ae89b7300a.tar.gz
Add ix86_gen_tls_global_dynamic_64 and ix86_gen_tls_local_dynamic_base_64
2012-03-12 H.J. Lu <hongjiu.lu@intel.com> * config/i386/i386.c (ix86_gen_tls_global_dynamic_64): New. (ix86_gen_tls_local_dynamic_base_64): Likewise. (ix86_option_override_internal): Set ix86_gen_tls_global_dynamic_64 and ix86_gen_tls_local_dynamic_base_64. (legitimize_tls_address): Use ix86_gen_tls_global_dynamic_64 and ix86_gen_tls_local_dynamic_base_64. * config/i386/i386.md (*tls_global_dynamic_64): Renamed to ... (*tls_global_dynamic_64_<mode>): This. (tls_global_dynamic_64): Renamed to ... (tls_global_dynamic_64_<mode>): This. (*tls_local_dynamic_base_64): Renamed to ... (*tls_local_dynamic_base_64_<mode>): This. (tls_local_dynamic_base_64): Renamed to ... (tls_local_dynamic_base_64_<mode>): This. From-SVN: r185250
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog18
-rw-r--r--gcc/config/i386/i386.c22
-rw-r--r--gcc/config/i386/i386.md50
3 files changed, 62 insertions, 28 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 730e18c74ba..86287d1c95e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,23 @@
2012-03-12 H.J. Lu <hongjiu.lu@intel.com>
+ * config/i386/i386.c (ix86_gen_tls_global_dynamic_64): New.
+ (ix86_gen_tls_local_dynamic_base_64): Likewise.
+ (ix86_option_override_internal): Set ix86_gen_tls_global_dynamic_64
+ and ix86_gen_tls_local_dynamic_base_64.
+ (legitimize_tls_address): Use ix86_gen_tls_global_dynamic_64 and
+ ix86_gen_tls_local_dynamic_base_64.
+
+ * config/i386/i386.md (*tls_global_dynamic_64): Renamed to ...
+ (*tls_global_dynamic_64_<mode>): This.
+ (tls_global_dynamic_64): Renamed to ...
+ (tls_global_dynamic_64_<mode>): This.
+ (*tls_local_dynamic_base_64): Renamed to ...
+ (*tls_local_dynamic_base_64_<mode>): This.
+ (tls_local_dynamic_base_64): Renamed to ...
+ (tls_local_dynamic_base_64_<mode>): This.
+
+2012-03-12 H.J. Lu <hongjiu.lu@intel.com>
+
* config/i386/i386.c (ix86_option_override_internal): Properly
set ix86_gen_leave and ix86_gen_monitor. Check Pmode == DImode,
instead of TARGET_64BIT, to set ix86_gen_add3, ix86_gen_sub3,
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index d85dc253c21..dbcf5a9ab49 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -2444,6 +2444,8 @@ static rtx (*ix86_gen_andsp) (rtx, rtx, rtx);
static rtx (*ix86_gen_allocate_stack_worker) (rtx, rtx);
static rtx (*ix86_gen_adjust_stack_and_probe) (rtx, rtx, rtx);
static rtx (*ix86_gen_probe_stack_range) (rtx, rtx, rtx);
+static rtx (*ix86_gen_tls_global_dynamic_64) (rtx, rtx, rtx);
+static rtx (*ix86_gen_tls_local_dynamic_base_64) (rtx, rtx);
/* Preferred alignment for stack boundary in bits. */
unsigned int ix86_preferred_stack_boundary;
@@ -3754,9 +3756,19 @@ ix86_option_override_internal (bool main_args_p)
{
ix86_gen_leave = gen_leave_rex64;
if (Pmode == DImode)
- ix86_gen_monitor = gen_sse3_monitor64_di;
+ {
+ ix86_gen_monitor = gen_sse3_monitor64_di;
+ ix86_gen_tls_global_dynamic_64 = gen_tls_global_dynamic_64_di;
+ ix86_gen_tls_local_dynamic_base_64
+ = gen_tls_local_dynamic_base_64_di;
+ }
else
- ix86_gen_monitor = gen_sse3_monitor64_si;
+ {
+ ix86_gen_monitor = gen_sse3_monitor64_si;
+ ix86_gen_tls_global_dynamic_64 = gen_tls_global_dynamic_64_si;
+ ix86_gen_tls_local_dynamic_base_64
+ = gen_tls_local_dynamic_base_64_si;
+ }
}
else
{
@@ -12549,7 +12561,8 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov)
rtx rax = gen_rtx_REG (Pmode, AX_REG), insns;
start_sequence ();
- emit_call_insn (gen_tls_global_dynamic_64 (rax, x, caddr));
+ emit_call_insn (ix86_gen_tls_global_dynamic_64 (rax, x,
+ caddr));
insns = get_insns ();
end_sequence ();
@@ -12597,7 +12610,8 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov)
rtx rax = gen_rtx_REG (Pmode, AX_REG), insns, eqv;
start_sequence ();
- emit_call_insn (gen_tls_local_dynamic_base_64 (rax, caddr));
+ emit_call_insn (ix86_gen_tls_local_dynamic_base_64 (rax,
+ caddr));
insns = get_insns ();
end_sequence ();
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 3aac3ed8335..60dc814bb0d 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -12623,13 +12623,13 @@
(clobber (match_scratch:SI 5 ""))
(clobber (reg:CC FLAGS_REG))])])
-(define_insn "*tls_global_dynamic_64"
- [(set (match_operand:DI 0 "register_operand" "=a")
- (call:DI
- (mem:QI (match_operand:DI 2 "constant_call_address_operand" "z"))
- (match_operand:DI 3 "" "")))
- (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")]
- UNSPEC_TLS_GD)]
+(define_insn "*tls_global_dynamic_64_<mode>"
+ [(set (match_operand:P 0 "register_operand" "=a")
+ (call:P
+ (mem:QI (match_operand:P 2 "constant_call_address_operand" "z"))
+ (match_operand:P 3 "" "")))
+ (unspec:P [(match_operand:P 1 "tls_symbolic_operand" "")]
+ UNSPEC_TLS_GD)]
"TARGET_64BIT"
{
if (!TARGET_X32)
@@ -12646,14 +12646,15 @@
(set (attr "length")
(symbol_ref "TARGET_X32 ? 15 : 16"))])
-(define_expand "tls_global_dynamic_64"
+(define_expand "tls_global_dynamic_64_<mode>"
[(parallel
- [(set (match_operand:DI 0 "register_operand" "")
- (call:DI
- (mem:QI (match_operand:DI 2 "constant_call_address_operand" ""))
+ [(set (match_operand:P 0 "register_operand" "")
+ (call:P
+ (mem:QI (match_operand:P 2 "constant_call_address_operand" ""))
(const_int 0)))
- (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")]
- UNSPEC_TLS_GD)])])
+ (unspec:P [(match_operand:P 1 "tls_symbolic_operand" "")]
+ UNSPEC_TLS_GD)])]
+ "TARGET_64BIT")
(define_insn "*tls_local_dynamic_base_32_gnu"
[(set (match_operand:SI 0 "register_operand" "=a")
@@ -12690,12 +12691,12 @@
(clobber (match_scratch:SI 4 ""))
(clobber (reg:CC FLAGS_REG))])])
-(define_insn "*tls_local_dynamic_base_64"
- [(set (match_operand:DI 0 "register_operand" "=a")
- (call:DI
- (mem:QI (match_operand:DI 1 "constant_call_address_operand" "z"))
- (match_operand:DI 2 "" "")))
- (unspec:DI [(const_int 0)] UNSPEC_TLS_LD_BASE)]
+(define_insn "*tls_local_dynamic_base_64_<mode>"
+ [(set (match_operand:P 0 "register_operand" "=a")
+ (call:P
+ (mem:QI (match_operand:P 1 "constant_call_address_operand" "z"))
+ (match_operand:P 2 "" "")))
+ (unspec:P [(const_int 0)] UNSPEC_TLS_LD_BASE)]
"TARGET_64BIT"
{
output_asm_insn
@@ -12707,13 +12708,14 @@
[(set_attr "type" "multi")
(set_attr "length" "12")])
-(define_expand "tls_local_dynamic_base_64"
+(define_expand "tls_local_dynamic_base_64_<mode>"
[(parallel
- [(set (match_operand:DI 0 "register_operand" "")
- (call:DI
- (mem:QI (match_operand:DI 1 "constant_call_address_operand" ""))
+ [(set (match_operand:P 0 "register_operand" "")
+ (call:P
+ (mem:QI (match_operand:P 1 "constant_call_address_operand" ""))
(const_int 0)))
- (unspec:DI [(const_int 0)] UNSPEC_TLS_LD_BASE)])])
+ (unspec:P [(const_int 0)] UNSPEC_TLS_LD_BASE)])]
+ "TARGET_64BIT")
;; Local dynamic of a single variable is a lose. Show combine how
;; to convert that back to global dynamic.