RE: RFC: Enable __declspec for Linux/x86
On 03 April 2007 01:37, Andrew Pinski wrote: On 4/2/07, H. J. Lu [EMAIL PROTECTED] wrote: I believe __declspec in Intel C++ compiler comes from: http://msdn2.microsoft.com/en-us/library/dabb5z75.aspx How is Microsoft documentation, the real documentation for Intel C++ compiler? Presumably this implies that the Intel compiler's 'declspec' compiler extension is defined to match Microsoft's original specification of the feature. Have you seen the Cell language extension document [1]? We document everything that is needed to be supported where does Intel/AMD document those? I have not seen a document like that for SSE/3DNow programming at all. 1. declspec is only tangentially related to SSE in any case. 2. What is of interest here is not what Intel or AMD have failed to do for their users, but what we should do for ours. 3. It's really no more than a new bit of syntactic sugar for specifying __attribute__s. We probably wouldn't want to support all the declspec types on all platforms, but I don't see why this should be too controversial. cheers, DaveK -- Can't think of a witty .sigline today
Re: RFC: Enable __declspec for Linux/x86
Joe Buck write: If the Windows version of GCC has to recognize __declspec to function as a hosted compiler on Windows, then the work already needs to be done to implement it. Well, I'm kinda surprised that Windows verision of GCC recognizes __declspec. The implementation is just a simple macro, and could've just as easily been implemented in a runtime header, as the MinGW runtime does. So what's the harm in allowing it on other platforms? Probably none, but since the macro can be defined on the command line with -D__declspec(x)=__attribute__((x)) defining it by default on other platforms is only a minor convenience. If it makes it easier for Windows programmers to move to free compilers and OSes, isn't that something that should be supported? I suppose that would argue for unconditionally defining the macro regardless of the platform. Ross Ridge
Re: RFC: Enable __declspec for Linux/x86
On 4/2/07, H. J. Lu [EMAIL PROTECTED] wrote: Many x86 SSE source codes use __declspec. I'd like to make __declspec available for Linux/x86. We can do one of the following: Do the following in the sources: #ifndef __WIN32__ #define __declspec(x) #endif or in the makefiles: Add -D__declspec(x)= to CFLAGS/CXXFLAGS. There is nothing special that __declspec does for Linux really. -- Pinski
Re: RFC: Enable __declspec for Linux/x86
On Mon, Apr 02, 2007 at 02:06:15PM -0700, Andrew Pinski wrote: On 4/2/07, H. J. Lu [EMAIL PROTECTED] wrote: Many x86 SSE source codes use __declspec. I'd like to make __declspec available for Linux/x86. We can do one of the following: Do the following in the sources: #ifndef __WIN32__ #define __declspec(x) #endif or in the makefiles: Add -D__declspec(x)= to CFLAGS/CXXFLAGS. It won't work with __declspec(align(16)) double x [4]; H.J.
Re: RFC: Enable __declspec for Linux/x86
On 4/2/07, H. J. Lu [EMAIL PROTECTED] wrote: It won't work with __declspec(align(16)) double x [4]; And the code should be converted over to use GCC style attributes. So really the code should be something like: #ifndef __WIN32__ #define __align16 __attribute__((align(16) )) #else #define __align16 __declspec(align(16) ) #endif And then use __align16 all the way through the code. There is no reason why GCC on Linux should be emulating MS's compiler. -- Pinski
Re: RFC: Enable __declspec for Linux/x86
On Apr 2, 2007, at 2:03 PM, H. J. Lu wrote: Many x86 SSE source codes use __declspec. I'd like to make __declspec available for Linux/x86. We can do one of the following: 1. Define TARGET_DECLSPEC for Linux/x86. 2. Define TARGET_DECLSPEC for x86. 3. Add -mdeclspec. Any comments? I suspect I'd want this for x86 darwin as well.
Re: RFC: Enable __declspec for Linux/x86
On 4/2/07, Mike Stump [EMAIL PROTECTED] wrote: I suspect I'd want this for x86 darwin as well. Why emulate Windows compilers on non windows machine? That is wrong. GCC for Linux/Darwin/any other OS besides Windows is not a Windows compiler and should not act like one. If people want to port their code, they should write their code to be portable way instead of depending on Windows or GCC stuff. -- Pinski
Re: RFC: Enable __declspec for Linux/x86
On 4/2/07, Andrew Pinski [EMAIL PROTECTED] wrote: Why emulate Windows compilers on non windows machine? That is wrong. GCC for Linux/Darwin/any other OS besides Windows is not a Windows compiler and should not act like one. If people want to port their code, they should write their code to be portable way instead of depending on Windows or GCC stuff. I should make a mention this is most likely for the Cell (for both sides PPC and SPU), we actually define and document a way to do aligned on variables (yes using GCC's attribute syntax) but this documentation is generic to all compiler implementations and they have to follow it. I have not seen a documentation from Intel about this or really any other intrinsics to explain how they are defined. I wish Intel gets the message here and actually documents the intrinsics and syntax, etc. for their vector extensions. -- Pinski
Re: RFC: Enable __declspec for Linux/x86
On 4/2/07, Andrew Pinski [EMAIL PROTECTED] wrote: On 4/2/07, Mike Stump [EMAIL PROTECTED] wrote: I suspect I'd want this for x86 darwin as well. Why emulate Windows compilers on non windows machine? That is wrong. GCC for Linux/Darwin/any other OS besides Windows is not a Windows compiler and should not act like one. If people want to port their code, they should write their code to be portable way instead of depending on Windows or GCC stuff. And what if whatever declspec is (I don't know) actually makes sense? Don't be Windows is not 42. Gr. Steven
Re: RFC: Enable __declspec for Linux/x86
On Mon, Apr 02, 2007 at 11:26:16PM +0200, Steven Bosscher wrote: On 4/2/07, Andrew Pinski [EMAIL PROTECTED] wrote: On 4/2/07, Mike Stump [EMAIL PROTECTED] wrote: I suspect I'd want this for x86 darwin as well. Why emulate Windows compilers on non windows machine? That is wrong. GCC for Linux/Darwin/any other OS besides Windows is not a Windows compiler and should not act like one. If people want to port their code, they should write their code to be portable way instead of depending on Windows or GCC stuff. And what if whatever declspec is (I don't know) actually makes sense? Don't be Windows is not 42. If the Windows version of GCC has to recognize __declspec to function as a hosted compiler on Windows, then the work already needs to be done to implement it. So what's the harm in allowing it on other platforms? If it makes it easier for Windows programmers to move to free compilers and OSes, isn't that something that should be supported?
Re: RFC: Enable __declspec for Linux/x86
On 4/2/07, Joe Buck [EMAIL PROTECTED] wrote: If the Windows version of GCC has to recognize __declspec to function as a hosted compiler on Windows, then the work already needs to be done to implement it. So what's the harm in allowing it on other platforms? If it makes it easier for Windows programmers to move to free compilers and OSes, isn't that something that should be supported? The only problem is that we have to be bug compatiable with all __declspec issues and having no documentation is going to make this harder. This is why Intel/AMD really should define a real language extension documentation for programming for SSE. -- Pinski
Re: RFC: Enable __declspec for Linux/x86
On Mon, Apr 02, 2007 at 03:11:06PM -0700, Andrew Pinski wrote: On 4/2/07, Joe Buck [EMAIL PROTECTED] wrote: If the Windows version of GCC has to recognize __declspec to function as a hosted compiler on Windows, then the work already needs to be done to implement it. So what's the harm in allowing it on other platforms? If it makes it easier for Windows programmers to move to free compilers and OSes, isn't that something that should be supported? The only problem is that we have to be bug compatiable with all __declspec issues and having no documentation is going to make this harder. This is why Intel/AMD really should define a real language extension documentation for programming for SSE. I believe __declspec in Intel C++ compiler comes from: http://msdn2.microsoft.com/en-us/library/dabb5z75.aspx H.J.
Re: RFC: Enable __declspec for Linux/x86
On 4/2/07, H. J. Lu [EMAIL PROTECTED] wrote: I believe __declspec in Intel C++ compiler comes from: http://msdn2.microsoft.com/en-us/library/dabb5z75.aspx How is Microsoft documentation, the real documentation for Intel C++ compiler? Have you seen the Cell language extension document [1]? We document everything that is needed to be supported where does Intel/AMD document those? I have not seen a document like that for SSE/3DNow programming at all. In your patch, you forgot to document that you now accept __declspec for all x86 targets and the extra attribute you now accept there. The documentation for align attribute should have in bold this is only for __declspec. You should also mention what __declspecs are supported because right now you don't mention anything. [1] http://www-306.ibm.com/chips/techlib/techlib.nsf/techdocs/30B3520C93F437AB87257060006FFE5E or http://cell.scei.co.jp/pdf/Language_Extensions_for_CBEA_v23.pdf -- Pinski