MRPT  2.0.4
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-2020, 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_ARCH_INTEL_COMPATIBLE
16 extern "C"
17 {
18 #include <emmintrin.h>
19 #include <mmintrin.h>
20 }
21 #endif
22 
23 // SSE3/SSSE3 types:
24 #if MRPT_ARCH_INTEL_COMPATIBLE
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 defined(__SSE4_2__) || defined(__SSE4_1__)
37 #include <smmintrin.h>
38 #endif
39 
40 // Helpers:
41 #if MRPT_ARCH_INTEL_COMPATIBLE
42 template <bool ALIGNED>
43 __m128i mm_load_si128(__m128i const* ptr);
44 
45 template <>
46 inline __m128i mm_load_si128<true>(__m128i const* ptr)
47 {
48  return _mm_load_si128(ptr);
49 }
50 
51 template <>
52 inline __m128i mm_load_si128<false>(__m128i const* ptr)
53 {
54  return _mm_loadu_si128(ptr);
55 }
56 
57 /** Use to check for 2^N multiples `is_multiple<16>(v)`, etc. */
58 template <int k, typename T>
59 bool is_multiple(const T val)
60 {
61  return (val & (k - 1)) == 0;
62 }
63 
64 #endif
int val
Definition: mrpt_jpeglib.h:957



Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020