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 
45 
46 
47 namespace blaze {
48 
49 //=================================================================================================
50 //
51 // INTRINSIC ABSOLUTE VALUE FUNCTIONS
52 //
53 //=================================================================================================
54 
55 //*************************************************************************************************
63 #if BLAZE_AVX2_MODE
64 inline sse_int8_t abs( const sse_int8_t& a )
65 {
66  return _mm256_abs_epi8( a.value );
67 }
68 #elif BLAZE_SSSE3_MODE
69 inline sse_int8_t abs( const sse_int8_t& a )
70 {
71  return _mm_abs_epi8( a.value );
72 }
73 #endif
74 //*************************************************************************************************
75 
76 
77 //*************************************************************************************************
85 #if BLAZE_AVX2_MODE
86 inline sse_int16_t abs( const sse_int16_t& a )
87 {
88  return _mm256_abs_epi16( a.value );
89 }
90 #elif BLAZE_SSSE3_MODE
91 inline sse_int16_t abs( const sse_int16_t& a )
92 {
93  return _mm_abs_epi16( a.value );
94 }
95 #endif
96 //*************************************************************************************************
97 
98 
99 //*************************************************************************************************
107 #if BLAZE_AVX2_MODE
108 inline sse_int32_t abs( const sse_int32_t& a )
109 {
110  return _mm256_abs_epi32( a.value );
111 }
112 #elif BLAZE_SSSE3_MODE
113 inline sse_int32_t abs( const sse_int32_t& a )
114 {
115  return _mm_abs_epi32( a.value );
116 }
117 #endif
118 //*************************************************************************************************
119 
120 } // namespace blaze
121 
122 #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:764
Header file for the basic intrinsic types.
System settings for the SSE mode.