Blaze 3.9
Floor.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_SIMD_FLOOR_H_
36#define _BLAZE_MATH_SIMD_FLOOR_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#if BLAZE_SLEEF_MODE
44# include <sleef.h>
45#endif
47#include <blaze/system/Inline.h>
49
50
51namespace blaze {
52
53//=================================================================================================
54//
55// 32-BIT FLOATING POINT SIMD TYPES
56//
57//=================================================================================================
58
59//*************************************************************************************************
69template< typename T > // Type of the operand
70BLAZE_ALWAYS_INLINE const SIMDfloat floor( const SIMDf32<T>& a ) noexcept
71#if BLAZE_SVML_MODE && ( BLAZE_AVX512F_MODE || BLAZE_MIC_MODE )
72{
73 return _mm512_floor_ps( (*a).eval().value );
74}
75#elif BLAZE_SLEEF_MODE && ( BLAZE_AVX512F_MODE || BLAZE_MIC_MODE )
76{
77 return Sleef_floorf16( (*a).eval().value );
78}
79#elif BLAZE_XSIMD_MODE && ( BLAZE_AVX512F_MODE || BLAZE_MIC_MODE )
80{
81 return SIMDfloat{ xsimd::floor( xsimd::batch<float>{ (*a).eval().value } ).data };
82}
83#elif BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
84= delete;
85#elif BLAZE_AVX_MODE
86{
87 return _mm256_floor_ps((*a).eval().value);
88}
89#elif BLAZE_SSE4_MODE
90{
91 return _mm_floor_ps((*a).eval().value);
92}
93#else
94= delete;
95#endif
96//*************************************************************************************************
97
98
99
100
101//=================================================================================================
102//
103// 64-BIT FLOATING POINT SIMD TYPES
104//
105//=================================================================================================
106
107//*************************************************************************************************
117template< typename T > // Type of the operand
118BLAZE_ALWAYS_INLINE const SIMDdouble floor( const SIMDf64<T>& a ) noexcept
119#if BLAZE_SVML_MODE && ( BLAZE_AVX512F_MODE || BLAZE_MIC_MODE )
120{
121 return _mm512_floor_pd( (*a).eval().value );
122}
123#elif BLAZE_SLEEF_MODE && ( BLAZE_AVX512F_MODE || BLAZE_MIC_MODE )
124{
125 return Sleef_floord8( (*a).eval().value );
126}
127#elif BLAZE_XSIMD_MODE && ( BLAZE_AVX512F_MODE || BLAZE_MIC_MODE )
128{
129 return SIMDdouble{ xsimd::floor( xsimd::batch<double>{ (*a).eval().value } ).data };
130}
131#elif BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
132= delete;
133#elif BLAZE_AVX_MODE
134{
135 return _mm256_floor_pd((*a).eval().value);
136}
137#elif BLAZE_SSE4_MODE
138{
139 return _mm_floor_pd((*a).eval().value);
140}
141#else
142= delete;
143#endif
144//*************************************************************************************************
145
146} // namespace blaze
147
148#endif
Header file for the basic SIMD types.
SIMD type for 64-bit double precision floating point data values.
SIMD type for 32-bit single precision floating point data values.
MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition: DenseMatrix.h:182
BLAZE_ALWAYS_INLINE const SIMDdouble floor(const SIMDf64< T > &a) noexcept=delete
Computes the largest integer value not greater than the given value for a vector of double precision ...
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
System settings for the inline keywords.
System settings for the SSE mode.