Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: interesting Paper on common macros for SSE/Altivec/Trimedia
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: interesting Paper on common macros for SSE/Altivec/Trimedia



Marc:

On 20/11/2006, at 3:14 AM, Marc Van Olmen wrote:

hi,

Just wanted to share this because I'm in the process of trying to build a similar set of macros/inlines now that I converted my own Altivec code to SSE

<http://www.ece.neu.edu/groups/rcl/theses/rojas-phd2003.pdf>

Interesting. It's conceptually similar to the low-level vec interface of macstl, although they don't mention macstl -- but given that it dates from 2003 and the first public version of macstl is July 2003, that makes sense.


http://www.pixelglow.com/macstl

Being a C macro system, it doesn't build a type system on SSE nor use overloads. The following should compile to identical code on both Altivec and SSE:

In MMM:

DECLARE_I16x8(A);
DECLARE_I16x8(B);
DECLARE_I16x8(C);
LOAD_A_I16x8(A, pSrcA);
LOAD_A_I16x8(B, pSrcB);
ADD_I16x8(C,A,B);

In macstl:

vec <short, 8> A;
vec <short, 8> B;
vec <short, 8> C;
A = *pSrcA;	// or A = vec <short, 8>::load (pSrcA);
B = *pSrcB;	// or B = vec <short, 8>::load (pSrcB);
C = A + B;

The current macstl has a PERL script called macstlizer that tries to parse regular C code using Altivec intrinsics and convert it to macstl C++ code. Then there's a #include that maps most of the Altivec intrinsics into equivalent SSE intrinsics. The preferred option would be to use platform-independent operations such as +, but that would be difficult to do accurately in a automated script conversion, since the platform-independent ops are almost exactly equivalent to their C/C++ language definitions, while the Altivec and SSE ops have certain edge cases for certain types.





Cheers, Glen Low


--- pixelglow software | simply brilliant stuff www.pixelglow.com aim: pixglen

_______________________________________________
Do not post admin requests to the list. They will be ignored.
PerfOptimization-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >interesting Paper on common macros for SSE/Altivec/Trimedia (From: Marc Van Olmen <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.