[llvm-bugs] [Bug 27951] New: [AVX512] FP_TO_SINT truncating conversion intrinsics don't seem to round towards zero

via llvm-bugs llvm-bugs at lists.llvm.org
Tue May 31 11:10:09 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=27951

            Bug ID: 27951
           Summary: [AVX512] FP_TO_SINT truncating conversion intrinsics
                    don't seem to round towards zero
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: llvm-dev at redking.me.uk
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

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. ?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160531/913e7bff/attachment.html>


More information about the llvm-bugs mailing list