All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Abs.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_INTRINSICS_ABS_H_
36 #define _BLAZE_MATH_INTRINSICS_ABS_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
44 #include <blaze/system/Inline.h>
46 
47 
48 namespace blaze {
49 
50 //=================================================================================================
51 //
52 // INTRINSIC ABSOLUTE VALUE FUNCTIONS
53 //
54 //=================================================================================================
55 
56 //*************************************************************************************************
64 #if BLAZE_AVX2_MODE
65 BLAZE_ALWAYS_INLINE sse_int8_t abs( const sse_int8_t& a )
66 {
67  return _mm256_abs_epi8( a.value );
68 }
69 #elif BLAZE_SSSE3_MODE
70 BLAZE_ALWAYS_INLINE sse_int8_t abs( const sse_int8_t& a )
71 {
72  return _mm_abs_epi8( a.value );
73 }
74 #endif
75 //*************************************************************************************************
76 
77 
78 //*************************************************************************************************
86 #if BLAZE_AVX2_MODE
87 BLAZE_ALWAYS_INLINE sse_int16_t abs( const sse_int16_t& a )
88 {
89  return _mm256_abs_epi16( a.value );
90 }
91 #elif BLAZE_SSSE3_MODE
92 BLAZE_ALWAYS_INLINE sse_int16_t abs( const sse_int16_t& a )
93 {
94  return _mm_abs_epi16( a.value );
95 }
96 #endif
97 //*************************************************************************************************
98 
99 
100 //*************************************************************************************************
108 #if BLAZE_AVX2_MODE
109 BLAZE_ALWAYS_INLINE sse_int32_t abs( const sse_int32_t& a )
110 {
111  return _mm256_abs_epi32( a.value );
112 }
113 #elif BLAZE_SSSE3_MODE
114 BLAZE_ALWAYS_INLINE sse_int32_t abs( const sse_int32_t& a )
115 {
116  return _mm_abs_epi32( a.value );
117 }
118 #endif
119 //*************************************************************************************************
120 
121 } // namespace blaze
122 
123 #endif
const DMatAbsExpr< MT, SO > abs(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the absolute values of each single element of dm.
Definition: DMatAbsExpr.h:909
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for the basic intrinsic types.
System settings for the SSE mode.
System settings for the inline keywords.