diff options
author | Hans Goudey <h.goudey@me.com> | 2022-11-11 04:14:48 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-11-11 04:41:13 +0300 |
commit | 9465b109af0b70244a36f9e68493e316d9f8b56f (patch) | |
tree | c4d933bf09f8313071556063156538ec3356b24c /intern/cycles/util/types_int8.h | |
parent | 026d21a225521670c6b5083da9da61227da69e65 (diff) | |
parent | ca1642cd0c5cdf634fe2022c955d93983de95934 (diff) |
Merge branch 'master' into refactor-mesh-position-genericrefactor-mesh-position-generic
Diffstat (limited to 'intern/cycles/util/types_int8.h')
-rw-r--r-- | intern/cycles/util/types_int8.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/intern/cycles/util/types_int8.h b/intern/cycles/util/types_int8.h new file mode 100644 index 00000000000..8643ebe96ad --- /dev/null +++ b/intern/cycles/util/types_int8.h @@ -0,0 +1,51 @@ +/* SPDX-License-Identifier: Apache-2.0 + * Copyright 2011-2022 Blender Foundation */ + +#pragma once + +#ifndef __UTIL_TYPES_H__ +# error "Do not include this file directly, include util/types.h instead." +#endif + +CCL_NAMESPACE_BEGIN + +struct vfloat8; + +#ifdef __KERNEL_GPU__ +struct vint8 +#else +struct ccl_try_align(32) vint8 +#endif +{ +#ifdef __KERNEL_AVX__ + union { + __m256i m256; + struct { + int a, b, c, d, e, f, g, h; + }; + }; + + __forceinline vint8(); + __forceinline vint8(const vint8 &a); + __forceinline explicit vint8(const __m256i &a); + + __forceinline operator const __m256i &() const; + __forceinline operator __m256i &(); + + __forceinline vint8 &operator=(const vint8 &a); +#else /* __KERNEL_AVX__ */ + int a, b, c, d, e, f, g, h; +#endif /* __KERNEL_AVX__ */ + +#ifndef __KERNEL_GPU__ + __forceinline int operator[](int i) const; + __forceinline int &operator[](int i); +#endif +}; + +ccl_device_inline vint8 make_vint8(int a, int b, int c, int d, int e, int f, int g, int h); +ccl_device_inline vint8 make_vint8(int i); +ccl_device_inline vint8 make_vint8(const vfloat8 f); +ccl_device_inline vint8 make_vint8(const int4 a, const int4 b); + +CCL_NAMESPACE_END |