commit f816406cd607ff7a3b4e7c84d45009e955eae7c9 parent eb8746b4805fc4cd75cec1219c077814a8bf8960 Author: Vincent Forest <vincent.forest@meso-star.com> Date: Fri, 5 May 2023 10:18:49 +0200 Merge branch 'release_0.4.0' Diffstat:
53 files changed, 323 insertions(+), 281 deletions(-)
diff --git a/README.md b/README.md @@ -21,6 +21,18 @@ project. ## Release notes +### Version 0.4 + +- Make the sleef library an internal dependency that library users don't have + to worry about: calls to the sleef library are moved from API headers to C + files. +- Set the C standard to C99 instead of C89: this allows the use of official + (i.e. unpatched) sleef headers whose comments are written using C99-style + comments. Note that since sleef is now an internal dependency, the rsimd API + remains C89 compliant. +- Remove the file COPYING.LESSER from the installation target: since version + 0.3, the library is distributed under GPLv3+. + ### Version 0.3 - Add 8-way vector API for the float and int32 types. @@ -39,7 +51,7 @@ project. ## License -Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr). RSIMD is free software -released under the GPL v3+ license: GNU GPL version 3 or later. You are welcome -to redistribute it under certain conditions; refer to the COPYING file for -details. +Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr). RSIMD is +free software released under the GPL v3+ license: GNU GPL version 3 or later. +You are welcome to redistribute it under certain conditions; refer to the +COPYING file for details. diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +# Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) # # The RSIMD CMake is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -57,10 +57,13 @@ string(REGEX MATCH "[ \t\r\n]+sse4_1[ \t\r\n]+" SSE4_1 ${CPUINFO_OUT}) string(REGEX MATCH "[ \t\r\n]+avx[ \t\r\n]+" AVX ${CPUINFO_OUT}) string(REGEX MATCH "[ \t\r\n]+fma[ \t\r\n]+" FMA ${CPUINFO_OUT}) +set(CFLAGS "-std=c99") # Required by the sleef library's c99 style comments + if(SSE2) unset(SSE2) CHECK_C_COMPILER_FLAG("-msse2" SSE2) message(STATUS "Use the SSE2 instruction set ") + set(CFLAGS "${CFLAGS} -msse2") else() message(FATAL_ERROR "The SSE2 instruction set must be supported.") endif() @@ -68,23 +71,26 @@ if(SSE4_1) unset(SSE4_1) CHECK_C_COMPILER_FLAG("-msse4.1" SSE4_1) message(STATUS "Use the SSE4.1 instruction set") + set(CFLAGS "${CFLAGS} -msse4.1") endif() if(AVX) unset(AVX) CHECK_C_COMPILER_FLAG("-mavx" AVX) message(STATUS "Use the AVX instruction set") + set(CFLAGS "${CFLAGS} -mavx") endif() if(FMA) unset(FMA) CHECK_C_COMPILER_FLAG("-mfma" FMA) message(STATUS "Use the FMA instruction set") + set(CFLAGS "${CFLAGS} -mfma") endif() ################################################################################ # Configure and define targets ################################################################################ set(VERSION_MAJOR 0) -set(VERSION_MINOR 3) +set(VERSION_MINOR 4) set(VERSION_PATCH 0) set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) @@ -133,8 +139,12 @@ set(RSIMD_FILES_INC_AVX avx/avxf.h avx/avxi.h) set(RSIMD_FILES_SRC + math4.c aosf44.c aosq.c) +if(AVX) + set(RSIMD_FILES_SRC ${RSIMD_FILES_SRC} math8.c) +endif() set(RSIMD_FILES_DOC COPYING README.md) set(RSIMD_FILES_CMAKE RSIMDConfig.cmake @@ -152,7 +162,8 @@ set(RSIMD_FILES_INC add_library(rsimd SHARED ${RSIMD_FILES_INC} ${RSIMD_FILES_SRC}) target_link_libraries(rsimd Sleef) -set_target_properties(rsimd PROPERTIES DEFINE_SYMBOL RSIMD_SHARED_BUILD) +set_target_properties(rsimd PROPERTIES DEFINE_SYMBOL RSIMD_SHARED_BUILD) +set_target_properties(rsimd PROPERTIES COMPILE_FLAGS "${CFLAGS}") set_target_properties(rsimd PROPERTIES VERSION ${VERSION} SOVERSION ${VERSION_MAJOR}) diff --git a/cmake/RSIMDConfig.cmake.in b/cmake/RSIMDConfig.cmake.in @@ -1,4 +1,4 @@ -# Copyright (C) 2013-2021 Vincent Forest (vaplv@free.fr) +# Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/cmake/RSIMDConfigVersion.cmake.in b/cmake/RSIMDConfigVersion.cmake.in @@ -1,4 +1,4 @@ -# Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +# Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/cmake/SleefConfig.cmake b/cmake/SleefConfig.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +# Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) # # The RSIMD CMake is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/src/aosf33.h b/src/aosf33.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/aosf44.c b/src/aosf44.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/aosf44.h b/src/aosf44.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/aosq.c b/src/aosq.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/aosq.h b/src/aosq.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/avx/avx.h b/src/avx/avx.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/avx/avxf.h b/src/avx/avxf.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/avx/avxi.h b/src/avx/avxi.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/math.h b/src/math.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/math4.c b/src/math4.c @@ -0,0 +1,26 @@ +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) + * + * The RSIMD library 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. + * + * The RSIMD library 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 the RSIMD library. If not, see <http://www.gnu.org/licenses/>. */ + +#include "math4.h" +#include <rsys/rsys.h> + +#ifndef SIMD_SSE2 + #error "Missing SIMD instruction set" +#endif + +#define RSIMD_WIDTH__ 4 +#include "vXf_begin.h" +#include "mathX_c.h" +#include "vXf_end.h" diff --git a/src/math4.h b/src/math4.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/math8.c b/src/math8.c @@ -0,0 +1,26 @@ +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) + * + * The RSIMD library 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. + * + * The RSIMD library 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 the RSIMD library. If not, see <http://www.gnu.org/licenses/>. */ + +#include "math8.h" +#include <rsys/rsys.h> + +#ifndef SIMD_AVX + #error "Missing SIMD instruction set" +#endif + +#define RSIMD_WIDTH__ 8 +#include "vXf_begin.h" +#include "mathX_c.h" +#include "vXf_end.h" diff --git a/src/math8.h b/src/math8.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/mathX.h b/src/mathX.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published @@ -15,123 +15,79 @@ #include "rsimd.h" -#ifdef COMPILER_GCC - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wignored-qualifiers" -#endif +RSIMD_API RSIMD_vXf_T__ +RSIMD_vXf__(copysign) + (const RSIMD_vXf_T__ x, + const RSIMD_vXf_T__ y); -#include <sleef.h> +RSIMD_API RSIMD_vXf_T__ +RSIMD_vXf__(floor) + (const RSIMD_vXf_T__ x); -#ifdef COMPILER_GCC - #pragma GCC diagnostic pop -#endif - -static FINLINE RSIMD_vXf_T__ -RSIMD_vXf__(copysign)(const RSIMD_vXf_T__ x, const RSIMD_vXf_T__ y) -{ - return RSIMD_Sleef__(copysignf)(x, y); -} - -static INLINE RSIMD_vXf_T__ -RSIMD_vXf__(floor)(const RSIMD_vXf_T__ x) -{ - return RSIMD_Sleef__(floorf)(x); -} - -static INLINE RSIMD_vXf_T__ -RSIMD_vXf__(pow)(const RSIMD_vXf_T__ x, const RSIMD_vXf_T__ y) -{ - return RSIMD_Sleef_ULP__(powf, u10)(x, y); -} +RSIMD_API RSIMD_vXf_T__ +RSIMD_vXf__(pow) + (const RSIMD_vXf_T__ x, + const RSIMD_vXf_T__ y); /******************************************************************************* * Exponentatial functions ******************************************************************************/ -static INLINE RSIMD_vXf_T__ -RSIMD_vXf__(exp2)(const RSIMD_vXf_T__ x) -{ - return RSIMD_Sleef_ULP__(exp2f, u10)(x); -} - -static INLINE RSIMD_vXf_T__ -RSIMD_vXf__(exp)(const RSIMD_vXf_T__ x) -{ - return RSIMD_Sleef_ULP__(expf, u10)(x); -} - -static INLINE RSIMD_vXf_T__ -RSIMD_vXf__(exp10)(const RSIMD_vXf_T__ x) -{ - return RSIMD_Sleef_ULP__(exp10f, u10)(x); -} +RSIMD_API RSIMD_vXf_T__ +RSIMD_vXf__(exp2) + (const RSIMD_vXf_T__ x); + +RSIMD_API RSIMD_vXf_T__ +RSIMD_vXf__(exp) + (const RSIMD_vXf_T__ x); + +RSIMD_API RSIMD_vXf_T__ +RSIMD_vXf__(exp10) + (const RSIMD_vXf_T__ x); /******************************************************************************* * Log functions ******************************************************************************/ -static INLINE RSIMD_vXf_T__ -RSIMD_vXf__(log2)(const RSIMD_vXf_T__ x) -{ - return RSIMD_Sleef_ULP__(log2f, u10)(x); -} - -static INLINE RSIMD_vXf_T__ -RSIMD_vXf__(log)(const RSIMD_vXf_T__ x) -{ - return RSIMD_Sleef_ULP__(logf, u10)(x); -} - -static INLINE RSIMD_vXf_T__ -RSIMD_vXf__(log10)(const RSIMD_vXf_T__ x) -{ - return RSIMD_Sleef_ULP__(log10f, u10)(x); -} +RSIMD_API RSIMD_vXf_T__ +RSIMD_vXf__(log2) + (const RSIMD_vXf_T__ x); + +RSIMD_API RSIMD_vXf_T__ +RSIMD_vXf__(log) + (const RSIMD_vXf_T__ x); + +RSIMD_API RSIMD_vXf_T__ +RSIMD_vXf__(log10) + (const RSIMD_vXf_T__ x); /******************************************************************************* * Trigonometric functions ******************************************************************************/ -static INLINE RSIMD_vXf_T__ -RSIMD_vXf__(sin)(const RSIMD_vXf_T__ v) -{ - return RSIMD_Sleef_ULP__(sinf, u10)(v); -} - -static INLINE RSIMD_vXf_T__ -RSIMD_vXf__(asin)(const RSIMD_vXf_T__ v) -{ - return RSIMD_Sleef_ULP__(asinf, u10)(v); -} - -static INLINE RSIMD_vXf_T__ -RSIMD_vXf__(cos)(const RSIMD_vXf_T__ v) -{ - return RSIMD_Sleef_ULP__(cosf, u10)(v); -} - -static INLINE RSIMD_vXf_T__ -RSIMD_vXf__(acos)(const RSIMD_vXf_T__ v) -{ - return RSIMD_Sleef_ULP__(acosf, u10)(v); -} - -static INLINE void +RSIMD_API RSIMD_vXf_T__ +RSIMD_vXf__(sin) + (const RSIMD_vXf_T__ v); + +RSIMD_API RSIMD_vXf_T__ +RSIMD_vXf__(asin) + (const RSIMD_vXf_T__ v); + +RSIMD_API RSIMD_vXf_T__ +RSIMD_vXf__(cos) + (const RSIMD_vXf_T__ v); + +RSIMD_API RSIMD_vXf_T__ +RSIMD_vXf__(acos) + (const RSIMD_vXf_T__ v); + +RSIMD_API void RSIMD_vXf__(sincos) - (const RSIMD_vXf_T__ v, RSIMD_vXf_T__* RESTRICT s, RSIMD_vXf_T__* RESTRICT c) -{ - const RSIMD_Sleef_vecf__(2) r = RSIMD_Sleef_ULP__(sincosf, u10)(v); - *s = r.x; - *c = r.y; -} - -static INLINE RSIMD_vXf_T__ -RSIMD_vXf__(tan)(const RSIMD_vXf_T__ v) -{ - return RSIMD_Sleef_ULP__(tanf, u10)(v); -} - -static INLINE RSIMD_vXf_T__ -RSIMD_vXf__(atan)(const RSIMD_vXf_T__ v) -{ - return RSIMD_Sleef_ULP__(atanf, u10)(v); -} + (const RSIMD_vXf_T__ v, + RSIMD_vXf_T__* RESTRICT s, + RSIMD_vXf_T__* RESTRICT c); +RSIMD_API RSIMD_vXf_T__ +RSIMD_vXf__(tan) + (const RSIMD_vXf_T__ v); +RSIMD_API RSIMD_vXf_T__ +RSIMD_vXf__(atan) + (const RSIMD_vXf_T__ v); diff --git a/src/mathX_c.h b/src/mathX_c.h @@ -0,0 +1,135 @@ +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) + * + * The RSIMD library 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. + * + * The RSIMD library 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 the RSIMD library. If not, see <http://www.gnu.org/licenses/>. */ + +#include "rsimd.h" + +#ifdef COMPILER_GCC + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wignored-qualifiers" +#endif + +#include <sleef.h> + +#ifdef COMPILER_GCC + #pragma GCC diagnostic pop +#endif + +RSIMD_vXf_T__ +RSIMD_vXf__(copysign)(const RSIMD_vXf_T__ x, const RSIMD_vXf_T__ y) +{ + return RSIMD_Sleef__(copysignf)(x, y); +} + +RSIMD_vXf_T__ +RSIMD_vXf__(floor)(const RSIMD_vXf_T__ x) +{ + return RSIMD_Sleef__(floorf)(x); +} + +RSIMD_vXf_T__ +RSIMD_vXf__(pow)(const RSIMD_vXf_T__ x, const RSIMD_vXf_T__ y) +{ + return RSIMD_Sleef_ULP__(powf, u10)(x, y); +} + +/******************************************************************************* + * Exponentatial functions + ******************************************************************************/ +RSIMD_vXf_T__ +RSIMD_vXf__(exp2)(const RSIMD_vXf_T__ x) +{ + return RSIMD_Sleef_ULP__(exp2f, u10)(x); +} + +RSIMD_vXf_T__ +RSIMD_vXf__(exp)(const RSIMD_vXf_T__ x) +{ + return RSIMD_Sleef_ULP__(expf, u10)(x); +} + +RSIMD_vXf_T__ +RSIMD_vXf__(exp10)(const RSIMD_vXf_T__ x) +{ + return RSIMD_Sleef_ULP__(exp10f, u10)(x); +} + +/******************************************************************************* + * Log functions + ******************************************************************************/ +RSIMD_vXf_T__ +RSIMD_vXf__(log2)(const RSIMD_vXf_T__ x) +{ + return RSIMD_Sleef_ULP__(log2f, u10)(x); +} + +RSIMD_vXf_T__ +RSIMD_vXf__(log)(const RSIMD_vXf_T__ x) +{ + return RSIMD_Sleef_ULP__(logf, u10)(x); +} + +RSIMD_vXf_T__ +RSIMD_vXf__(log10)(const RSIMD_vXf_T__ x) +{ + return RSIMD_Sleef_ULP__(log10f, u10)(x); +} + +/******************************************************************************* + * Trigonometric functions + ******************************************************************************/ +RSIMD_vXf_T__ +RSIMD_vXf__(sin)(const RSIMD_vXf_T__ v) +{ + return RSIMD_Sleef_ULP__(sinf, u10)(v); +} + +RSIMD_vXf_T__ +RSIMD_vXf__(asin)(const RSIMD_vXf_T__ v) +{ + return RSIMD_Sleef_ULP__(asinf, u10)(v); +} + +RSIMD_vXf_T__ +RSIMD_vXf__(cos)(const RSIMD_vXf_T__ v) +{ + return RSIMD_Sleef_ULP__(cosf, u10)(v); +} + +RSIMD_vXf_T__ +RSIMD_vXf__(acos)(const RSIMD_vXf_T__ v) +{ + return RSIMD_Sleef_ULP__(acosf, u10)(v); +} + +void +RSIMD_vXf__(sincos) + (const RSIMD_vXf_T__ v, RSIMD_vXf_T__* RESTRICT s, RSIMD_vXf_T__* RESTRICT c) +{ + const RSIMD_Sleef_vecf__(2) r = RSIMD_Sleef_ULP__(sincosf, u10)(v); + *s = r.x; + *c = r.y; +} + +RSIMD_vXf_T__ +RSIMD_vXf__(tan)(const RSIMD_vXf_T__ v) +{ + return RSIMD_Sleef_ULP__(tanf, u10)(v); +} + +RSIMD_vXf_T__ +RSIMD_vXf__(atan)(const RSIMD_vXf_T__ v) +{ + return RSIMD_Sleef_ULP__(atanf, u10)(v); +} diff --git a/src/rsimd.h b/src/rsimd.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/soa4f2.h b/src/soa4f2.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/soa4f3.h b/src/soa4f3.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/soa4f4.h b/src/soa4f4.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/soa8f2.h b/src/soa8f2.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/soa8f3.h b/src/soa8f3.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/soa8f4.h b/src/soa8f4.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/soaXf2.h b/src/soaXf2.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/soaXf3.h b/src/soaXf3.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/soaXfY.h b/src/soaXfY.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/soaXfY_begin.h b/src/soaXfY_begin.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/soaXfY_end.h b/src/soaXfY_end.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/sse/sse.c b/src/sse/sse.c @@ -1,124 +0,0 @@ -#include "maths/simd/simd.h" -#include "sys/sys.h" - -vf4_t -vf4_sin(vf4_t v) -{ - const vi4_t zeroi = vi4_zero(); - const vi4_t onei = vi4_set1(1); - const vi4_t twoi = vi4_set1(2); - const vi4_t threei = vi4_set1(3); - - const vf4_t x = vf4_mul(v, KC0); - const vi4_t q = vf4_to_vi4(x); - const vi4_t off = vi4_and(q, threei); - const vf4_t qf = vi4_to_vf4(q); - - const vf4_t tmp = vf4_sub(v, vf4_mul(qf, KC1)); - const vf4_t xl = vf4_sub(tmp, vf4_mul(qf, KC2)); - const vf4_t xl2 = vf4_mul(xl, xl); - const vf4_t xl3 = vf4_mul(xl2, xl); - - const vf4_t cx = - vf4_madd(vf4_madd(vf4_madd(CC0, xl2, CC1), xl2, CC2), xl2, ONE); - const vf4_t sx = - vf4_madd(vf4_madd(vf4_madd(SC0, xl2, SC1), xl2, SC2), xl3, xl); - - const vf4_t mask0 = (vf4_t) vi4_eq(vi4_and(off, onei), zeroi); - const vf4_t mask1 = (vf4_t) vi4_eq(vi4_and(off, twoi), zeroi); - const vf4_t res = vf4_sel(cx, sx, mask0); - return vf4_sel(vf4_minus(res), res, mask1); -} - -vf4_t -vf4_cos(vf4_t v) -{ - const vi4_t zeroi = vi4_zero(); - const vi4_t onei = vi4_set1(1); - const vi4_t twoi = vi4_set1(2); - const vi4_t threei = vi4_set1(3); - - const vf4_t x = vf4_mul(v, KC0); - const vi4_t q = vf4_to_vi4(x); - const vi4_t off = vi4_add(vi4_and(q, threei), onei); - const vf4_t qf = vi4_to_vf4(q); - - const vf4_t tmp = vf4_sub(v, vf4_mul(qf, KC1)); - const vf4_t xl = vf4_sub(tmp, vf4_mul(qf, KC2)); - const vf4_t xl2 = vf4_mul(xl, xl); - const vf4_t xl3 = vf4_mul(xl2, xl); - - const vf4_t cx = - vf4_madd(vf4_madd(vf4_madd(CC0, xl2, CC1), xl2, CC2), xl2, ONE); - const vf4_t sx = - vf4_madd(vf4_madd(vf4_madd(SC0, xl2, SC1), xl2, SC2), xl3, xl); - - const vf4_t mask0 = (vf4_t) vi4_eq(vi4_and(off, onei), zeroi); - const vf4_t mask1 = (vf4_t) vi4_eq(vi4_and(off, twoi), zeroi); - const vf4_t res = vf4_sel(cx, sx, mask0); - return vf4_sel(vf4_minus(res), res, mask1); -} - -void -vf4_sincos(vf4_t v, vf4_t* restrict s, vf4_t* restrict c) -{ - const vi4_t zeroi = vi4_zero(); - const vi4_t onei = vi4_set1(1); - const vi4_t twoi = vi4_set1(2); - const vi4_t threei = vi4_set1(3); - - const vf4_t x = vf4_mul(v, KC0); - const vi4_t q = vf4_to_vi4(x); - const vi4_t soff = vi4_and(q, threei); - const vi4_t coff = vi4_add(vi4_and(q, threei), onei); - const vf4_t qf = vi4_to_vf4(q); - - const vf4_t tmp = vf4_sub(v, vf4_mul(qf, KC1)); - const vf4_t xl = vf4_sub(tmp, vf4_mul(qf, KC2)); - const vf4_t xl2 = vf4_mul(xl, xl); - const vf4_t xl3 = vf4_mul(xl2, xl); - - const vf4_t cx = - vf4_madd(vf4_madd(vf4_madd(CC0, xl2, CC1), xl2, CC2), xl2, ONE); - const vf4_t sx = - vf4_madd(vf4_madd(vf4_madd(SC0, xl2, SC1), xl2, SC2), xl3, xl); - - const vf4_t smask0 = (vf4_t) vi4_eq(vi4_and(soff, onei), zeroi); - const vf4_t smask1 = (vf4_t) vi4_eq(vi4_and(soff, twoi), zeroi); - const vf4_t sres = vf4_sel(cx, sx, smask0); - *s = vf4_sel(vf4_minus(sres), sres, smask1); - - const vf4_t cmask0 = (vf4_t) vi4_eq(vi4_and(coff, onei), zeroi); - const vf4_t cmask1 = (vf4_t) vi4_eq(vi4_and(coff, twoi), zeroi); - const vf4_t cres = vf4_sel(cx, sx, cmask0); - *c = vf4_sel(vf4_minus(cres), cres, cmask1); -} - -vf4_t -vf4_acos(vf4_t v) -{ - const vf4_t absv = vf4_abs(v); - const vf4_t t0 = vf4_sqrt(vf4_sub(vf4_set1(1.f), absv)); - const vf4_t absv2 =vf4_mul(absv, absv); - const vf4_t absv4 = vf4_mul(absv2, absv2); - - const vf4_t h0 = vf4_set1(-0.0012624911f); - const vf4_t h1 = vf4_set1(0.0066700901f); - const vf4_t h2 = vf4_set1(-0.0170881256f); - const vf4_t h3 = vf4_set1(0.0308918810f); - const vf4_t hi = - vf4_madd(vf4_madd(vf4_madd(h0, absv, h1), absv, h2), absv, h3); - - const vf4_t l0 = vf4_set1(-0.0501743046f); - const vf4_t l1 = vf4_set1(0.0889789874f); - const vf4_t l2 = vf4_set1(-0.2145988016f); - const vf4_t l3 = vf4_set1(1.5707963050f); - const vf4_t lo = - vf4_madd(vf4_madd(vf4_madd(l0, absv, l1), absv, l2), absv, l3); - - const vf4_t res = vf4_mul(vf4_madd(hi, absv4, lo), t0); - const vf4_t mask = vf4_lt(v, vf4_zero()); - - return vf4_sel(res, vf4_set1(3.14159265358979323846) - res, mask); -} - diff --git a/src/sse/sse.h b/src/sse/sse.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/sse/sse_swz.h b/src/sse/sse_swz.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/sse/ssef.h b/src/sse/ssef.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/sse/ssei.h b/src/sse/ssei.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/test_aosf33.c b/src/test_aosf33.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/test_aosf44.c b/src/test_aosf44.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/test_aosq.c b/src/test_aosq.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/test_soa4f2.c b/src/test_soa4f2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/test_soa4f3.c b/src/test_soa4f3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/test_soa4f4.c b/src/test_soa4f4.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/test_soa8f2.c b/src/test_soa8f2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/test_soa8f3.c b/src/test_soa8f3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/test_soa8f4.c b/src/test_soa8f4.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/test_soaXfY.h b/src/test_soaXfY.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/test_v4f.c b/src/test_v4f.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/test_v4i.c b/src/test_v4i.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/test_v8f.c b/src/test_v8f.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/test_v8i.c b/src/test_v8i.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/vXf_begin.h b/src/vXf_begin.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published diff --git a/src/vXf_end.h b/src/vXf_end.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014-2021 Vincent Forest (vaplv@free.fr) +/* Copyright (C) 2014-2019, 2021, 2023 Vincent Forest (vaplv@free.fr) * * The RSIMD library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published