2023-06-14 16:52:36 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0 */
|
2014-01-14 20:39:21 +01:00
|
|
|
|
2014-01-15 15:11:50 +01:00
|
|
|
#ifndef __UTIL_OPTIMIZATION_H__
|
|
|
|
|
#define __UTIL_OPTIMIZATION_H__
|
|
|
|
|
|
|
|
|
|
#ifndef __KERNEL_GPU__
|
|
|
|
|
|
|
|
|
|
/* x86
|
|
|
|
|
*
|
2024-02-26 14:49:19 +01:00
|
|
|
* Compile a regular and SSE42 kernel. */
|
2014-01-15 15:11:50 +01:00
|
|
|
|
|
|
|
|
# if defined(i386) || defined(_M_IX86)
|
|
|
|
|
|
2024-02-26 14:49:19 +01:00
|
|
|
/* We require minimum SSE4.2 support on x86, so auto enable. */
|
|
|
|
|
# define __KERNEL_SSE42__
|
|
|
|
|
# ifdef WITH_KERNEL_SSE42
|
|
|
|
|
# define WITH_CYCLES_OPTIMIZED_KERNEL_SSE42
|
2016-04-13 08:58:52 +02:00
|
|
|
# endif
|
2014-01-15 15:11:50 +01:00
|
|
|
|
|
|
|
|
/* x86-64
|
|
|
|
|
*
|
2024-02-26 14:49:19 +01:00
|
|
|
* Compile a regular (includes SSE4.2) and AVX2 kernel. */
|
2014-01-15 15:11:50 +01:00
|
|
|
|
2021-02-14 15:01:26 +01:00
|
|
|
# elif defined(__x86_64__) || defined(_M_X64)
|
2014-01-14 20:39:21 +01:00
|
|
|
|
2024-02-26 14:49:19 +01:00
|
|
|
/* SSE4.2 is our minimum requirement for x86-64 CPUs, so auto enable */
|
|
|
|
|
# define __KERNEL_SSE42__
|
|
|
|
|
/* no SSE4.2 kernel on x86-64, part of regular kernel */
|
2016-04-13 08:58:52 +02:00
|
|
|
# ifdef WITH_KERNEL_AVX2
|
|
|
|
|
# define WITH_CYCLES_OPTIMIZED_KERNEL_AVX2
|
|
|
|
|
# endif
|
2014-06-13 22:23:58 +02:00
|
|
|
|
2021-02-14 15:01:26 +01:00
|
|
|
/* Arm Neon
|
|
|
|
|
*
|
|
|
|
|
* Compile a SSE4 kernel emulated with Neon. Most code is shared with
|
|
|
|
|
* SSE, some specializations for performance and compatibility are made
|
|
|
|
|
* made testing for __KERNEL_NEON__. */
|
|
|
|
|
|
2024-03-06 15:44:46 +01:00
|
|
|
# elif (defined(__ARM_NEON) || defined(_M_ARM64)) && defined(WITH_SSE2NEON)
|
2021-02-14 15:01:26 +01:00
|
|
|
|
|
|
|
|
# define __KERNEL_NEON__
|
|
|
|
|
# define __KERNEL_SSE__
|
|
|
|
|
# define __KERNEL_SSE2__
|
|
|
|
|
# define __KERNEL_SSE3__
|
2024-02-09 17:25:58 +01:00
|
|
|
# define __KERNEL_SSE42__
|
2021-02-14 15:01:26 +01:00
|
|
|
|
|
|
|
|
# endif
|
2014-01-14 20:39:21 +01:00
|
|
|
|
2014-01-15 15:11:50 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif /* __UTIL_OPTIMIZATION_H__ */
|