Consted the things
This commit is contained in:
parent
748186efdf
commit
88a5f0d0d7
2 changed files with 17 additions and 6 deletions
|
|
@ -13,6 +13,17 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT ANDROID)
|
||||||
add_link_options(-stdlib=libc++) # New command on CMake master, not in 3.12 release
|
add_link_options(-stdlib=libc++) # New command on CMake master, not in 3.12 release
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
include(CheckCXXCompilerFlag)
|
||||||
|
# CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
|
||||||
|
# if(COMPILER_SUPPORTS_MARCH_NATIVE)
|
||||||
|
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
|
||||||
|
# endif()
|
||||||
|
|
||||||
|
# CHECK_CXX_COMPILER_FLAG("-ffast-math" COMPILER_SUPPORTS_FASTMATH)
|
||||||
|
# if(COMPILER_SUPPORTS_FASTMATH)
|
||||||
|
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math")
|
||||||
|
# endif()
|
||||||
|
|
||||||
set(BUILD_TESTING OFF CACHE BOOL "Disable Abseil's tests")
|
set(BUILD_TESTING OFF CACHE BOOL "Disable Abseil's tests")
|
||||||
add_subdirectory(external/abseil-cpp)
|
add_subdirectory(external/abseil-cpp)
|
||||||
add_subdirectory(external/spdlog)
|
add_subdirectory(external/spdlog)
|
||||||
|
|
|
||||||
|
|
@ -75,14 +75,14 @@ public:
|
||||||
const float* end = input + 2 * lastAligned;
|
const float* end = input + 2 * lastAligned;
|
||||||
while (in < end)
|
while (in < end)
|
||||||
{
|
{
|
||||||
auto input0 = _mm_loadu_ps(in);
|
const auto input0 = _mm_loadu_ps(in);
|
||||||
in += 4;
|
in += 4;
|
||||||
auto input1 = _mm_loadu_ps(in);
|
const auto input1 = _mm_loadu_ps(in);
|
||||||
in += 4;
|
in += 4;
|
||||||
auto intermediate0 = _mm_unpacklo_ps(input0, input1);
|
const auto intermediate0 = _mm_unpacklo_ps(input0, input1);
|
||||||
auto intermediate1 = _mm_unpackhi_ps(input0, input1);
|
const auto intermediate1 = _mm_unpackhi_ps(input0, input1);
|
||||||
auto output0 = _mm_unpacklo_ps(intermediate0, intermediate1);
|
const auto output0 = _mm_unpacklo_ps(intermediate0, intermediate1);
|
||||||
auto output1 = _mm_unpackhi_ps(intermediate0, intermediate1);
|
const auto output1 = _mm_unpackhi_ps(intermediate0, intermediate1);
|
||||||
_mm_store_ps(out0, output0);
|
_mm_store_ps(out0, output0);
|
||||||
_mm_store_ps(out1, output1);
|
_mm_store_ps(out1, output1);
|
||||||
out0 += 4;
|
out0 += 4;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue