This a simple skeleton for a non recursive AML parser + interpreter.
For now it support very little stuff, only a couple of opcodes but that
is enough to load a very very simple AML table.
Co-authored-by: RatcheT2497 <[email protected]>
Note that the current implementation of lgamma doesn't work for negative
values of x. But given that Stirling's approximation is also only
defined for positive values of x, this patch don't change anything in
that regard.
On some platforms, like macOS on ARM, long double is a different type
but has the exact same characteristics as a normal double. When it is
the case, define FloatExtractor<long double> as an alias to
FloatExtractor<double>.
Max ULP Mean ULP
Before: inf 998274894113382.2500
After: 7352987.00 18.7027
While this is already a lot better, the error is still significant. This
is mainly due to the areas around the roots of lgamma(x) (x=1 and x=2)
where the results are close to zero and thus requires tiny absolute
errors. On (0, 0.7] ∪ [2.3, 8) the maximum error is 20 ULP.
This introduces a lot of polynomials, but I don't think we have another
choice here (CORE-MATH uses even more on the same interval). To find the
subdivisions, I simply searched for x so that a degree 12 polynomial
would have a small error (~1e-18) on [x, 8] and then repeated the
process until the full [0, 8] interval was filled.
This is done by using a polynomial to compensate the mathematical error
term of the stirling approximation.
Max ULP Mean ULP
Before: 6697252309907.00 725249701724.2207
After: 2.00 0.4674
This prevents the horrendous console spam when functions are resolved,
e.g. on the Royal Albert Hall website.
(cherry picked from commit 48366ddddf3e1231abf116fc38d9b56b3c259229)
This silences the following warning when building lagom with recent GCC
versions:
"error: writing 1 byte into a region of size 0
[-Werror=stringop-overflow=]"
It only seems to be reported when this function is inlined into
GIFLoader's usage of LzwDecompressor::get_output().
Will be used by an upcoming JS prototype
(cherry picked from commit 41e14e3fc3aab8417b8687df7e4242982e97ba23)
Co-authored-by: Jamie Mansfield <[email protected]>
The latest version of Clang got better at detecting unused templates. It
detected one truly unused template in our codebase. The rest are either
from templated functions that are not always used (depending on the
compile-time configuration) or from templated functions that are
incorrectly annotated with static.
Previously we inherited from a set of constructors, which casted
themselves to the final Variant type to initialize the wanted storage,
which is very UB.
Now we choose the best overload by checking for which Variant member <T>
we can call a function taking a <T>, while passing in a fully qualified
argument <U>, as passed into the Variant constructor, essentially
emulating the normal constructor lookup.
Also remove users of the old recursive version, which were mostly
redundantly checking the index again.
The remaining users have been renamed to be a bit more descriptive.
Takes asinf() from 432.0M/s to 717.6M/s in `./bench-float-exhaustive`.
Takes asin() from 108.0M/s to 189.4M/s in `./ak-math-bench`.
(For reference, libc++ at 259.1M/s for asinf,
and macOS system libm is at 225.6M/s for asin.)
No behavior change.
...and in a few cpp files too, and clean up missing includes.
Reduces number of files recompiled after touching AK/Math/Hyperbolic.h
from a couple thousand to a handful.
No behavior change.