This is an archive of the discontinued LLVM Phabricator instance.

Use MSVCRT functions for floating-point builtins unavailable on MSVC
ClosedPublic

Authored by angelsl on Oct 3 2015, 10:33 AM.

Details

Reviewers
compnerd

Diff Detail

Event Timeline

angelsl updated this revision to Diff 36435.Oct 3 2015, 10:33 AM
angelsl retitled this revision from to Use MSVCRT functions for floating-point builtins unavailable on MSVC.
angelsl updated this object.
angelsl added a reviewer: compnerd.
angelsl added subscribers: compnerd, llvm-commits.
compnerd edited edge metadata.Oct 4 2015, 11:17 AM

If Im not mistaken this will now need a larger number of function implementations to support -ffreestanding on Windows?

lib/builtins/int_math.h
28–32

Shouldn't this be:

#if defined(_MSC_VER) && !defined(__clang__)

and throughout.

51

I think this particular case should be:

#elif defined(__GNU__)

The __extension__ usage is a GNU extension, and __GNU__ will be defined on clang, so that should be more precise and should work without much effort.

Also, please add an

#else
#error "do not not how to check for infinity"
#endif
angelsl updated this revision to Diff 36479.Oct 4 2015, 11:44 PM
angelsl edited edge metadata.

Corrections made.

angelsl marked 2 inline comments as done.Oct 4 2015, 11:47 PM
compnerd accepted this revision.Oct 5 2015, 7:07 PM
compnerd edited edge metadata.
This revision is now accepted and ready to land.Oct 5 2015, 7:07 PM

SVN r249513.

compnerd closed this revision.Oct 6 2015, 8:01 PM