RFC: A new meta intrinsic header file for x86 intrinsics
H.J. Lu
hjl.tools@gmail.com
Mon Nov 3 22:19:00 GMT 2008
Hi,
Icc will introduce <immintrin.h> to support intrinsics for current and
future instruction sets,
starting with AVX. We will submit a patch to implement <immintrin.h>,
which will look like:
---
#ifndef _IMMINTRIN_H_INCLUDED
#define _IMMINTRIN_H_INCLUDED
#ifdef __MMX__
#include <mmintrin.h>
#endif
#ifdef __SSE__
#include <xmmintrin.h>
#endif
#ifdef __SSE2__
#include <emmintrin.h>
#endif
#ifdef __SSE3__
#include <pmmintrin.h>
#endif
#ifdef __SSSE3__
#include <tmmintrin.h>
#endif
#if defined (__SSE4_2__) || defined (__SSE4_1__)
#include <smmintrin.h>
#endif
#if defined (__AES__) || defined (__PCLMUL__)
#include <wmmintrin.h>
#endif
#ifdef __AVX__
AVX intrinsics
#endif
#endif /* _IMMINTRIN_H_INCLUDED */
---
My question is if we should put AVX intrinsics directly in immintrin.h or in
a separate file. If we put AVX and future intrinsics directly in immintrin.h,
immintrin.h may become very large and harder to maintain. Another
choice is to put AVX intrinsics in a separate file, saying avxintrin.h:
#ifndef _IMMINTRIN_H_INCLUDED
# error "Never use <avxintrin.h> directly; include <immintrin.h> instead."
#else
AVX intrinsics
#endif /* _IMMINTRIN_H_INCLUDED */
Any comments?
Thanks.
--
H.J.
More information about the Gcc
mailing list