[llvm-dev] '__builtin_nanl' and soft-FP64 support

Friedman, Eli via llvm-dev llvm-dev at lists.llvm.org
Mon Sep 25 10:46:56 PDT 2017


On 9/25/2017 5:35 AM, Martin J. O'Riordan via llvm-dev wrote:
>
> I am seeing failures in two tests after migrating to v5.0 final, these 
> are:
>
> std/language.support/support.limits/limits/numeric.limits.members/quiet_NaN.pass.cpp
>
> and:
>
> std/language.support/support.limits/limits/numeric.limits.members/signaling_NaN.pass.cpp
>
> However, these are new tests and it turns out that the underlying 
> problem is that the builtin ‘__builtin_nanl(“”)’ is returning the 
> value 0x0000000000000000.  I tested this builtin with our v4.0 
> compiler and it has the same problem, so this is not a regression but 
> rather an existing bug exposed by the new LibC++ implementation of 
> ‘<limits>’.
>
> But our implementation of FP64 is a software only implementation using 
> the FP64 support functions in ‘compiler-rt’ and we have no lowering 
> actions of our own.
>
> Where should I be looking to find out how to fix this?  Is it a CLang 
> issue of an LLVM issue?
>

__builtin_nanl("") gets constant-folded by clang; if you look at the 
LLVM IR, you should see something like "double 0x7FF8000000000000". 
Where exactly is 0x0000000000000000 showing up?

-Eli

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170925/1324d00f/attachment-0001.html>


More information about the llvm-dev mailing list