aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Support/MathExtras.h
Commit message (Collapse)AuthorAgeFilesLines
* Make isInt?? and isUint?? template specializations of the generic versions. ThisBenjamin Kramer2010-03-291-21/+29
| | | | | | | | makes calls a little bit more consistent and allows easy removal of the specializations in the future. Convert all callers to the templated functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99838 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct spelling.Duncan Sands2010-01-071-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92910 91177308-0d34-0410-b5e6-96231b3b80d8
* Move DataTypes.h to include/llvm/System, update all users. This breaks the lastChandler Carruth2009-10-261-1/+1
| | | | | | | direct inclusion edge from System to Support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85086 91177308-0d34-0410-b5e6-96231b3b80d8
* Add MathExtras.h OffsetToAlignment, like RoundUpToAlignment but returns theDaniel Dunbar2009-08-281-0/+7
| | | | | | offset to the next aligned integer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80339 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the N>=64 case in the isInt<> and isUint<> templates.Jakob Stoklund Olesen2009-08-131-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78899 91177308-0d34-0410-b5e6-96231b3b80d8
* Move immediate constant predicate templates from the Blackfin target to ↵Jakob Stoklund Olesen2009-08-121-0/+10
| | | | | | MathExtras.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78793 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR4614: the Intel C compiler defines _GNUC__Duncan Sands2009-07-231-2/+2
| | | | | | | but does not provide __builtin_bswap32/64. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76896 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the name of the function in this comment.Dan Gohman2009-05-311-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72666 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an int64_t variant of abs, for host environmentsDale Johannesen2009-05-131-0/+7
| | | | | | | | | | | | | without one. Use it where we were using abs on int64_t objects. (I strongly suspect the casts to unsigned in the fragments in LoopStrengthReduce are not doing whatever the original intent was, but the obvious change to uint64_t doesn't work. Maybe later.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71612 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed trailing whitespace.Misha Brukman2009-02-201-25/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65196 91177308-0d34-0410-b5e6-96231b3b80d8
* Add llvm::RoundUpToAlignment.Daniel Dunbar2009-02-161-0/+12
| | | | | | | - No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64691 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not use host floating point types when emittingDale Johannesen2009-01-211-2/+6
| | | | | | | | | | | ASCII IR; loading and storing these can change the bits of NaNs on some hosts. Remove or add warnings at a few other places using host floating point; this is a bad thing to do in general. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62712 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a NextPowerOf2 function to calculate the next power of two greater than ↵Owen Anderson2008-06-271-0/+12
| | | | | | a given integer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52839 91177308-0d34-0410-b5e6-96231b3b80d8
* Add count{Leading,Trailing}Ones_{32,64} functions with simple implementations.Dan Gohman2008-02-131-0/+32
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47084 91177308-0d34-0410-b5e6-96231b3b80d8
* make this 64-bit safeChris Lattner2008-01-261-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46402 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't attribute in file headers anymore. See llvmdev for theChris Lattner2007-12-291-2/+2
| | | | | | | | discussion of this change. Boy are my fingers tired. ;-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45411 91177308-0d34-0410-b5e6-96231b3b80d8
* Move MinAlign to MathExtras.h.Duncan Sands2007-11-091-0/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43944 91177308-0d34-0410-b5e6-96231b3b80d8
* remove extraneous type qualifiersChris Lattner2007-05-031-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36679 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed tabs everywhere except autogenerated & external files. Add makeAnton Korobeynikov2007-04-161-2/+2
| | | | | | | target for tabs checking. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36146 91177308-0d34-0410-b5e6-96231b3b80d8
* Be more explicit concerning argument sizes.Jeff Cohen2007-03-221-31/+41
| | | | | | | Use VC++ byteswap intrinsics. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35267 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak VC++ build.Jeff Cohen2007-03-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34917 91177308-0d34-0410-b5e6-96231b3b80d8
* fix 80 col violations, mark arrays staticChris Lattner2007-03-041-8/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34915 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix uninitialized use of variable. Remove tabs and fix identation.Anton Korobeynikov2007-03-021-19/+19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34850 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typo.Owen Anderson2007-03-021-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34836 91177308-0d34-0410-b5e6-96231b3b80d8
* Use GCC intrinsics when available, and use smarter fallbacks when not.Owen Anderson2007-03-011-2/+26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34812 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the GCC built-in for PopulationCount when it's available, and use a fasterOwen Anderson2007-03-011-11/+16
| | | | | | | | algorithm when it's not. This should be particularly noticeable in the 64-bit case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34776 91177308-0d34-0410-b5e6-96231b3b80d8
* Doxgenate comments.Chris Lattner2006-12-191-74/+84
| | | | | | | Add GreatestCommonDivisor64 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32661 91177308-0d34-0410-b5e6-96231b3b80d8
* Ignoring the upper 32 bits of a 64 bit constant is not a good thing.Jim Laskey2006-12-061-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32294 91177308-0d34-0410-b5e6-96231b3b80d8
* remove IncludeFile turds in MathExtras.h, which bloats every .o file thatChris Lattner2006-08-111-3/+0
| | | | | | | #includes it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29639 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR780:Reid Spencer2006-07-261-0/+4
| | | | | | | | | | | | | 1. Move IncludeFile.h to System library 2. Move IncludeFile.cpp to System library 3. #1 and #2 required to prevent cyclic library dependencies for libSystem 4. Convert all existing uses of Support/IncludeFile.h to System/IncludeFile.h 5. Add IncludeFile support to various lib/System classes. 6. Add new lib/System classes to LinkAllVMCore.h All this in an attempt to pull in lib/System to what's required for VMCore git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29287 91177308-0d34-0410-b5e6-96231b3b80d8
* Add functions to compute ceil(log2(N)) to match functions for floor(log2(N))Chris Lattner2006-07-181-1/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29168 91177308-0d34-0410-b5e6-96231b3b80d8
* Whoops, missed a couple more C-style casts.Reid Spencer2006-06-211-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28905 91177308-0d34-0410-b5e6-96231b3b80d8
* Use C++ style casts instead of C-style casts to shut up compiler warningsReid Spencer2006-06-211-6/+18
| | | | | | | when compiling with -pedantic. Passes regression tests on Linux. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28904 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR786:Reid Spencer2006-05-241-1/+1
| | | | | | | | | Minor tweaks in public headers and a few .cpp files so that LLVM can build successfully with -pedantic and projects using LLVM with -pedantic don't get warnings from LLVM. There's still more -pedantic warnings to fix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28453 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix generous source of VC++ truncation warnings.Jeff Cohen2006-01-141-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25311 91177308-0d34-0410-b5e6-96231b3b80d8
* Add bswap intrinsics as documented in the Language ReferenceNate Begeman2006-01-141-0/+26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25309 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove prolific source of VC++ truncation warnings.Jeff Cohen2005-10-071-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23657 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for count trailing zeroes, and population count. These areNate Begeman2005-08-311-5/+37
| | | | | | | needed for folding constants in the upcoming dag combiner. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23163 91177308-0d34-0410-b5e6-96231b3b80d8
* include/llvm/Support/MathExtras.hJim Laskey2005-08-171-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22846 91177308-0d34-0410-b5e6-96231b3b80d8
* Added support for converting raw bits to FP, and FP to raw bits. The intentJim Laskey2005-08-171-0/+44
| | | | | | | is to avoid the distraction of the union declarations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22830 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an obvious bug in the Log2 stuff that broke ↵Chris Lattner2005-08-031-1/+1
| | | | | | | | | SingleSource/UnitTests/2005-05-12-Int64ToFP last night. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22630 91177308-0d34-0410-b5e6-96231b3b80d8
* Wrap comments to 80 cols, fix code sequence for CountLeadingZeros_64 onChris Lattner2005-08-031-19/+20
| | | | | | | non-ppc GCC 4.0 machines. Patch by Jim Laskey! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22618 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix another bug in the clz patch that caused miscompilations when !gcc4Chris Lattner2005-08-031-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22616 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the non-gcc 4.0 paths for countleadingzerosChris Lattner2005-08-021-29/+35
| | | | | | | Patch fixed by Jim Laskey git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22598 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix inverted conditionalsChris Lattner2005-08-021-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22597 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the non-gcc 4.0 path to compileChris Lattner2005-08-021-5/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22593 91177308-0d34-0410-b5e6-96231b3b80d8
* Consolidate all of the various log2 computing functions into MathExtras.h.Chris Lattner2005-08-021-18/+131
| | | | | | | | Also, provide accelerated implementations when building with GCC. Patch contributed by Jim Laskey! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22591 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing whitespaceMisha Brukman2005-04-211-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21411 91177308-0d34-0410-b5e6-96231b3b80d8
* Changes For Bug 352Reid Spencer2004-09-011-4/+4
| | | | | | | | | Move include/Config and include/Support into include/llvm/Config, include/llvm/ADT and include/llvm/Support. From here on out, all LLVM public header files must be under include/llvm/. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an overloadChris Lattner2004-08-171-0/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15889 91177308-0d34-0410-b5e6-96231b3b80d8