more MIC stuff

This commit is contained in:
Martin Reinecke 2013-08-08 12:59:07 +02:00
parent ab8a39d4d5
commit 693cda4719
2 changed files with 16 additions and 3 deletions

View file

@ -25,7 +25,7 @@
/* \file sharp_complex_hacks.h
* support for converting vector types and complex numbers
*
* Copyright (C) 2012 Max-Planck-Society
* Copyright (C) 2012,2013 Max-Planck-Society
* Author: Martin Reinecke
*/
@ -132,4 +132,18 @@ static inline void vhsum_cmplx2 (Tv a, Tv b, Tv c, Tv d,
#endif
#if (VLEN==8)
static inline complex double vhsum_cmplx(Tv a, Tv b)
{ return _mm512_reduce_add_pd(a)+_Complex_I*_mm512_reduce_add_pd(b); }
static inline void vhsum_cmplx2 (Tv a, Tv b, Tv c, Tv d,
complex double * restrict c1, complex double * restrict c2)
{
*c1 += _mm512_reduce_add_pd(a)+_Complex_I*_mm512_reduce_add_pd(b);
*c2 += _mm512_reduce_add_pd(c)+_Complex_I*_mm512_reduce_add_pd(d);
}
#endif
#endif

View file

@ -209,8 +209,7 @@ typedef __mmask8 Tm;
#define vgt(a,b) _mm512_cmp_pd_mask(a,b,_CMP_GT_OQ)
#define vge(a,b) _mm512_cmp_pd_mask(a,b,_CMP_GE_OQ)
#define vne(a,b) _mm512_cmp_pd_mask(a,b,_CMP_NEQ_OQ)
#define vand(a,b) (__m512d)_mm512_and_epi64((__m512i)a,(__m512i)b)
#define vor(a,b) (__m512d)_mm512_or_epi64((__m512i)a,(__m512i)b)
#define vand_mask(a,b) ((a)&(b))
#define vmin(a,b) _mm512_min_pd(a,b)
#define vmax(a,b) _mm512_max_pd(a,b)
#define vanyTrue(a) (a!=0)