summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/builtins/fp_trunc_impl.inc
Commit message (Collapse)AuthorAgeFilesLines
* builtins: spell inline as __inlineSaleem Abdulrasool2015-10-101-1/+1
| | | | | | | | | __inline is a vendor specific spelling for inline. clang and gcc treat it the same as inline, and is available in MSVC 2013 which does not implement C99 (VS2015 supports the inline keyword though). This will allow us to build the builtins using MSVC. llvm-svn: 249953
* Fix incorrect truncation at the overflow boundaryPirama Arumuga Nainar2015-06-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch fixes incorrect truncation when the input wider value is exactly 2^dstBits. For that value, the overflow to infinity is not correctly handled. The fix is to replace a strict '>' with '>='. Currently, __truncdfsf2(340282366900000000000000000000000000000.0) returns infinity __truncdfsf2(340282366920938463463374607431768211456.0) returns 0 __truncdfsf2(400000000000000000000000000000000000000.0) returns infinity Likewise, __truncdfhf2 and __truncsfhf2 (and consequently gnu_f2h_ieee) are discontinuous at 65536.0. This patch adds tests for all three cases, along with adding a missing header include to fp_test.h. Reviewers: joerg, ab, srhines Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10594 llvm-svn: 240450
* Refactor truncdfsf2.Joerg Sonnenberger2014-05-291-0/+135
Patch by: GuanHong Liu Differential Revision: http://reviews.llvm.org/D3888 llvm-svn: 209779
OpenPOWER on IntegriCloud