@@ -1914,6 +1914,32 @@ ESIMD_INLINE RT esimd_ceil(const float &src0, const uint flags = 0) {
1914
1914
return esimd_rndu<RT, 1U >(src0, flags);
1915
1915
}
1916
1916
1917
+ // / Round to integral value using the round to zero rounding mode (vector
1918
+ // / version).
1919
+ // / \tparam RT element type of the return vector.
1920
+ // / \tparam SZ size of the input and returned vectors.
1921
+ // / @param src0 the input vector.
1922
+ // / @param flag enables/disables the saturation (off by default). Possible
1923
+ // / values: saturation_on/saturation_off.
1924
+ // / @return vector of rounded values.
1925
+ template <typename RT, int SZ>
1926
+ ESIMD_NODEBUG ESIMD_INLINE simd<RT, SZ> esimd_trunc (const simd<float , SZ> &src0,
1927
+ const uint flag = 0 ) {
1928
+ return esimd_rndz<RT, SZ>(src0, flag);
1929
+ }
1930
+
1931
+ // / Round to integral value using the round to zero rounding mode (scalar
1932
+ // / version).
1933
+ // / \tparam RT type of the return value.
1934
+ // / @param src0 the input operand.
1935
+ // / @param flag enables/disables the saturation (off by default). Possible
1936
+ // / values: saturation_on/saturation_off.
1937
+ // / @return rounded value.
1938
+ template <typename RT>
1939
+ ESIMD_NODEBUG ESIMD_INLINE RT esimd_trunc (float src0, const uint flag = 0 ) {
1940
+ return esimd_rndz<RT, 1U >(src0, flag)[0 ];
1941
+ }
1942
+
1917
1943
/* esimd_atan2_fast - a fast atan2 implementation */
1918
1944
/* vector input */
1919
1945
template <int N>
0 commit comments