2023-08-15 16:20:26 +02:00
|
|
|
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2021-02-14 14:20:51 +01:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
/** \file
|
|
|
|
* \ingroup bli
|
|
|
|
*
|
|
|
|
* SIMD instruction support.
|
|
|
|
*/
|
|
|
|
|
2024-03-06 15:46:43 +01:00
|
|
|
// TODO: Re-enable this once blenlib is converted to C++
|
|
|
|
#if (defined(__ARM_NEON) /* || (defined(_M_ARM64) && defined(_MSC_VER))*/) && \
|
|
|
|
defined(WITH_SSE2NEON)
|
2021-02-14 04:16:39 +01:00
|
|
|
/* SSE/SSE2 emulation on ARM Neon. Match SSE precision. */
|
2023-08-09 13:12:53 +02:00
|
|
|
# if !defined(SSE2NEON_PRECISE_MINMAX)
|
|
|
|
# define SSE2NEON_PRECISE_MINMAX 1
|
|
|
|
# endif
|
|
|
|
# if !defined(SSE2NEON_PRECISE_DIV)
|
|
|
|
# define SSE2NEON_PRECISE_DIV 1
|
|
|
|
# endif
|
|
|
|
# if !defined(SSE2NEON_PRECISE_SQRT)
|
|
|
|
# define SSE2NEON_PRECISE_SQRT 1
|
|
|
|
# endif
|
2021-02-14 04:16:39 +01:00
|
|
|
# include <sse2neon.h>
|
2023-07-03 17:04:13 +02:00
|
|
|
# define BLI_HAVE_SSE2 1
|
2021-02-14 04:16:39 +01:00
|
|
|
#elif defined(__SSE2__)
|
|
|
|
/* Native SSE2 on Intel/AMD. */
|
2021-02-14 14:20:51 +01:00
|
|
|
# include <emmintrin.h>
|
2023-07-03 17:04:13 +02:00
|
|
|
# define BLI_HAVE_SSE2 1
|
|
|
|
#else
|
|
|
|
# define BLI_HAVE_SSE2 0
|
2021-02-14 14:20:51 +01:00
|
|
|
#endif
|
2024-02-02 16:28:51 +01:00
|
|
|
|
|
|
|
#if defined(__SSE4_1__) || (defined(__ARM_NEON) && defined(WITH_SSE2NEON))
|
|
|
|
# define BLI_HAVE_SSE4 1
|
|
|
|
#else
|
|
|
|
# define BLI_HAVE_SSE4 0
|
|
|
|
#endif
|