Blender  V3.3
types_int4_impl.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright 2011-2022 Blender Foundation */
3 
4 #ifndef __UTIL_TYPES_INT4_IMPL_H__
5 #define __UTIL_TYPES_INT4_IMPL_H__
6 
7 #ifndef __UTIL_TYPES_H__
8 # error "Do not include this file directly, include util/types.h instead."
9 #endif
10 
11 #ifndef __KERNEL_GPU__
12 # include <cstdio>
13 #endif
14 
16 
17 #if !defined(__KERNEL_GPU__) || defined(__KERNEL_ONEAPI__)
18 # ifdef __KERNEL_SSE__
20 {
21 }
22 
23 __forceinline int4::int4(const int4 &a) : m128(a.m128)
24 {
25 }
26 
27 __forceinline int4::int4(const __m128i &a) : m128(a)
28 {
29 }
30 
31 __forceinline int4::operator const __m128i &() const
32 {
33  return m128;
34 }
35 
36 __forceinline int4::operator __m128i &()
37 {
38  return m128;
39 }
40 
42 {
43  m128 = a.m128;
44  return *this;
45 }
46 # endif /* __KERNEL_SSE__ */
47 
48 __forceinline int int4::operator[](int i) const
49 {
50  util_assert(i >= 0);
51  util_assert(i < 4);
52  return *(&x + i);
53 }
54 
56 {
57  util_assert(i >= 0);
58  util_assert(i < 4);
59  return *(&x + i);
60 }
61 
63 {
64 # ifdef __KERNEL_SSE__
65  int4 a(_mm_set1_epi32(i));
66 # else
67  int4 a = {i, i, i, i};
68 # endif
69  return a;
70 }
71 
72 ccl_device_inline int4 make_int4(int x, int y, int z, int w)
73 {
74 # ifdef __KERNEL_SSE__
75  int4 a(_mm_set_epi32(w, z, y, x));
76 # else
77  int4 a = {x, y, z, w};
78 # endif
79  return a;
80 }
81 
83 {
84 # ifdef __KERNEL_SSE__
85  int4 a(_mm_cvtps_epi32(f.m128));
86 # elif defined(__KERNEL_ONEAPI__)
87  int4 a = {(int)f.x, (int)f.y, (int)f.z, 0};
88 # else
89  int4 a = {(int)f.x, (int)f.y, (int)f.z, (int)f.w};
90 # endif
91  return a;
92 }
93 
95 {
96 # ifdef __KERNEL_SSE__
97  int4 a(_mm_cvtps_epi32(f.m128));
98 # else
99  int4 a = {(int)f.x, (int)f.y, (int)f.z, (int)f.w};
100 # endif
101  return a;
102 }
103 
104 ccl_device_inline void print_int4(const char *label, const int4 &a)
105 {
106  printf("%s: %d %d %d %d\n", label, a.x, a.y, a.z, a.w);
107 }
108 #endif /* !defined(__KERNEL_GPU__) || defined(__KERNEL_ONEAPI__) */
109 
111 
112 #endif /* __UTIL_TYPES_INT4_IMPL_H__ */
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble z
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
float float4[4]
btGeneric6DofConstraint & operator=(btGeneric6DofConstraint &other)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
int x
Definition: btConvexHull.h:149
const int & operator[](int i) const
Definition: btConvexHull.h:158
#define ccl_device_inline
Definition: cuda/compat.h:34
#define CCL_NAMESPACE_END
Definition: cuda/compat.h:9
#define util_assert(statement)
Definition: defines.h:94
const char * label
static unsigned a[3]
Definition: RandGen.cpp:78
#define __forceinline
float z
float y
float x
ccl_device_inline int4 make_int4(int i)
ccl_device_inline void print_int4(const char *label, const int4 &a)