FARGOS/VISTA Object Management Environment Core  ..
FARGOS/VISTA Object Management Environment Core Table of Contents
assignVectorToZero.hpp
Go to the documentation of this file.
1 #ifndef _ASSIGN_VECTor-TO_ZERO_HPP_
2 #define _ASSIGN_VECTOR_TO_ZERO_HPP_ "$Id: assignVectorToZero.hpp 434 2020-07-21 18:19:20Z geoff $"
4 
7 #ifdef _WIN32
8 #include <intrin.h>
9 #else
10 #include <xmmintrin.h>
11 #endif
12 
17 // subgroup
21 /* implementations of assignToZero for common
22  * fundamental signed numeric types
23  */
24 
25 #ifndef _WIN32
26 // 4-elements of 32-bit integers
28 extern void assignToZero(__v4si &n) OME_ALWAYS_INLINE;
29 inline void assignToZero(__v4si &n) {
30  // zero out by doing xor against self
31 #pragma GCC diagnostic push
32 #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
33  n = (__v4si) _mm_xor_si128((__m128i) n, (__m128i) n); // NOTE: ignore warnings about being n uninitialized -- anything XORd with itself is 0
34 #pragma GCC diagnostic pop
35 }
36 #endif
37 
38 // 4-elements of 32-bit integers
40 extern void assignToZero(__m128i &n) OME_ALWAYS_INLINE;
41 inline void assignToZero(__m128i &n) {
42  // zero out by doing xor against self
43  n = _mm_xor_si128(n, n);
44 }
45 
49 #endif
50 /* vim: set expandtab shiftwidth=4 tabstop=4: */
assignToZero
void assignToZero(__v4si &n) OME_ALWAYS_INLINE
Assigns 0 to a 4-element vector of 32-bit integers.
Definition: assignVectorToZero.hpp:29
assignToZero.hpp
OME_ALWAYS_INLINE
#define OME_ALWAYS_INLINE
Tell the compiler to alway inline a function, regardless of optimization level.
Definition: compiler_hints.h:364
Generated: Tue Jul 28 2020 16:03:24
Support Information