This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Status of SSE support in current gcc mainline
- To: kumar at chaos dot ph dot utexas dot edu
- Subject: RE: Status of SSE support in current gcc mainline
- From: Daniel Berlin <dan at www dot cgsoftware dot com>
- Date: Sat, 24 Mar 2001 00:09:04 -0500 (EST)
- cc: David Korn <dkorn at pixelpower dot com>, "'Daniel Berlin'" <dberlin at redhat dot com>, Dave Korn <davek-ml at ntlworld dot com>, Jan Hubicka <jh at suse dot cz>, Samuel Figueroa <figueroa at apple dot com>, Bernd Schmidt <bernds at cambridge dot redhat dot com>, gcc at gcc dot gnu dot org
> check out:
>
> http://www.altivec.org/tech_specifications/altivec_pim.pdf
>
> The idea behind the altivec PIM is using intrinsics like c = vec_add(a,b);
> Based on how 'a' and 'b' are typed the compiler should figure out which
> altivec instruction this maps to. For example:
>
> vector float a,b,c;
>
> c = vec_add(a,b);
>
> would map to the altivec instruction
Oh, and this requires some form of overloading or compiler black magic (IE
special handling) to do it without making these very special in the
parser/lexer, which isn't available in C.
c = vec_addfp(a,b), where a and b are two vector floats, would not.
c = vec_add8int(a,b), where a and b are two vector ints, would not.
You are asking the c compiler to choose the code baesd on the type of the
arguments, without any casting.
How do you declare this builtin function to the compiler, given that the
type of the arguments changes the code of the function?
You use one function for each possible type.
Without overloading, how does it choose which function to use?
Remember, this is C here, not C++.
I was using vec_add as an example of a simple intrinsic, not a complex
overloaded function that does what the PIM says it does.
--Dan