Blender
V5.3
intern
cycles
util
types_int8.h
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
2
*
3
* SPDX-License-Identifier: Apache-2.0 */
4
5
#pragma once
6
7
#include "
util/types_base.h
"
8
#include "
util/types_int4.h
"
9
10
CCL_NAMESPACE_BEGIN
11
12
struct
vfloat8;
13
14
#ifdef __KERNEL_GPU__
15
struct
vint8
16
#
else
17
struct
ccl_try_align
(32) vint8
18
#endif
19
{
20
#ifdef __KERNEL_AVX__
21
union
{
22
__m256i m256;
23
struct
{
24
int
a,
b
, c, d, e, f, g, h;
25
};
26
};
27
28
__forceinline
vint8() =
default
;
29
__forceinline
vint8(
const
vint8 &a) =
default
;
30
__forceinline
explicit
vint8(
const
__m256i &a) : m256(a) {}
31
32
__forceinline
operator
const
__m256i &()
const
33
{
34
return
m256;
35
}
36
__forceinline
operator
__m256i &()
37
{
38
return
m256;
39
}
40
41
__forceinline
vint8 &
operator=
(
const
vint8 &a)
42
{
43
m256 = a.m256;
44
return
*
this
;
45
}
46
#else
/* __KERNEL_AVX__ */
47
int
a,
b
, c, d,
e
, f, g, h;
48
#endif
/* __KERNEL_AVX__ */
49
50
#ifndef __KERNEL_GPU__
51
__forceinline
int
operator[]
(
int
i)
const
52
{
53
util_assert
(i >= 0);
54
util_assert
(i < 8);
55
return
*(&a + i);
56
}
57
__forceinline
int
&
operator[]
(
int
i)
58
{
59
util_assert
(i >= 0);
60
util_assert
(i < 8);
61
return
*(&a + i);
62
}
63
#endif
64
};
65
66
ccl_device_inline
vint8
67
make_vint8
(
const
int
a,
const
int
b
,
int
c,
const
int
d,
int
e,
const
int
f,
int
g,
const
int
h)
68
{
69
#ifdef __KERNEL_AVX__
70
return
vint8(_mm256_set_epi32(h, g, f, e, d, c,
b
, a));
71
#else
72
return
{a,
b
, c, d, e, f, g, h};
73
#endif
74
}
75
76
ccl_device_inline
vint8
make_vint8
(
const
int
i)
77
{
78
#ifdef __KERNEL_AVX__
79
return
vint8(_mm256_set1_epi32(i));
80
#else
81
return
make_vint8
(i, i, i, i, i, i, i, i);
82
#endif
83
}
84
85
ccl_device_inline
vint8
make_vint8
(
const
int4
a,
const
int4
b
)
86
{
87
#ifdef __KERNEL_AVX__
88
return
vint8(_mm256_insertf128_si256(_mm256_castsi128_si256(a.m128),
b
.m128, 1));
89
#else
90
return
make_vint8
(a.
x
, a.
y
, a.
z
, a.
w
,
b
.x,
b
.y,
b
.z,
b
.w);
91
#endif
92
}
93
94
CCL_NAMESPACE_END
operator=
btGeneric6DofConstraint & operator=(btGeneric6DofConstraint &other)
Definition
btGeneric6DofConstraint.h:314
operator[]
SIMD_FORCE_INLINE btVector3 & operator[](int i)
Get a mutable reference to a row of the matrix as a vector.
Definition
btMatrix3x3.h:157
b
b
Definition
compositor_morphological_distance_infos.hh:36
util_assert
#define util_assert(statement)
ccl_device_inline
#define ccl_device_inline
ccl_try_align
#define ccl_try_align(...)
__forceinline
#define __forceinline
CCL_NAMESPACE_END
#define CCL_NAMESPACE_END
Definition
device/cuda/compat.h:10
else
else
Definition
kernel/device/gpu/kernel.h:105
CCL_NAMESPACE_BEGIN
Definition
python.cpp:41
blender::e
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
Definition
bmesh_query_inline.hh:44
int4
Definition
int_vector_types.h:109
int4::x
int x
Definition
int_vector_types.h:110
int4::w
int w
Definition
int_vector_types.h:113
int4::y
int y
Definition
int_vector_types.h:111
int4::z
int z
Definition
int_vector_types.h:112
types_base.h
make_vint8
ccl_device_inline vint8 make_vint8(const vfloat8 f)
Definition
types_float8.h:124
types_int4.h
Generated on
for Blender by
doxygen
1.18.0