Bug 19418 - _mm_cast*, icc8.1 new intrinsics
Summary: _mm_cast*, icc8.1 new intrinsics
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.0.0
: P2 enhancement
Target Milestone: 4.0.0
Assignee: Richard Henderson
Keywords: ssemmx
Depends on:
Reported: 2005-01-13 05:10 UTC by tbp
Modified: 2005-01-20 19:09 UTC (History)
1 user (show)

See Also:
Target: i?86-*-*, x86_64-*-*
Known to work:
Known to fail:
Last reconfirmed: 2005-01-20 10:22:05


Note You need to log in before you can comment on or make changes to this bug.
Description tbp 2005-01-13 05:10:45 UTC
Would it be possible to add those, as far as know, new casting intrinsics?
As ICC8.1 doesn't support straight C casts (neither does msvc2k3), they are
bound to appear sooner or later in code.

Excerpt from the only documentation i've found about them:
Intrinsics for Casting Support
This version of the Intel C++ Compiler supports casting between
various SP, DP, and INT vector types. These intrinsics do not convert
values; they just change the type.

extern __m128  _mm_castpd_ps(__m128d in);

extern __m128i _mm_castpd_si128(__m128d in);

extern __m128d _mm_castps_pd(__m128 in);

extern __m128i _mm_castps_si128(__m128 in);

extern __m128  _mm_castsi128_ps(__m128i in);

extern __m128d _mm_castsi128_pd(__m128i in);
Comment 1 Andrew Pinski 2005-01-13 05:11:35 UTC
Comment 2 Richard Henderson 2005-01-13 05:40:21 UTC
What file does Intel put them in?
Comment 3 tbp 2005-01-13 05:44:53 UTC
They are described in the SSE2 documentation chapter and defined in emmintrin.h
that way:

 * Support for casting between various SP, DP, INT vector types.
 * Note that these do no conversion of values, they just change
 * the type.
extern __m128  _mm_castpd_ps(__m128d in);
extern __m128i _mm_castpd_si128(__m128d in);
extern __m128d _mm_castps_pd(__m128 in);
extern __m128i _mm_castps_si128(__m128 in);
extern __m128  _mm_castsi128_ps(__m128i in);
extern __m128d _mm_castsi128_pd(__m128i in);
Comment 4 tbp 2005-01-14 03:51:15 UTC
While we're at it, in pmmintrin.h, the DAZ related macros are conditionnalized
on  __SSE3__ definition and that's not quite right.
Comment 5 CVS Commits 2005-01-20 19:06:58 UTC
Subject: Bug 19418

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	rth@gcc.gnu.org	2005-01-20 19:06:28

Modified files:
	gcc            : ChangeLog 
	gcc/config/i386: emmintrin.h 

Log message:
	PR target/19418
	* config/i386/emmintrin.h (_mm_castpd_ps, _mm_castpd_si128): New.
	(_mm_castps_pd, _mm_castps_si128): New.
	(_mm_castsi128_ps, _mm_castsi128_pd): New.


Comment 6 Richard Henderson 2005-01-20 19:09:28 UTC

If someone wants to go over the rest of the headers item by item and compare
them to the Intel documentation, that would be great.  But by eyes claim 
they'll go on strike if I try to do that.