[llvm-bugs] [Bug 46844] New: [AArch64] incorrect results from vcvt* functions with negative inputs when optimization is enabled

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jul 24 22:46:36 PDT 2020


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

            Bug ID: 46844
           Summary: [AArch64] incorrect results from vcvt* functions with
                    negative inputs when optimization is enabled
           Product: new-bugs
           Version: 10.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: clang at evan.coeusgroup.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

Several vcvt* functions return garbage instead of 0 when the input are < 0. 
Specifically:

 * vcvts_u32_f32
 * vcvtd_u64_f64
 * vcvt_u32_f32
 * vcvt_u64_f64
 * vcvtq_u32_f32
 * vcvtq_u64_f64

Here is a simple test case, compile without optimizations and the result is 0
(which is correct), but with -O1 or higher it is incorrect.

  #include <arm_neon.h>
  #include <stdio.h>
  #include <inttypes.h>

  uint32_t foo(float a) {
    return vgetq_lane_u32(vcvtq_u32_f32(vdupq_n_f32(a)), 0);
  }

  int main(void) {
    printf("%" PRIu32 "\n", foo(-3.14));

    return 0;
  }

-- 
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/20200725/aef3a831/attachment.html>


More information about the llvm-bugs mailing list