This is an archive of the discontinued LLVM Phabricator instance.

[COMPILER_RT] add long double setting in fp_lib.h
ClosedPublic

Authored by joerg on Feb 13 2014, 8:41 PM.

Details

Summary

Assume long double uses IEEE-754 128bit format

Diff Detail

Event Timeline

koviankevin updated this revision to Unknown Object (????).Feb 25 2014, 7:25 PM

introduce CRT_LDBL_128BIT

joerg commandeered this revision.Feb 26 2014, 1:05 PM
joerg updated this revision to Unknown Object (????).
joerg added a reviewer: koviankevin.

Correctly specify large constants using UINT64_C. Adjust slightly by making the masks more explicit. Bail out if the mantissa format is not the expected size. Undef macros after using them.

joerg added a comment.Feb 26 2014, 1:07 PM

Could you please check that this still works as expected?

koviankevin added inline comments.Feb 27 2014, 1:38 AM
lib/builtins/fp_lib.h
106 ↗(On Diff #7380)

What we need are the 2nd and 3rd word of sum1, so it should use Word_FullMask instead of Word_HiMask

127 ↗(On Diff #7380)

In our implmentation of functions implemented, we define #QUAD_PRECISION and include this file first , and then check whether CRT_LDBL_128BIT has been defined. So this line will make all targets whose LDBL_MANT_DIG is not 113 fail.

The line number of previous comment is wrong

lib/builtins/fp_lib.h
175 ↗(On Diff #7380)

What we need are the 2nd and 3rd word of sum1, so it should use Word_FullMask instead of Word_HiMask

196 ↗(On Diff #7380)

In our implmentation of functions implemented, we define #QUAD_PRECISION and include this file first , and then check whether CRT_LDBL_128BIT has been defined. So this line will make all targets whose LDBL_MANT_DIG is not 113 fail.

joerg updated this revision to Unknown Object (????).Feb 27 2014, 4:42 AM

Adjusted as discussed

koviankevin accepted this revision.Feb 27 2014, 5:02 AM
joerg closed this revision.Mar 28 2014, 3:36 AM

Closed by commit rL204999 (authored by @joerg).