This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RFC: A new meta intrinsic header file for x86 intrinsics
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: "GCC Development" <gcc at gcc dot gnu dot org>, "Ye, Joey" <joey dot ye at intel dot com>, "Guo, Xuepeng" <xuepeng dot guo at intel dot com>
- Cc: "Girkar, Milind" <milind dot girkar at intel dot com>
- Date: Mon, 3 Nov 2008 14:17:40 -0800
- Subject: RFC: A new meta intrinsic header file for x86 intrinsics
- References: <6dc9ffc80804041013mfdce2b4g61bf923e6dc9d66f@mail.gmail.com> <47FBDF5F.2010800@codesourcery.com> <20080409013801.GA13627@lucon.org> <47FC28A6.7080800@codesourcery.com>
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.