summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/builtins/Unit
Commit message (Collapse)AuthorAgeFilesLines
* Add a generic version of __divtc3.c for long double complex division.Joerg Sonnenberger2015-11-221-10/+1
| | | | | | Mark the unit test as applying to all platforms. llvm-svn: 253831
* Use cabsl for long double, not cabs.Joerg Sonnenberger2015-11-221-1/+1
| | | | llvm-svn: 253829
* [compiler-rt][aarch64] New tests for 128-bit floating-point builtins, fixes ↵Sergey Dmitrouk2015-11-0512-5/+279
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | of tests and __fixuint Summary: The following tests for 128-bit floating-point type behaved in a strange way, thought it were bugs, but seem to be mistakes in tests: * `fixtfsi` test checked for `0x80000001` as a value returned for number less than can be represented, while `LONG_MIN` should be returned on saturation; * `fixunstfdi` wasn't enabled for AArch64, only for PPC, but there is nothing PPC specific in that test; * `multf3` tried to underflow multiplication by producing result with 16383 exponent, while there are still 112 bits of fraction plus implicit bit, so resultant exponent should be 16497. Tests for some other builtins didn't exist: * `fixtfdi` * `fixtfti` * `fixunstfti` They were made by copying similar files and adjusting for wider types and adding/removing some reasonable/extra checks. Also `__fixuint` seems to have off by one error, updated tests to catch this case. Reviewers: rengolin, zatrazz, howard.hinnant, t.p.northover, jmolloy, enefaim Subscribers: aemerson, llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D14187 llvm-svn: 252180
* Implement __aeabi_c{d,f}{cmpeq,cmple,rcmple}.Josh Gao2015-08-216-0/+406
| | | | | | | | | | | | Summary: Implement more missing ARM EABI runtime functions. Reviewers: rengolin, compnerd Subscribers: pirama, srhines, danalbert, aemerson, llvm-commits Differential Revision: http://reviews.llvm.org/D12089 llvm-svn: 245648
* Implement __aeabi_{f,d}rsub.Dan Albert2015-08-182-0/+94
| | | | | | | | | | | | Summary: Implement the missing ARM EABI functions _aeabi_frsub and __aeabi_drsub. Reviewers: rengolin, compnerd Subscribers: pirama, srhines, danalbert, aemerson, llvm-commits Differential Revision: http://reviews.llvm.org/D12088 llvm-svn: 245321
* [compiler-rt] Add AArch64 to CMake configuration and several missing builtinsSergey Dmitrouk2015-08-183-2/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently CMake doesn't build builtins for AArch64 and if one does this anyway it's likely that at least `__multc3`, `__floatditf` and `__floatunditf` will be missing. There is actually more builtins to add, but these come from different libc implementations, thus providing them makes compiler-rt for AArch64 good enough at least for basic usage. Builtins implementation were originally taken from FreeBSD project: * [[ https://reviews.freebsd.org/D2173 | __multc3 ]] * [[ https://reviews.freebsd.org/D2174 | __floatditf and __floatunditf ]] Until they have been tested to find mistakes in `__float*` functions. `__floatditf` was based on `__floatsitf`, which had the same mistakes (fixed it in r243746). Version of the builtins in this patch are fixed and complemented with basic tests. Additionally they were tested via GCC's torture (this is what revealed these issues). P.S. Ed (author of FreeBSD patches) asked for feedback on the list some time ago (here [[ http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-March/084064.html | here ]]) and got no response, but it seems to be worth adding these builtins as is and extracting common part later. Reviewers: howard.hinnant, t.p.northover, jmolloy, enefaim, rengolin, zatrazz Subscribers: asl, emaste, samsonov, aemerson, llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D11679 llvm-svn: 245296
* Fix __floatsitf() for negative inputSergey Dmitrouk2015-07-311-0/+2
| | | | | | | | | Negative numbers were handled properly initially, but got broken during addressing review, so none of them did actually work. Issues: * Wrong negation. * Wrong exponent calculation. llvm-svn: 243746
* Fix incorrect truncation at the overflow boundaryPirama Arumuga Nainar2015-06-234-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [builtins] Hide long double fp_test.h helpers if it's not fp128.Ahmed Bougacha2015-06-121-0/+12
| | | | | | | | | Like we do for the various __*tf* tests, check that long double is the 128bit type we expect directly in the header. The latter is now used by unrelated tests (__*hf* since r237161), and those tests will break for no reason if uint128_t doesn't exist, and long double isn't fp128. llvm-svn: 239630
* [Builtins] Implement half-precision conversions.Ahmed Bougacha2015-05-124-0/+378
| | | | | | | | | | | | | | | | | Mostly uninteresting, except: - in __extendXfYf2, when checking if the number is normal, the old code relied on the unsignedness of src_rep_t, which is a problem when sizeof(src_rep_t) < sizeof(int): the result gets promoted to int, the signedness of which breaks the comparison. I added an explicit cast; it shouldn't affect other types. - we can't pass __fp16, so src_t and src_rep_t are the same. - the gnu_*_ieee symbols are simply duplicated definitions, as aliases are problematic on mach-o (where only weak aliases are supported; that's not what we want). Differential Revision: http://reviews.llvm.org/D9693 llvm-svn: 237161
* Add COMPILER_RT_ABI attribute to declarations of builtin functions in unittestsDerek Schuff2015-04-24131-133/+159
| | | | | | | | | | | | | | Summary: This makes their local declarations match their definitions for ARM targets, where they have a different calling convention. This really only affects functions that use floating point types (since the runtime functions use soft-float, and some targets may default to hard-float) but it seemed good to make it uniform and do the int-only ones too. Differential Revision: http://reviews.llvm.org/D9062 llvm-svn: 235722
* Refactor float to integer conversion to share the same code.Joerg Sonnenberger2015-03-112-0/+129
| | | | | | | | | | | | | 80bit Intel/PPC long double is excluded due to lacking support for the abstraction. Consistently provide saturation logic. Extend to long double on 128bit IEEE extended platforms. Initial patch with test cases from GuanHong Liu. Reviewed by Steve Canon. Differential Revision: http://reviews.llvm.org/D2804 llvm-svn: 231965
* Avoid warnings on !PowerPCJoerg Sonnenberger2015-03-081-1/+2
| | | | llvm-svn: 231609
* Don't produce warnings on !PowerPC.Joerg Sonnenberger2015-03-083-3/+6
| | | | llvm-svn: 231608
* tests: correct builtins test if built under -mthumb on ARMSaleem Abdulrasool2015-01-052-11/+28
| | | | | | | | | | | The clear_cache and enable_execute_stack tests attempt to memcpy the definition of a function into a buffer before executing the function. The problem with this approach is that on some targets (ARM with thumb mode compilation, MIPS with MIPS16 codegen or uMIPS), you would use a pointer which is incorrect (it would be off-by-one) due to the ISA selection being encoded into the address. This ensures that the function address is retrieved correctly in all cases. llvm-svn: 225215
* Implement floatsitf, floatunstfsi, which performJoerg Sonnenberger2014-09-162-0/+113
| | | | | | | | | | (signed/unsigned)integer to quad-precision conversion. Submitted by GuanHong Liu. Differential Revision: http://reviews.llvm.org/D2805 llvm-svn: 217901
* Provide mul for IEEE quad. From GuanHong Liu.Joerg Sonnenberger2014-06-191-0/+95
| | | | | | Differential Revision: http://reviews.llvm.org/D2799 llvm-svn: 211313
* Provide add and sub for IEEE quad. From GuanHong Liu.Joerg Sonnenberger2014-06-192-0/+155
| | | | | | Differential Revision: http://reviews.llvm.org/D2798 llvm-svn: 211312
* Implement __divtf3 for IEEE quad precision.Joerg Sonnenberger2014-05-301-0/+94
| | | | | | | Patch by: GuanHong Liu Differential Revision: http://reviews.llvm.org/D2800 llvm-svn: 209886
* Add __extenddftf2 and __extendsftf2 for IEEE quad precision.Joerg Sonnenberger2014-05-292-0/+165
| | | | | | | Patch by: GuanHong Liu Differential Revision: http://reviews.llvm.org/D2802 llvm-svn: 209783
* Implement __trunctfdf2 and __trunctfsf2 for IEEE quad precision.Joerg Sonnenberger2014-05-292-0/+151
| | | | | | | Patch by: GuanHong Liu Differential Revision: http://reviews.llvm.org/D2803 llvm-svn: 209782
* Add support for IEEE754 quad precision comparison functions.Joerg Sonnenberger2014-04-018-0/+822
| | | | | | | | From GuanHong Liu. Differential Revision: http://llvm-reviews.chandlerc.com/D2797 llvm-svn: 205312
* Use CRT_HAS_128BIT.Joerg Sonnenberger2014-03-1835-104/+104
| | | | llvm-svn: 204182
* Move tests for BlocksRuntime and builtins to corresponding directories under ↵Alexey Samsonov2014-02-14158-0/+166558
test/ llvm-svn: 201396
OpenPOWER on IntegriCloud