Patchwork [trans-mem] Use __x86_64__ instead of __LP64__.

login
register
mail settings
Submitter Torvald Riegel
Date Aug. 22, 2011, 9:42 a.m.
Message ID <1314006155.3533.2576.camel@triegel.csb>
Download mbox | patch
Permalink /patch/110881/
State New
Headers show

Comments

Torvald Riegel - Aug. 22, 2011, 9:42 a.m.
Use __x86_64__ instead of __LP64__ in setjmp/longjmp and TLS
definitions.

H.J.: Is that sufficient for x32, or do we need entirely different code?
If so, can you please provide the required changes?

Otherwise, OK for branch?
commit 5337bae3f70d53e463d09e8d6806826876b0da8a
Author: Torvald Riegel <triegel@redhat.com>
Date:   Mon Aug 22 11:21:03 2011 +0200

    Use __x86_64__ instead of __LP64__.
    
    	* config/x86/tls.h: Use __x86_64__ instead of __LP64__.
    	* config/x86/sjlj.S: Same.
H.J. Lu - Aug. 22, 2011, 1:44 p.m.
On Mon, Aug 22, 2011 at 2:42 AM, Torvald Riegel <triegel@redhat.com> wrote:
> Use __x86_64__ instead of __LP64__ in setjmp/longjmp and TLS
> definitions.
>
> H.J.: Is that sufficient for x32, or do we need entirely different code?
> If so, can you please provide the required changes?
>

I need to take a look.

Thanks.
Richard Henderson - Aug. 22, 2011, 9:42 p.m.
On 08/22/2011 02:42 AM, Torvald Riegel wrote:
> Use __x86_64__ instead of __LP64__ in setjmp/longjmp and TLS
> definitions.
> 
> H.J.: Is that sufficient for x32, or do we need entirely different code?
> If so, can you please provide the required changes?

The SJLJ part should be ok for x32.

The TLS part needs to use a 32-bit load and "*4".


r~
H.J. Lu - Aug. 23, 2011, 2:50 p.m.
On Mon, Aug 22, 2011 at 6:44 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Mon, Aug 22, 2011 at 2:42 AM, Torvald Riegel <triegel@redhat.com> wrote:
>> Use __x86_64__ instead of __LP64__ in setjmp/longjmp and TLS
>> definitions.
>>
>> H.J.: Is that sufficient for x32, or do we need entirely different code?
>> If so, can you please provide the required changes?
>>
>
> I need to take a look.
>

transactional-memory is from 2010-04-13 and doesn't support x32
at all.

Patch

diff --git a/libitm/config/x86/sjlj.S b/libitm/config/x86/sjlj.S
index 0e9c246..725ffec 100644
--- a/libitm/config/x86/sjlj.S
+++ b/libitm/config/x86/sjlj.S
@@ -1,4 +1,4 @@ 
-/* Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2008, 2009, 2011 Free Software Foundation, Inc.
    Contributed by Richard Henderson <rth@redhat.com>.
 
    This file is part of the GNU Transactional Memory Library (libitm).
@@ -29,7 +29,7 @@ 
 
 _ITM_beginTransaction:
 	.cfi_startproc
-#ifdef __LP64__
+#ifdef __x86_64__
 	leaq	8(%rsp), %rax
 	movq	(%rsp), %r8
 	subq	$72, %rsp
@@ -72,7 +72,7 @@  _ITM_beginTransaction:
 
 GTM_longjmp:
 	.cfi_startproc
-#ifdef __LP64__
+#ifdef __x86_64__
 	movq	(%rdi), %rcx
 	movq	8(%rdi), %rdx
 	movq	16(%rdi), %rbx
diff --git a/libitm/config/x86/tls.h b/libitm/config/x86/tls.h
index 03fdab2..ca644f4 100644
--- a/libitm/config/x86/tls.h
+++ b/libitm/config/x86/tls.h
@@ -37,7 +37,7 @@ 
 #if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
 namespace GTM HIDDEN {
 
-#ifdef __LP64__
+#ifdef __x86_64__
 # define SEG_READ(OFS)		"movq\t%%fs:(" #OFS "*8),%0"
 # define SEG_WRITE(OFS)		"movq\t%0,%%fs:(" #OFS "*8)"
 # define SEG_DECODE_READ(OFS)	SEG_READ(OFS) "\n\t" \