This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: SSE and SSE2 intrinsics
- From: "Tom Womack" <tom at womack dot net>
- To: <rth at redhat dot com>,<gcc at gcc dot gnu dot org>
- Date: Tue, 5 Feb 2002 11:55:53 -0000
- Subject: Re: SSE and SSE2 intrinsics
> On Mon, Feb 04, 2002 at 12:44:20PM -0000, Tom Womack wrote:
>> I worked out I should do typedef int __m128i ((attribute V4SI)) to get
>> the right type, but I couldn't find in the documentation any indication
>> of what I should use in gcc where I'd use _mm_cmpgt_epi8 in
>> VC++; indeed, even looking through i386.md I couldn't find an
>> instruction-definition for the SSE2 extended-MMX compare
>> instructions.
>> I was somehow expecting a file that I could #include to get Intel
>> intrinsics recognised, but I couldn't find one even by grepping
>> through the source tree.
> It's there -- #include <xmmintrin.h> or <mmintrin.h> just like the
> Intel compiler. Oh, I see. You said you were using the
> 2001-12-31 snapshot. These headers were added
> 2002-01-11.
Ah. No problem. Have downloaded the 2002-02-04 snapshot and will try again
this evening.
> I have no idea what "_mm_cmpgt_epi8" is though. It's not in my
> documentation. Is that just a typo for "_mm_cmpgt_pi8"?
No, it's the extended version that works on V16QIs stored in XMM
registers, rather than V8QIs stored in MMX ones. See page C-17
of the P4 manual
http://www.intel.com/design/Pentium4/manuals/24547104.pdf
There's a whole collection of these extended-MMX instructions --
basically a complete duplicate of MMX; as far as I can tell from
a cursory reading of i386.md, they aren't entirely implemented,
which is a pity since they let you do MMXish things in double-
width and without destroying the contents of the x87 registers.
I tried using one with asm() commands, but this caused an ICE;
I'll try again with a newer snapshot this evening, and post a bug
report if the compiler still segfaults.
Tom