summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove unnecessary assignment.Manuel Klimek2013-07-161-1/+0
| | | | llvm-svn: 186412
* Fixes another hard to test problem with iterator invalidation.Manuel Klimek2013-07-161-60/+69
| | | | | | | | | | As every match call can recursively call back into the memoized match via a nested traversal matcher (for example: stmt(hasAncestor(stmt(hasDescendant(stmt(hasDescendant(stmt()))))))), and every memoization step might clear the cache, we must not store iterators into the result cache when calling match on a submatcher. llvm-svn: 186411
* [ASan] Bump min supported Mac OS X version to 10.6 - makefile buildAlexey Samsonov2013-07-161-2/+2
| | | | llvm-svn: 186410
* [APFloat] PR16573: Avoid losing mantissa bits in ppc_fp128 to double truncationUlrich Weigand2013-07-162-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When truncating to a format with fewer mantissa bits, APFloat::convert will perform a right shift of the mantissa by the difference of the precision of the two formats. Usually, this will result in just the mantissa bits needed for the target format. One special situation is if the input number is denormal. In this case, the right shift may discard significant bits. This is usually not a problem, since truncating a denormal usually results in zero (underflow) after normalization anyway, since the result format's exponent range is usually smaller than the target format's. However, there is one case where the latter property does not hold: when truncating from ppc_fp128 to double. In particular, truncating a ppc_fp128 whose first double of the pair is denormal should result in just that first double, not zero. The current code however performs an excessive right shift, resulting in lost result bits. This is then caught in the APFloat::normalize call performed by APFloat::convert and causes an assertion failure. This patch checks for the scenario of truncating a denormal, and attempts to (possibly partially) replace the initial mantissa right shift by decrementing the exponent, if doing so will still result in a valid *target format* exponent. Index: test/CodeGen/PowerPC/pr16573.ll =================================================================== --- test/CodeGen/PowerPC/pr16573.ll (revision 0) +++ test/CodeGen/PowerPC/pr16573.ll (revision 0) @@ -0,0 +1,11 @@ +; RUN: llc < %s | FileCheck %s + +target triple = "powerpc64-unknown-linux-gnu" + +define double @test() { + %1 = fptrunc ppc_fp128 0xM818F2887B9295809800000000032D000 to double + ret double %1 +} + +; CHECK: .quad -9111018957755033591 + Index: lib/Support/APFloat.cpp =================================================================== --- lib/Support/APFloat.cpp (revision 185817) +++ lib/Support/APFloat.cpp (working copy) @@ -1956,6 +1956,23 @@ X86SpecialNan = true; } + // If this is a truncation of a denormal number, and the target semantics + // has larger exponent range than the source semantics (this can happen + // when truncating from PowerPC double-double to double format), the + // right shift could lose result mantissa bits. Adjust exponent instead + // of performing excessive shift. + if (shift < 0 && isFiniteNonZero()) { + int exponentChange = significandMSB() + 1 - fromSemantics.precision; + if (exponent + exponentChange < toSemantics.minExponent) + exponentChange = toSemantics.minExponent - exponent; + if (exponentChange < shift) + exponentChange = shift; + if (exponentChange < 0) { + shift -= exponentChange; + exponent += exponentChange; + } + } + // If this is a truncation, perform the shift before we narrow the storage. if (shift < 0 && (isFiniteNonZero() || category==fcNaN)) lostFraction = shiftRight(significandParts(), oldPartCount, -shift); llvm-svn: 186409
* [Sanitizer] move strcpy and strncpy to common interceptorsAlexey Samsonov2013-07-165-66/+59
| | | | llvm-svn: 186408
* [XCore] Fix printing of inline asm operands.Richard Osborne2013-07-162-11/+39
| | | | | | | Previously an asm operand with no operand modifier would give the error "invalid operand in inline asm". llvm-svn: 186407
* ARM: allow printing of ARM atomic DAG nodes.Tim Northover2013-07-161-0/+13
| | | | | | | | We'd forgotten to provide string representations for the special ARMISD atomic nodes; this adds them in. No effect on CodeGen, just makes the output of "-view-whatever-dags" slightly more readable. llvm-svn: 186406
* [SystemZ] Use ROSBG and non-zero form of RISBG for OR nodesRichard Sandiford2013-07-163-1/+289
| | | | llvm-svn: 186405
* [ASan] Bump min supported Mac OS X version to 10.6Alexey Samsonov2013-07-163-3/+6
| | | | llvm-svn: 186404
* Fixing a buildbot failure:unused function.Vladimir Medic2013-07-161-14/+0
| | | | llvm-svn: 186403
* clang-format: Improve detection of function types.Daniel Jasper2013-07-162-1/+5
| | | | | | | | | | This fixes an incorrect detection that led to a formatting error. Before: some_var = function (*some_pointer_var)[0]; After: some_var = function(*some_pointer_var)[0]; llvm-svn: 186402
* [SystemZ] Add MC support for R[NOX]SBGRichard Sandiford2013-07-164-0/+179
| | | | | | CodeGen support will come later. llvm-svn: 186401
* tsan: support sigsuspend() callDmitry Vyukov2013-07-164-0/+46
| | | | | | Intercepting it makes it process pending signal before return. llvm-svn: 186400
* [SystemZ] Use RISBG for (shift (and ...))Richard Sandiford2013-07-162-98/+321
| | | | | | | Another patch in the series to make more use of R.SBG. This one extends r186072 and r186073 to handle cases where the AND is inside the shift. llvm-svn: 186399
* Fix test on release builds.Tim Northover2013-07-161-2/+1
| | | | | | | | Unfortunately I don't think there's a good way to validate branch targets on release builds. Fortunately it's a minor part of this test (and based on generic code) so I don't mind dropping it. llvm-svn: 186398
* This patch represents Mips utilization of r186388 code that alows asm ↵Vladimir Medic2013-07-164-270/+242
| | | | | | matcher to emit mnemonics contain '.' characters. This makes asm parser code simpler and more efficient. llvm-svn: 186397
* PPCJITInfo.cpp: Tweak r186252 with s/__ppc/__powerpc/ to work on ↵NAKAMURA Takumi2013-07-161-2/+2
| | | | | | | | powerpc-linux Fedora 12. g++ (GCC) 4.4.4 20100630 (Red Hat 4.4.4-10) llvm-svn: 186396
* ARM: implement low-level intrinsics for the atomic exclusive operations.Tim Northover2013-07-169-21/+398
| | | | | | | | | | | | This adds three overloaded intrinsics to Clang: T __builtin_arm_ldrex(const volatile T *addr) int __builtin_arm_strex(T val, volatile T *addr) void __builtin_arm_clrex() The intent is that these do what users would expect when given most sensible types. Currently, "sensible" translates to ints, floats and pointers. llvm-svn: 186394
* [ASan] Use less shadow on Win 32-bitTimur Iskhodzhanov2013-07-164-19/+34
| | | | llvm-svn: 186393
* ARM: implement ldrex, strex and clrex intrinsicsTim Northover2013-07-168-53/+277
| | | | | | | Intrinsics already existed for the 64-bit variants, so these support operations of size at most 32-bits. llvm-svn: 186392
* ARM EABI divmod supportRenato Golin2013-07-164-2/+289
| | | | | | | | | | | | This patch enables calls to __aeabi_idivmod when in EABI mode, by using the remainder value returned on registers (R1), enabled by the ARM triple "none-eabi". Note that Darwin and GNUEABI triples will continue lowering on GNU style, that is, using the stack for the remainder. Still need to add SREM/UREM support fix for 64-bit lowering. llvm-svn: 186390
* [ASan] Cache the OSX version to avoid calling sysctl() on every ↵Alexander Potapenko2013-07-162-4/+20
| | | | | | GetMacosVersion() call. llvm-svn: 186389
* This patch allows targets to define weather the instruction mnemonics in asm ↵Vladimir Medic2013-07-162-4/+10
| | | | | | matcher tables will contain '.' character. llvm-svn: 186388
* llvm/test/Object/directory.ll: Mark it as XFAIL:cygwin. Directories can be ↵NAKAMURA Takumi2013-07-161-3/+3
| | | | | | opened on cygwin. llvm-svn: 186387
* [ASan] Add support for OS X Mavericks to GetMacosVersion.Alexander Potapenko2013-07-162-1/+3
| | | | llvm-svn: 186386
* Limit number of bits in size representation so that bit size fit 64 bits.Serge Pavlov2013-07-163-8/+14
| | | | | | This fixes PR8256 and some others. llvm-svn: 186385
* [PECOFF][Writer] Replace magic numbers with sizeof().Rui Ueyama2013-07-161-7/+13
| | | | | | | | | | | | This is a follow up patch for r186336. Reviewers: LegalizeAdulthood CC: silvas, llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1144 llvm-svn: 186384
* Add 'const' qualifiers to static const char* variables.Craig Topper2013-07-161-2/+2
| | | | llvm-svn: 186383
* [PECOFF][Writer] Use defined constants instead of magic numbers.Rui Ueyama2013-07-161-2/+4
| | | | llvm-svn: 186382
* Use open+fstat instead of stat+open.Rafael Espindola2013-07-161-3/+13
| | | | llvm-svn: 186381
* Remember that we have a null terminated string.Rafael Espindola2013-07-161-4/+4
| | | | | | | This is a micro optimization. Instead of going char*->StringRef->Twine->char*, go char*->Twine->char* and avoid having to copy the filename on the stack. llvm-svn: 186380
* [Object/COFF] Add import_directory_table_entry.Rui Ueyama2013-07-161-0/+8
| | | | | | | | | | | | Summary: Add import_directory_table_entry to use for .idata section. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1059 llvm-svn: 186379
* Add a version of sys::fs::status that uses fstat.Rafael Espindola2013-07-163-40/+71
| | | | llvm-svn: 186378
* COFF: Add constants for optional data directory.Rui Ueyama2013-07-161-0/+18
| | | | llvm-svn: 186377
* Instead friending status, provide windows and posix constructors to file_status.Rafael Espindola2013-07-163-44/+52
| | | | | | | This opens the way of having static helpers in the .inc files that can construct a file_status. llvm-svn: 186376
* unittests/Support: Add TimeValue.Win32FILETIME, corresponding to r186374.NAKAMURA Takumi2013-07-161-0/+16
| | | | llvm-svn: 186375
* Fix TimeValue::toWin32Time() to be symmetric to fromWin32Time() and ↵NAKAMURA Takumi2013-07-162-5/+3
| | | | | | | | | | compatible to Win32's FILETIME. llvm-ar is the only user of toWin32Time() (via setLastModificationAndAccessTime), and r186298 can be reverted. It had been buggy since the initial commit. FIXME: Could we rename {from|to}Win32Time as {from|to}Win32FILETIME in TimeValue? llvm-svn: 186374
* Merge attributes on typedef decls.Eli Friedman2013-07-162-0/+6
| | | | | | | | | Not completely sure this is right, but it's clearly better than what we did before this commit (effectively dropping the attribute). <rdar://problem/14413117> llvm-svn: 186373
* Rename Support.TimeValue to TimeValue.time_t in unittests/Support.NAKAMURA Takumi2013-07-162-3/+3
| | | | llvm-svn: 186372
* Add 'const' qualifiers to static const char* variables.Craig Topper2013-07-169-37/+38
| | | | llvm-svn: 186371
* Fix alignment of class derived from empty class.Eli Friedman2013-07-162-3/+45
| | | | | | | | | The record layout code didn't properly take into account that an empty class at offset 0 can have an alignment greater than 1. Patch by Andrea Di Biagio. llvm-svn: 186370
* ObjC migrator: build conforming interfaceFariborz Jahanian2013-07-163-1/+54
| | | | | | declaration (not yet used). wip. llvm-svn: 186369
* [PECOFF] Add default argument to addDir32NBReloc() as the default value 0 is ↵Rui Ueyama2013-07-161-4/+4
| | | | | | reasonable. llvm-svn: 186368
* Fix member refs with using decl + anonymous union.Eli Friedman2013-07-163-15/+31
| | | | | | | | | | Make sure we call BuildFieldReferenceExpr with the appropriate decl when a member of an anonymous union is made public with a using decl. Also, fix a crash on invalid field access into an anonymous union. Fixes PR16630. llvm-svn: 186367
* Revert "Don't pass llvm::errs() all over the place. Diagnostics always go to ↵Rafael Espindola2013-07-157-75/+98
| | | | | | | | stderr." This reverts commit 185657. It will be used by unit tests. llvm-svn: 186366
* Add mingw32 to the XFAIL. I forgot about it when adding win32.Rafael Espindola2013-07-151-1/+1
| | | | llvm-svn: 186365
* PEI: Support for non-zero SPAdj at beginning of a basic block.Manman Ren2013-07-153-15/+280
| | | | | | | | | | | | | | | | | | | | We can have a FrameSetup in one basic block and the matching FrameDestroy in a different basic block when we have struct byval. In that case, SPAdj is not zero at beginning of the basic block. Modify PEI to correctly set SPAdj at beginning of each basic block using DFS traversal. We used to assume SPAdj is 0 at beginning of each basic block. PEI had an assert SPAdjCount || SPAdj == 0. If we have a Destroy <n> followed by a Setup <m>, PEI will assert failure. We can add an extra condition to make sure the pairs are matched: The pairs start with a FrameSetup. But since we are doing a much better job in the verifier, this patch removes the check in PEI. PR16393 llvm-svn: 186364
* Fixed a problem in IRForTarget where we would notSean Callanan2013-07-154-2/+107
| | | | | | | | | | | delete a constant after we replaced it with a dynamically-computed value. Also ensured that we replace all users of the constant if there are multiple ones. Added a testcase. <rdar://problem/14379043> llvm-svn: 186363
* Disabling the introspecting summary for __NSCFSet (essentially, for CF*SetRef)Enrico Granata2013-07-151-2/+2
| | | | llvm-svn: 186362
* Remove unused RunLocker and related codeEd Maste2013-07-152-59/+0
| | | | | | | RunLocker was not used anywhere, and was the only instance of the WriteLocker class. Remove both. llvm-svn: 186361
OpenPOWER on IntegriCloud