From faf27361cc5e90d0d7d887837aff06a905a13c44 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 4 Dec 2022 20:32:46 +0000 Subject: [PATCH] Expand our custom simde approach to mimic more SSE/AVX headers Signed-off-by: falkTX --- include/simd-compat/emmintrin.h | 25 +++++++++++++++++++++++++ include/simd-compat/immintrin.h | 26 ++++++++++++++++++++++++++ include/simd-compat/pmmintrin.h | 4 ++-- include/simd-compat/xmmintrin.h | 25 +++++++++++++++++++++++++ 4 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 include/simd-compat/emmintrin.h create mode 100644 include/simd-compat/immintrin.h create mode 100644 include/simd-compat/xmmintrin.h diff --git a/include/simd-compat/emmintrin.h b/include/simd-compat/emmintrin.h new file mode 100644 index 0000000..f844860 --- /dev/null +++ b/include/simd-compat/emmintrin.h @@ -0,0 +1,25 @@ +/* + * DISTRHO Cardinal Plugin + * Copyright (C) 2021-2022 Filipe Coelho + * + * 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 the Free Software Foundation; either version 3 of + * the License, or any later version. + * + * This program 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. + * + * For a full copy of the GNU General Public License see the LICENSE file. + */ + +#pragma once + +#if defined(__i386__) || defined(__x86_64__) || defined(__EMSCRIPTEN__) +# include_next +#else +# define SIMDE_ENABLE_NATIVE_ALIASES +# include "../simde/simde/x86/sse.h" +#endif diff --git a/include/simd-compat/immintrin.h b/include/simd-compat/immintrin.h new file mode 100644 index 0000000..5400c92 --- /dev/null +++ b/include/simd-compat/immintrin.h @@ -0,0 +1,26 @@ +/* + * DISTRHO Cardinal Plugin + * Copyright (C) 2021-2022 Filipe Coelho + * + * 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 the Free Software Foundation; either version 3 of + * the License, or any later version. + * + * This program 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. + * + * For a full copy of the GNU General Public License see the LICENSE file. + */ + +#pragma once + +#if defined(__i386__) || defined(__x86_64__) || defined(__EMSCRIPTEN__) +# include_next +#else +# define SIMDE_ENABLE_NATIVE_ALIASES +# include "../simde/simde/x86/sse.h" +# include "../simde/simde/x86/sse2.h" +#endif diff --git a/include/simd-compat/pmmintrin.h b/include/simd-compat/pmmintrin.h index 1f7da29..33ec1c4 100644 --- a/include/simd-compat/pmmintrin.h +++ b/include/simd-compat/pmmintrin.h @@ -43,8 +43,8 @@ #elif defined(__EMSCRIPTEN__) # include_next -static inline -__m64 _mm_set1_pi16(short w) +static __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) +_mm_set1_pi16(short w) { return __extension__ (__m64){ static_cast(w), static_cast(w) }; } diff --git a/include/simd-compat/xmmintrin.h b/include/simd-compat/xmmintrin.h new file mode 100644 index 0000000..5ee268f --- /dev/null +++ b/include/simd-compat/xmmintrin.h @@ -0,0 +1,25 @@ +/* + * DISTRHO Cardinal Plugin + * Copyright (C) 2021-2022 Filipe Coelho + * + * 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 the Free Software Foundation; either version 3 of + * the License, or any later version. + * + * This program 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. + * + * For a full copy of the GNU General Public License see the LICENSE file. + */ + +#pragma once + +#if defined(__i386__) || defined(__x86_64__) || defined(__EMSCRIPTEN__) +# include_next +#else +# define SIMDE_ENABLE_NATIVE_ALIASES +# include "../simde/simde/x86/avx.h" +#endif