'__builtin_nanl' and soft-FP64 support

I am seeing failures in two tests after migrating to v5.0 final, these are:




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 ‘’.

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

Thanks Eli,

Hadn’t thought of that. Yes, it us present in the IR emitted from CLang, so I’ll have to see if I find where it changes by dumping the IR between passes.

All the best,