#/*
#==============================================================================
#
# simd_avx512.h
#
#------------------------------------------------------------------------------
#
# Copyright (C) 2016 Hinnerk Stueben
#
# This file is part of BQCD -- Berlin Quantum ChromoDynamics program
#
# BQCD is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BQCD 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 License for more details.
#
# You should have received a copy of the GNU General Public License
# along with BQCD.  If not, see <http://www.gnu.org/licenses/>.
#
#------------------------------------------------------------------------------
#*/

# include <immintrin.h>

# define SIMD_WIDTH_R4 16
# define SIMD_WIDTH_R8 8

# define SIMD_VECTOR_R4 __m512
# define SIMD_VECTOR_R8 __m512d

# define SIMD_ALIGNMENT 64

# define Align(a)

# define LoadS_r4(a)    _mm512_broadcast_ss((float*) &(a))
# define LoadS_r8(a)    _mm512_broadcast_sd((double*) &(a))

# define Load_r4(a)     _mm512_loadu_ps((float*) &(a))
# define Load_r8(a)     _mm512_loadu_pd((double*) &(a))

# define Store_r4(a, b) _mm512_storeu_ps((float*) &(a), b)
# define Store_r8(a, b) _mm512_storeu_pd((double*) &(a), b)

# define Sum_r4(a, b)   _mm512_add_ps(a, b)
# define Sum_r8(a, b)   _mm512_add_pd(a, b)

# define Diff_r4(a, b)  _mm512_sub_ps(a, b)
# define Diff_r8(a, b)  _mm512_sub_pd(a, b)

# define Prod_r4(a, b)  _mm512_mul_ps(a, b)
# define Prod_r8(a, b)  _mm512_mul_pd(a, b)

# define Fmadd_r4(a, b, c) _mm512_fmadd_ps(a, b, c)
# define Fmadd_r8(a, b, c) _mm512_fmadd_pd(a, b, c)

# define Fmsub_r4(a, b, c) _mm512_fmsub_ps(a, b, c)
# define Fmsub_r8(a, b, c) _mm512_fmsub_pd(a, b, c)

# define LoadU_r4(a)    _mm512_loadu_ps((float*) &(a))
# define LoadU_r8(a)    _mm512_loadu_pd((double*) &(a))
