Re: [xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) == sizeof (void*) == 4

2012-01-03 Thread Peter Harris
On 2011-12-30 15:07, Sergei Trofimovich wrote: On Wed, 28 Dec 2011 12:45:03 -0800 Alan Coopersmith alan.coopersm...@oracle.com wrote: C code checking __amd64__ mostly does so to find out the size of long pointers. Instructions are usually at the assembly level, not the C code level.

Re: [xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) == sizeof (void*) == 4

2012-01-03 Thread Adam Jackson
On 12/28/11 3:29 PM, Lu, Hongjiu wrote: __LP64__ isn't the part of x86-64 psABI while GCC always define __LP64__ for 64bit long on x86. I can check if other compilers do the same. In most cases, __amd64__ is checked for 64bit instructions and we have ported those we have found so far to x32 so

Re: [xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) == sizeof (void*) == 4

2011-12-30 Thread Sergei Trofimovich
On Wed, 28 Dec 2011 12:45:03 -0800 Alan Coopersmith alan.coopersm...@oracle.com wrote: On 12/28/11 12:29, Lu, Hongjiu wrote: From: Lu, Hongjiuhongjiu...@intel.com Date: Wed, 28 Dec 2011 14:34:09 + __AMD64__ is defined when 64bit x86 instruction set is used, which is true for x32.

Re: [xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) == sizeof (void*) == 4

2011-12-28 Thread Alan Coopersmith
On 12/28/11 06:34, Lu, Hongjiu wrote: __AMD64__ is defined when 64bit x86 instruction set is used, which is true for x32. The difference is x32 doesn't define __LP64__. Then you have explictly designed your ABI to break existing software, and it is broken by design and should not be adopted.

RE: [xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) == sizeof (void*) == 4

2011-12-28 Thread Lu, Hongjiu
Cc: Lu, Hongjiu; xorg-devel@lists.x.org Subject: Re: [xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) == sizeof (void*) == 4 On 12/21/11 09:24, Sergei Trofimovich wrote: What do you think of changing predefined __amd64__ define in gcc to something distinct? If it's

Re: [xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) == sizeof (void*) == 4

2011-12-28 Thread Alan Coopersmith
On 12/28/11 07:33, Lu, Hongjiu wrote: On 12/28/11 06:34, Lu, Hongjiu wrote: __AMD64__ is defined when 64bit x86 instruction set is used, which is true for x32. The difference is x32 doesn't define __LP64__. Then you have explictly designed your ABI to break existing software, and it is broken

RE: [xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) == sizeof (void*) == 4

2011-12-28 Thread Lu, Hongjiu
On 12/28/11 06:34, Lu, Hongjiu wrote: __AMD64__ is defined when 64bit x86 instruction set is used, which is true for x32. The difference is x32 doesn't define __LP64__. Then you have explictly designed your ABI to break existing software, and it is broken by design and should not be

Re: [xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) == sizeof (void*) == 4

2011-12-28 Thread Mark Kettenis
From: Lu, Hongjiu hongjiu...@intel.com Date: Wed, 28 Dec 2011 14:34:09 + __AMD64__ is defined when 64bit x86 instruction set is used, which is true for x32. The difference is x32 doesn't define __LP64__. Chapter 7, Development Environment, of the AMD64 ABI (the non-x32 version) does

Re: [xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) == sizeof (void*) == 4

2011-12-28 Thread Alan Coopersmith
On 12/28/11 12:29, Lu, Hongjiu wrote: From: Lu, Hongjiuhongjiu...@intel.com Date: Wed, 28 Dec 2011 14:34:09 + __AMD64__ is defined when 64bit x86 instruction set is used, which is true for x32. The difference is x32 doesn't define __LP64__. Chapter 7, Development Environment, of the

RE: [xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) == sizeof (void*) == 4

2011-12-28 Thread Lu, Hongjiu
From: Lu, Hongjiu hongjiu...@intel.com Date: Wed, 28 Dec 2011 14:34:09 + __AMD64__ is defined when 64bit x86 instruction set is used, which is true for x32. The difference is x32 doesn't define __LP64__. Chapter 7, Development Environment, of the AMD64 ABI (the non-x32

Re: [xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) == sizeof (void*) == 4

