sse.h (1262B)
1 /* Copyright (C) 2014-2019, 2021, 2023, 2025 Vincent Forest (vaplv@free.fr) 2 * 3 * The RSIMD library is free software: you can redistribute it and/or modify 4 * it under the terms of the GNU General Public License as published 5 * by the Free Software Foundation, either version 3 of the License, or 6 * (at your option) any later version. 7 * 8 * The RSIMD library is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * GNU General Public License for more details. 12 * 13 * You should have received a copy of the GNU General Public License 14 * along with the RSIMD library. If not, see <http://www.gnu.org/licenses/>. */ 15 16 #ifndef RSIMD_SSE_H 17 #define RSIMD_SSE_H 18 19 #include "ssef.h" 20 #include "ssei.h" 21 22 static FINLINE v4i_T v4f_to_v4i(const v4f_T v) {return _mm_cvtps_epi32(v);} 23 static FINLINE v4f_T v4i_to_v4f(const v4i_T v) {return _mm_cvtepi32_ps(v);} 24 static FINLINE v4i_T v4f_trunk_v4i(const v4f_T v) {return _mm_cvttps_epi32(v);} 25 26 /* Reinterpret cast */ 27 static FINLINE v4i_T v4f_rcast_v4i(const v4f_T v) {return _mm_castps_si128(v);} 28 static FINLINE v4f_T v4i_rcast_v4f(const v4i_T v) {return _mm_castsi128_ps(v);} 29 30 #endif /* SIMD_SSE_H */ 31