Blender  V2.93
util_types_float8.h
Go to the documentation of this file.
1 /*
2  * Original code Copyright 2017, Intel Corporation
3  * Modifications Copyright 2018, Blender Foundation.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of Intel Corporation nor the names of its contributors
14  * may be used to endorse or promote products derived from this software
15  * without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef __UTIL_TYPES_FLOAT8_H__
30 #define __UTIL_TYPES_FLOAT8_H__
31 
32 #ifndef __UTIL_TYPES_H__
33 # error "Do not include this file directly, include util_types.h instead."
34 #endif
35 
37 
38 #ifndef __KERNEL_GPU__
39 
40 struct ccl_try_align(32) float8
41 {
42 # ifdef __KERNEL_AVX2__
43  union {
44  __m256 m256;
45  struct {
46  float a, b, c, d, e, f, g, h;
47  };
48  };
49 
50  __forceinline float8();
51  __forceinline float8(const float8 &a);
52  __forceinline explicit float8(const __m256 &a);
53 
54  __forceinline operator const __m256 &() const;
55  __forceinline operator __m256 &();
56 
57  __forceinline float8 &operator=(const float8 &a);
58 
59 # else /* __KERNEL_AVX2__ */
60  float a, b, c, d, e, f, g, h;
61 # endif /* __KERNEL_AVX2__ */
62 
63  __forceinline float operator[](int i) const;
64  __forceinline float &operator[](int i);
65 };
66 
67 ccl_device_inline float8 make_float8(float f);
68 ccl_device_inline float8
69 make_float8(float a, float b, float c, float d, float e, float f, float g, float h);
70 #endif /* __KERNEL_GPU__ */
71 
73 
74 #endif /* __UTIL_TYPES_FLOAT8_H__ */
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
btGeneric6DofConstraint & operator=(btGeneric6DofConstraint &other)
SIMD_FORCE_INLINE btVector3 & operator[](int i)
Get a mutable reference to a row of the matrix as a vector.
Definition: btMatrix3x3.h:157
#define ccl_device_inline
#define CCL_NAMESPACE_END
static unsigned c
Definition: RandGen.cpp:97
static unsigned a[3]
Definition: RandGen.cpp:92
#define __forceinline
Definition: util_defines.h:71
ccl_device_inline float8 make_float8(float f)
CCL_NAMESPACE_BEGIN struct ccl_try_align(32) float8