[llvm-bugs] [Bug 47510] New: vcvtq_u32_f32 gives wrong results for out of range values on ARM

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Sep 13 09:03:59 PDT 2020


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

            Bug ID: 47510
           Summary: vcvtq_u32_f32 gives wrong results for out of range
                    values on ARM
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jmuizelaar at mozilla.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

int f() {
    float32x4_t k ={ 10e33, 0, 0, 0} ;
    return vgetq_lane_u32(vcvtq_u32_f32 (k), 0);
}

gives

define i32 @_Z1fv() local_unnamed_addr #0 {
  ret i32 undef
}

Instead, it should give INT_MAX.

on AARCH64 this is correctly compiled to:

define dso_local i32 @_Z1fv() local_unnamed_addr #0 {
  %1 = tail call <4 x i32> @llvm.aarch64.neon.fcvtzu.v4i32.v4f32(<4 x float>
<float 0x46FED09BE0000000, float 0.000000e+00, float 0.000000e+00, float
0.000000e+00>) #2
  %2 = extractelement <4 x i32> %1, i32 0
  ret i32 %2
}

-- 
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/20200913/e5ac3d70/attachment.html>


More information about the llvm-bugs mailing list