MRPT  1.9.9
SSE_types.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2019, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #pragma once
11 
12 #include <mrpt/config.h>
13 
14 // SSE2 types:
15 #if MRPT_HAS_SSE2
16 extern "C"
17 {
18 #include <emmintrin.h>
19 #include <mmintrin.h>
20 }
21 #endif
22 
23 // SSE3/SSSE3 types:
24 #if MRPT_HAS_SSE3
25 extern "C"
26 {
27 #include <pmmintrin.h>
28 #include <tmmintrin.h>
29 #if defined(__GNUC__)
30 #include <immintrin.h> // Meta-header
31 #endif
32 }
33 #endif
34 
35 // SSE4.1 types:
36 #if MRPT_HAS_SSE4_1
37 #if defined(__SSE4_2__) || defined(__SSE4_1__)
38 #include <smmintrin.h>
39 #endif
40 #endif
41 
42 // Helpers:
43 #if MRPT_HAS_SSE2
44 template <bool ALIGNED>
45 __m128i mm_load_si128(__m128i const* ptr);
46 
47 template <>
48 inline __m128i mm_load_si128<true>(__m128i const* ptr)
49 {
50  return _mm_load_si128(ptr);
51 }
52 
53 template <>
54 inline __m128i mm_load_si128<false>(__m128i const* ptr)
55 {
56  return _mm_loadu_si128(ptr);
57 }
58 
59 /** Use to check for 2^N multiples `is_multiple<16>(v)`, etc. */
60 template <int k, typename T>
61 bool is_multiple(const T val)
62 {
63  return (val & (k - 1)) == 0;
64 }
65 
66 #endif
__m128i mm_load_si128< true >(__m128i const *ptr)
Definition: SSE_types.h:48
int val
Definition: mrpt_jpeglib.h:957
__m128i mm_load_si128(__m128i const *ptr)
bool is_multiple(const T val)
Use to check for 2^N multiples is_multiple<16>(v), etc.
Definition: SSE_types.h:61
__m128i mm_load_si128< false >(__m128i const *ptr)
Definition: SSE_types.h:54



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 479715d5b Tue Nov 12 07:26:21 2019 +0100 at mar nov 12 07:30:12 CET 2019