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_AVX512F_MODE || BLAZE_MIC_MODE
80= delete;
81#elif BLAZE_AVX_MODE
82{
83 return _mm256_floor_ps((*a).eval().value);
84}
85#elif BLAZE_SSE4_MODE
86{
87 return _mm_floor_ps((*a).eval().value);
88}
89#else
90= delete;
91#endif
92//*************************************************************************************************
93
94
95
96
97//=================================================================================================
98//
99// 64-BIT FLOATING POINT SIMD TYPES
100//
101//=================================================================================================
102
103//*************************************************************************************************
113template< typename T > // Type of the operand
114BLAZE_ALWAYS_INLINE const SIMDdouble floor( const SIMDf64<T>& a ) noexcept
115#if BLAZE_SVML_MODE && ( BLAZE_AVX512F_MODE || BLAZE_MIC_MODE )
116{
117 return _mm512_floor_pd( (*a).eval().value );
118}
119#elif BLAZE_SLEEF_MODE && ( BLAZE_AVX512F_MODE || BLAZE_MIC_MODE )
120{
121 return Sleef_floord8( (*a).eval().value );
122}
123#elif BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
124= delete;
125#elif BLAZE_AVX_MODE
126{
127 return _mm256_floor_pd((*a).eval().value);
128}
129#elif BLAZE_SSE4_MODE
130{
131 return _mm_floor_pd((*a).eval().value);
132}
133#else
134= delete;
135#endif
136//*************************************************************************************************
137
138} // namespace blaze
139
140#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.
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.