[AVX512] FP_TO_SINT truncating conversion intrinsics don't seem to round towards zero
| Bugzilla Link | 27951 |
| Resolution | INVALID |
| Resolved on | Jul 06, 2016 01:27 |
| Version | trunk |
| OS | Windows NT |
| CC | @delena,@hfinkel |
Extended Description
According to the intel documentation I can find the 'mm_cvtt**' truncation intrinsics should round towards zero, but the implementations in avx512fintrin.h appear to use the MXCSR.RC value:
e.g.
static inline int __DEFAULT_FN_ATTRS _mm_cvttsd_i32 (__m128d __A) { return (int) __builtin_ia32_vcvttsd2si32 ((__v2df) __A, _MM_FROUND_CUR_DIRECTION); }
shouldn't this be:
static inline int __DEFAULT_FN_ATTRS _mm_cvttsd_i32 (__m128d __A) { return (int) __builtin_ia32_vcvttsd2si32 ((__v2df) __A, _MM_FROUND_TO_ZERO); }
etc. ?
Close it - by the looks it we can't convert these to __builtin_convertvector or implicit truncation like the other _mm_cvtt* intrinsics.
Hi Simon,
Do you have any comments on this? I want to close the report.
the integer value here is not a rounding mode, it is SAE - suppress all exceptions. CVTT instruction "knows" how to round.