Commit a332bdd8 authored by rue's avatar rue

add avx2 support for phi coprocessor

parent c7654e90
#include "immintrin.h"
int main() {
#ifdef __MIC__
__m512 tx, ty ;
tx += ty ;
#endif
return 0;
}
#include <x86intrin.h>
#include <xmmintrin.h> // SSE
#include <emmintrin.h> // SSE2
#include <pmmintrin.h> // SSE3
#include <tmmintrin.h> // SSSE3
#include <smmintrin.h> // SSE4
#include <immintrin.h> // AVX
int main(){
{
#ifdef __MIC__
__m512d res0d, res1d;
res0d = _mm512_hadd_pd(res0d, res1d);
__m512 res0, res1;
res0 = _mm512_hadd_ps(res0, res1);
#endif
}
{
__m256d res0d, res1d;
res0d = _mm256_hadd_pd(res0d, res1d);
__m256 res0, res1;
res0 = _mm256_hadd_ps(res0, res1);
}
{
__m128d res0d, res1d;
res0d = _mm_hadd_pd(res0d, res1d);
__m128 res0, res1;
res0 = _mm_hadd_ps(res0, res1);
}
return 0;
}
// ===================================================================================
// Copyright ScalFmm 2011 INRIA, Olivier Coulaud, Bérenger Bramas, Matthias Messner
// olivier.coulaud@inria.fr, berenger.bramas@inria.fr
// This software is a computer program whose purpose is to compute the FMM.
//
// This software is governed by the CeCILL-C and LGPL licenses and
// abiding by the rules of distribution of free software.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public and CeCILL-C Licenses for more details.
// "http://www.cecill.info".
// "http://www.gnu.org/licenses".
// ===================================================================================
#ifndef FAVX2_HPP
#define FAVX2_HPP
#include "FGlobal.hpp"
#ifndef SCALFMM_USE_AVX2
#error The AVX header is included while SCALFMM_USE_AVX is turned OFF
#endif
#include "immintrin.h"
#ifdef __MIC__
//Side effect operators DOUBLE
inline __m512d& operator+=(__m512d & a, const __m512d & b){
return (a = _mm512_add_pd (a,b));
}
inline __m512d& operator-=(__m512d& a, const __m512d& b){
return (a = _mm512_sub_pd (a,b));
}
inline __m512d& operator*=(__m512d& a, const __m512d& b){
return (a = _mm512_mul_pd (a,b));
}
inline __m512d& operator/=(__m512d& a, const __m512d& b){
return (a = _mm512_div_pd (a,b));
}
//No side effect operators DOUBLE
inline __m512d operator+(const __m512d& a,const __m512d& b){
return _mm512_add_pd (a,b);
}
inline __m512d operator-(const __m512d& a, const __m512d& b){
return _mm512_sub_pd (a,b);
}
inline __m512d operator*(const __m512d& v1, const __m512d& v2){
return _mm512_mul_pd(v1, v2);
}
inline __m512d operator/(const __m512d& v1, const __m512d& v2){
return _mm512_div_pd(v1, v2);
}
//Side effect operators SINGLE
inline __m512& operator+=(__m512 & a, const __m512 & b){
return (a = _mm512_add_ps (a,b));
}
inline __m512& operator-=(__m512& a, const __m512& b){
return (a = _mm512_sub_ps (a,b));
}
inline __m512& operator*=(__m512& a, const __m512& b){
return (a = _mm512_mul_ps (a,b));
}
inline __m512& operator/=(__m512& a, const __m512& b){
return (a = _mm512_div_ps (a,b));
}
//No side effect operators SINGLE
inline __m512 operator+(const __m512& a,const __m512& b){
return _mm512_add_ps (a,b);
}
inline __m512 operator-(const __m512& a, const __m512& b){
return _mm512_sub_ps (a,b);
}
inline __m512 operator*(const __m512& v1, const __m512& v2){
return _mm512_mul_ps(v1, v2);
}
inline __m512 operator/(const __m512& v1, const __m512& v2){
return _mm512_div_ps(v1, v2);
}
#endif
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment