rust/library/core
David Tolnay bd51dea693
Change twice used large const table to static
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.
2021-03-01 10:41:16 -08:00
..
benches Unify way to flip 6th bit. (Same assembly generated) 2021-02-08 12:21:36 +00:00
src Change twice used large const table to static 2021-03-01 10:41:16 -08:00
tests Rollup merge of #81167 - usbalbin:const_write, r=oli-obk 2021-02-25 14:33:51 +01:00
Cargo.toml mv std libs to library/ 2020-07-27 19:51:13 -05:00