about summary refs log tree commit diff
path: root/src/etc/dec2flt_table.py
AgeCommit message (Collapse)AuthorLines
2023-06-16Apply changes to fix python linting errorsTrevor Gross-3/+1
2021-07-17Changed dec2flt to use the Eisel-Lemire algorithm.Alex Huszagh-115/+84
Implementation is based off fast-float-rust, with a few notable changes. - Some unsafe methods have been removed. - Safe methods with inherently unsafe functionality have been removed. - All unsafe functionality is documented and provably safe. - Extensive documentation has been added for simpler maintenance. - Inline annotations on internal routines has been removed. - Fixed Python errors in src/etc/test-float-parse/runtests.py. - Updated test-float-parse to be a library, to avoid missing rand dependency. - Added regression tests for #31109 and #31407 in core tests. - Added regression tests for #31109 and #31407 in ui tests. - Use the existing slice primitive to simplify shared dec2flt methods - Remove Miri ignores from dec2flt, due to faster parsing times. - resolves #85198 - resolves #85214 - resolves #85234 - fixes #31407 - fixes #31109 - fixes #53015 - resolves #68396 - closes https://github.com/aldanor/fast-float-rust/issues/15
2021-03-01Change twice used large const table to staticDavid Tolnay-1/+1
This table is used twice in core::num::dec2flt::algorithm::power_of_ten. According to the semantics of const, a separate huge definition of the table is inlined at both places. fn power_of_ten(e: i16) -> Fp { assert!(e >= table::MIN_E); let i = e - table::MIN_E; let sig = table::POWERS.0[i as usize]; let exp = table::POWERS.1[i as usize]; Fp { f: sig, e: exp } } Theoretically this gets cleaned up by optimization passes, but in practice I am experiencing a miscompile from LTO on this code. Making the table a static, which would only be defined a single time and not require attention from LTO, eliminates the miscompile and seems semantically more appropriate anyway. A separate bug report on the LTO bug is forthcoming.
2020-04-10Enforce Python 3 as much as possibleGuillaume Gomez-1/+1
2020-02-07remove unnecessary sys importChris Simpkins-1/+1
2019-11-29Make dec2flt_table compatible with rustfmtDavid Tolnay-5/+10
2018-12-25Remove licensesMark Rousskov-20/+0
2016-01-12Speed up dec2flt fast path with additional tables.Robin Kruppe-6/+29
Add tables of small powers of ten used in the fast path. The tables are redundant: We could also use the big, more accurate table and round the value to the correct type (in fact we did just that before this commit). However, the rounding is extra work and slows down the fast path. Because only very small exponents enter the fast path, the table and thus the space overhead is negligible. Speed-wise, this is a clear win on a [benchmark] comparing the fast path to a naive, hand-optimized, inaccurate algorithm. Specifically, this change narrows the gap from a roughly 5x difference to a roughly 3.4x difference. [benchmark]: https://gist.github.com/Veedrac/dbb0c07994bc7882098e
2015-08-08Script for generating the powers-of-ten tables necessary for correct andRobin Kruppe-0/+134
fast decimal-to-float conversions.