summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/fp-contract-pragma.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [CodeGen] Use CreateFNeg in buildFMulAddCraig Topper2019-12-301-0/+15
| | | | | | We have an fneg instruction now and should use it instead of the fsub -0.0 idiom. Looks like we had no test that showed that we handled the negation cases here so I've added new tests. Differential Revision: https://reviews.llvm.org/D72010
* Revert "set the underlying value of “#pragma STDC FP_CONTRACT” on by ↵Renato Golin2016-09-231-15/+9
| | | | | | | | default" This reverts commit r282259, as it broke the AArch64 test-suite bots. llvm-svn: 282289
* set the underlying value of “#pragma STDC FP_CONTRACT” on by defaultSebastian Pop2016-09-231-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang has the default FP contraction setting of “-ffp-contract=on”, which doesn't really mean “on” in the conventional sense of the word, but rather really means “according to the per-statement effective value of the relevant pragma”. Before this patch, Clang has that pragma defaulting to “off”. Since the “-ffp-contract=on” mode is really an AND of two booleans and the second of them defaults to “off”, the whole thing effectively defaults to “off”. This patch changes the default value of the pragma to “on”, thus making the default pair of booleans (on, on) rather than (on, off). This makes FP optimization slightly more aggressive than before when not using either “-Ofast”, “-ffast-math”, or “-ffp-contract=fast”. Even with this patch the compiler still respects “-ffp-contract=off”. As per a suggestion by Steve Canon, the added code does _not_ require “-O3” or higher. This is so as to try our best to preserve identical floating-point results for unchanged source code compiling for an unchanged target when only changing from any optimization level in the set (“-O0”, “-O1”, “-O2”, “-O3”) to any other optimization level in that set. “-Os” and “-Oz” seem to be behaving identically, i.e. should probably be considered a part of the aforementioned set, but I have not reviewed this rigorously. “-Ofast” is explicitly _not_ a member of that set. Patch authored by Abe Skolnik [a.skolnik@samsung.com] and Stephen Canon [scanon@apple.com]. Differential Revision: https://reviews.llvm.org/D24481 llvm-svn: 282259
* generalize CHECK lines to make buildbot happySanjay Patel2015-12-031-2/+2
| | | | llvm-svn: 254576
* change an assert when generating fmuladd to an ordinary 'if' check (PR25719)Sanjay Patel2015-12-031-0/+12
| | | | | | | | | | | | | | | | | | | We don't want to generate fmuladd if there's a use of the fmul expression, but this shouldn't be an assert. The test case is derived from the commit message for r253337: http://reviews.llvm.org/rL253337 That commit reverted r253269: http://reviews.llvm.org/rL253269 ...but the bug exists independently of the default fp-contract setting. It just became easier to hit with that change. PR25719: https://llvm.org/bugs/show_bug.cgi?id=25719 Differential Revision: http://reviews.llvm.org/D15165 llvm-svn: 254573
* fix typos; NFCSanjay Patel2015-12-021-2/+2
| | | | llvm-svn: 254561
* Revert "Make FP_CONTRACT ON the default."Manuel Klimek2015-11-171-2/+0
| | | | | | | | | This reverts commit r253269. This leads to assert / segfault triggering on the following reduced example: float foo(float U, float base, float cell) { return (U = 2 * base) - cell; } llvm-svn: 253337
* Make FP_CONTRACT ON the default.Stephen Canon2015-11-161-0/+2
| | | | | | Differential Revision: D14200 llvm-svn: 253269
* Remove the -cxx-abi command-line flag.Hans Wennborg2014-01-141-1/+1
| | | | | | | | | | | | | | | This makes the C++ ABI depend entirely on the target: MS ABI for -win32 triples, Itanium otherwise. It's no longer possible to do weird combinations. To be able to run a test with a specific ABI without constraining it to a specific triple, new substitutions are added to lit: %itanium_abi_triple and %ms_abi_triple can be used to get the current target triple adjusted to the desired ABI. For example, if the test suite is running with the i686-pc-win32 target, %itanium_abi_triple will expand to i686-pc-mingw32. Differential Revision: http://llvm-reviews.chandlerc.com/D2545 llvm-svn: 199250
* Update tests in preparation for using the MS ABI for Win32 targetsHans Wennborg2014-01-131-1/+1
| | | | | | | | | | In preparation for making the Win32 triple imply MS ABI mode, make all tests pass in this mode, or make them use the Itanium mode explicitly. Differential Revision: http://llvm-reviews.chandlerc.com/D2401 llvm-svn: 199130
* When used in a compound expression FP_CONTRACT should proceed all explicitLang Hames2012-10-211-1/+0
| | | | | | | declarations and statements. Emit an error if the FP_CONTRACT is used later in a compound statement. llvm-svn: 166383
* Test file-scoped FP_CONTRACT pragma.Lang Hames2012-10-041-0/+17
| | | | llvm-svn: 165196
* Permanently end the whole "pragma got handled by the parser too early"Eli Friedman2012-10-041-0/+12
| | | | | | | mess by handling all pragmas which the parser touches uniformly. <rdar://problem/12248901>, etc. llvm-svn: 165195
* FP_CONTRACT: Fix two tests for -Asserts.NAKAMURA Takumi2012-10-021-7/+4
| | | | llvm-svn: 165024
* Add FP_CONTRACT support for clang.Lang Hames2012-10-021-0/+39
Clang will now honor the FP_CONTRACT pragma and emit LLVM fmuladd intrinsics for expressions of the form A * B + C (when they occur in a single statement). llvm-svn: 164989
OpenPOWER on IntegriCloud