2011-12-21 Thread Sergei Trofimovich
[ CCing H.J. context: the thread start: http://www.mail-archive.com/xorg-devel@lists.x.org/msg27303.html reply to: http://www.mail-archive.com/xorg-devel@lists.x.org/msg27338.html ] What would you prefer? ... Is there any real benefit to AMD64-x32 over simply x86-32 Whole

Re: [xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) == sizeof (void*) == 4

2011-12-21 Thread Alan Coopersmith
On 12/21/11 09:24, Sergei Trofimovich wrote: What do you think of changing predefined __amd64__ define in gcc to something distinct? If it's not an option, how about adding one more define for those who like to check for this exact feature on all compilers (and not only gcc)? So thread

Re: [xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) == sizeof (void*) == 4

2011-12-20 Thread Alan Coopersmith
On 12/20/11 08:37, Sergei Trofimovich wrote: + (defined(__amd64__) defined(__LP64__)) /* skip x32 */ || \ + defined(amd64) || \ Really? Someone defined __amd64__ on a non LP64 platform and didn't expect to break tons of software? Amazing... I'd expect damage from such idiocy to go

Re: [xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) == sizeof (void*) == 4

2011-12-20 Thread Adam Jackson
On 12/20/11 11:41 AM, Alan Coopersmith wrote: On 12/20/11 08:37, Sergei Trofimovich wrote: + (defined(__amd64__) defined(__LP64__)) /* skip x32 */ || \ + defined(amd64) || \ Really? Someone defined __amd64__ on a non LP64 platform and didn't expect to break tons of software? Amazing...

Re: [xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) == sizeof (void*) == 4

2011-12-20 Thread Mark Kettenis
Date: Tue, 20 Dec 2011 08:41:44 -0800 From: Alan Coopersmith alan.coopersm...@oracle.com Are you sure that every real amd64 platform that uses __amd64__ defines __LP64__ as well? Not sure if you'd call 64-bit Windows a real amd64 platform, but given that Microsoft made the brilliant

Re: [xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) == sizeof (void*) == 4

2011-12-20 Thread Sergei Trofimovich
On Tue, 20 Dec 2011 08:41:44 -0800 Alan Coopersmith alan.coopersm...@oracle.com wrote: On 12/20/11 08:37, Sergei Trofimovich wrote: + (defined(__amd64__) defined(__LP64__)) /* skip x32 */ || \ + defined(amd64) || \ Really? Someone defined __amd64__ on a non LP64 platform and

Re: [xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) == sizeof (void*) == 4

2011-12-20 Thread Alan Coopersmith
On 12/20/11 09:02, Mark Kettenis wrote: Date: Tue, 20 Dec 2011 08:41:44 -0800 From: Alan Coopersmithalan.coopersm...@oracle.com Are you sure that every real amd64 platform that uses __amd64__ defines __LP64__ as well? Not sure if you'd call 64-bit Windows a real amd64 platform, but given that

Re: [xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) == sizeof (void*) == 4

2011-12-20 Thread Sergei Trofimovich
On Tue, 20 Dec 2011 18:02:18 +0100 (CET) Mark Kettenis mark.kette...@xs4all.nl wrote: Date: Tue, 20 Dec 2011 08:41:44 -0800 From: Alan Coopersmith alan.coopersm...@oracle.com Are you sure that every real amd64 platform that uses __amd64__ defines __LP64__ as well? Not sure if you'd

Re: [xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) == sizeof (void*) == 4

2011-12-20 Thread Alan Coopersmith
On 12/20/11 12:26, Sergei Trofimovich wrote: What would you prefer? I'd prefer not supporting broken hacks pretending to be new ABI models. Is there any real benefit to AMD64-x32 over simply x86-32 or AMD64 for X applications? -- -Alan Coopersmith-alan.coopersm...@oracle.com

Re: [xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) == sizeof (void*) == 4

2011-12-20 Thread Alan Coopersmith
On 12/20/11 13:09, Sergei Trofimovich wrote: On 12/20/11 12:26, Sergei Trofimovich wrote: What would you prefer? I'd prefer not supporting broken hacks pretending to be new ABI models. Is there any real benefit to AMD64-x32 over simply x86-32 Whole AMD64 ISA is accessible: twice as much

Re: [xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) == sizeof (void*) == 4

2011-12-20 Thread Sergei Trofimovich
On 12/20/11 08:37, Sergei Trofimovich wrote: + (defined(__amd64__) defined(__LP64__)) /* skip x32 */ || \ + defined(amd64) || \ Really? Someone defined __amd64__ on a non LP64 platform and didn't expect to break tons of software? Amazing... A bit will break, yes. But

Re: [xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) == sizeof (void*) == 4

2011-12-20 Thread Sergei Trofimovich
On 12/20/11 12:26, Sergei Trofimovich wrote: What would you prefer? I'd prefer not supporting broken hacks pretending to be new ABI models. Is there any real benefit to AMD64-x32 over simply x86-32 Whole AMD64 ISA is accessible: twice as much registers (including xmm/ymm), instruction