Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/util/util_simd.h
| Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | |||||
| extern const __m128 _mm_lookupmask_ps[16]; | extern const __m128 _mm_lookupmask_ps[16]; | ||||
| static struct TrueTy { | static struct TrueTy { | ||||
| __forceinline operator bool() const | __forceinline operator bool() const | ||||
| { | { | ||||
| return true; | return true; | ||||
| } | } | ||||
| } True ccl_maybe_unused; | } True ccl_attr_maybe_unused; | ||||
| static struct FalseTy { | static struct FalseTy { | ||||
| __forceinline operator bool() const | __forceinline operator bool() const | ||||
| { | { | ||||
| return false; | return false; | ||||
| } | } | ||||
| } False ccl_maybe_unused; | } False ccl_attr_maybe_unused; | ||||
| static struct ZeroTy { | static struct ZeroTy { | ||||
| __forceinline operator float() const | __forceinline operator float() const | ||||
| { | { | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| __forceinline operator int() const | __forceinline operator int() const | ||||
| { | { | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| } zero ccl_maybe_unused; | } zero ccl_attr_maybe_unused; | ||||
| static struct OneTy { | static struct OneTy { | ||||
| __forceinline operator float() const | __forceinline operator float() const | ||||
| { | { | ||||
| return 1; | return 1; | ||||
| } | } | ||||
| __forceinline operator int() const | __forceinline operator int() const | ||||
| { | { | ||||
| return 1; | return 1; | ||||
| } | } | ||||
| } one ccl_maybe_unused; | } one ccl_attr_maybe_unused; | ||||
| static struct NegInfTy { | static struct NegInfTy { | ||||
| __forceinline operator float() const | __forceinline operator float() const | ||||
| { | { | ||||
| return -std::numeric_limits<float>::infinity(); | return -std::numeric_limits<float>::infinity(); | ||||
| } | } | ||||
| __forceinline operator int() const | __forceinline operator int() const | ||||
| { | { | ||||
| return std::numeric_limits<int>::min(); | return std::numeric_limits<int>::min(); | ||||
| } | } | ||||
| } neg_inf ccl_maybe_unused; | } neg_inf ccl_attr_maybe_unused; | ||||
| static struct PosInfTy { | static struct PosInfTy { | ||||
| __forceinline operator float() const | __forceinline operator float() const | ||||
| { | { | ||||
| return std::numeric_limits<float>::infinity(); | return std::numeric_limits<float>::infinity(); | ||||
| } | } | ||||
| __forceinline operator int() const | __forceinline operator int() const | ||||
| { | { | ||||
| return std::numeric_limits<int>::max(); | return std::numeric_limits<int>::max(); | ||||
| } | } | ||||
| } inf ccl_maybe_unused, pos_inf ccl_maybe_unused; | } inf ccl_attr_maybe_unused, pos_inf ccl_attr_maybe_unused; | ||||
| static struct StepTy { | static struct StepTy { | ||||
| } step ccl_maybe_unused; | } step ccl_attr_maybe_unused; | ||||
| #endif | #endif | ||||
| /* Utilities used by Neon */ | /* Utilities used by Neon */ | ||||
| #if defined(__KERNEL_NEON__) | #if defined(__KERNEL_NEON__) | ||||
| template<class type, int i0, int i1, int i2, int i3> type shuffle_neon(const type &a) | template<class type, int i0, int i1, int i2, int i3> type shuffle_neon(const type &a) | ||||
| { | { | ||||
| if (i0 == i1 && i0 == i2 && i0 == i3) { | if (i0 == i1 && i0 == i2 && i0 == i3) { | ||||
| ▲ Show 20 Lines • Show All 446 Lines • Show Last 20 Lines | |||||