This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: x86 MMX/SSE ABI compatibility with ICC

What I'm asking is this: Consider me writing code that uses vector
types, no matter what architecture I intend to compile this for. Among
the types used, say, is one using V4SImode. Now, after having built and
tested this on a couple of architectures, I want to bring this to i386.
There, all of the sudden, I have to learn that I'm breaking some ABI by
passing/returning values of this type to/from functions. I'd have to
modify all my sources so that I'd pass by pointer/reference instead, or
I'd have to require a Pentium4 to run my app. Neither is generally
acceptable. Instead, the generic types should (ABI-wise) be generic for
all architectures. ABI specifics should be hidden behind special types
(which may transform trivially to/from generic types as appropriate). In
the specific case here, __m64 and __m128 shouldn't just be typedef-s
having a vector_size attribute. They should either have a special,
machine dependent attribute, or a special, machine-dependent mode. The
intrinsics and/or builtins would then have to take care of converting
these appropriately to normal vector types so they become usable as such
througout the rest of the compiler.

Note also that due to this there is, besides the __m64 return value
discrepancy, another inconsistency with icc: gcc can perform arithmetic
directly on __m64/__m128, while neither icc nor (you certainly don't
care, but I'll mention it anyway) msvc can do so (and hence require the
use of intrinsics, thus making, especially in the case of MMX, the
programmer's explicit use of types and intrinsics the sign that he's
aware of the consequences this has, most importantly that it's


>>> Richard Henderson <> 13.07.04 09:27:07 >>>
On Tue, Jul 13, 2004 at 08:57:11AM +0200, Jan Beulich wrote:
> Why are generic, target-independent types overloaded with semantics
> that no-one outside of i386 (and perhaps ppc with altivec) cares?

I have no idea what you're asking.

> And * is there some formal specification of what the intended ABI

Not to my knowledge.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]