summaryrefslogtreecommitdiff
path: root/src/support/bits.h
Commit message (Collapse)AuthorAgeFilesLines
* Modernize code to C++17 (#3104)Max Graey2021-11-221-6/+2
|
* Optimize comparisons with 0/1 in boolean context (#3240)Max Graey2020-10-181-2/+2
| | | | | | | | | | i32(bool(x)) != 0 ==> i32(bool(x)) i64(bool(x)) & 1 ==> i64(bool(x)) Also: * clean up related matching rules in optimizeWithConstantOnRight * add more explanations about isPowerOf2Float & rename to isPowerOfTwoInvertibleFloat
* Optimize power of two float divisions (#3018)Max Graey2020-10-131-0/+3
|
* Clean up support/bits.h (#3177)Thomas Lively2020-09-301-39/+43
| | | | | Use overloads instead of templates where applicable and change function names from PascalCase to camelCase. Also puts the functions in the Bits namespace to avoid naming conflicts.
* Implement more cases for getMaxBits (#2879)Max Graey2020-09-171-0/+6
| | | | | | | | | | | | | | | - Complete 64-bit cases in range `AddInt64` ... `ShrSInt64` - `ExtendSInt32` and `ExtendUInt32` for unary cases - For binary cases - `AddInt32` / `AddInt64` - `MulInt32` / `MulInt64` - `RemUInt32` / `RemUInt64` - `RemSInt32` / `RemSInt64` - `DivUInt32` / `DivUInt64` - `DivSInt32` / `DivSInt64` - and more Also more fast paths for some getMaxBits calculations
* Optimize bit count polyfills (#2914)Max Graey2020-06-171-5/+9
|
* Apply format changes from #2048 (#2059)Alon Zakai2019-04-261-16/+8
| | | Mass change to apply clang-format to everything. We are applying this in a PR by me so the (git) blame is all mine ;) but @aheejin did all the work to get clang-format set up and all the manual work to tidy up some things to make the output nicer in #2048
* standardize on 'template<' over 'template <' (i.e., remove a space) (#1782)Alon Zakai2018-11-291-6/+6
|
* More simple math opts (#1414)Alon Zakai2018-02-141-0/+7
| | | | | | | | * optimize more simple math operations: mul of 0, or of 0, and of 0, mul of 1, mul of a power of 2, urem of a power of 2 * fix asm2wasm callImport parsing: the optimizer may get rid of the added offset to a function table * update js builds
* Fix Visual Studio 2015 C++ warning about negating unsigned value by adding ↵BSalita2016-05-111-4/+4
| | | | typename U in bits.h (#471)
* add Log2 and Pow2 support methodsAlon Zakai2016-03-161-0/+2
|
* Move rol/ror to src/support/bits.hDerek Schuff2016-03-091-0/+15
|
* De-inline signed wrapper templates for bit manipulation functionsDerek Schuff2016-02-031-3/+3
| | | | This fixes the clang build.
* Move bits.h to support/JF Bastien2016-02-031-0/+70
Faster compiles.