SIMD refactor

This commit is contained in:
Jack Andersen
2018-12-07 15:31:02 -10:00
parent 0cdfd0ad9f
commit e1b29fda7a
11 changed files with 3003 additions and 596 deletions

View File

@@ -0,0 +1,26 @@
#pragma once
#define _ATHENA_SIMD_INCLUDED
namespace athena::_simd { using namespace std; }
#include "parallelism_v2_simd.hpp"
#if _M_IX86_FP >= 1 || _M_X64
#define __SSE__ 1
#endif
#if __AVX__
#include "simd_avx.hpp"
#elif __SSE__
#include "simd_sse.hpp"
#else
namespace simd_abi {
template<typename T> struct athena_native {};
template<> struct athena_native<float> { using type = fixed_size<4>; };
template<> struct athena_native<double> { using type = fixed_size<4>; };
}
#endif
namespace athena {
template<typename T> using simd = _simd::simd<T,
typename _simd::simd_abi::athena_native<T>::type>;
template<typename T>
using simd_values = _simd::simd_data<simd<T>>;
using simd_floats = simd_values<float>;
using simd_doubles = simd_values<double>;
}