diff options
author | Ayke van Laethem <[email protected]> | 2022-08-28 19:08:07 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2022-08-30 17:33:16 +0200 |
commit | 9e8739bb47d70f633962976458955cb8a5ce615c (patch) | |
tree | d368104b4a2887216aa264fdd33afa4404bd94db /testdata/reflect.go | |
parent | 20a7a6fd54d4ffb1fa7e37cfd85246300e372e21 (diff) | |
download | tinygo-9e8739bb47d70f633962976458955cb8a5ce615c.tar.gz tinygo-9e8739bb47d70f633962976458955cb8a5ce615c.zip |
compiler: replace math aliases with intrinsics
This is really a few more-or-less separate changes:
* Remove all math aliases that were used in Go 1.16 and below (the
math.[A-Z] aliases).
* Replace math aliases with an assembly implementation (the math.arch*
aliases) with a LLVM intrinsic, where one is available.
* Include missing math functions in picolibc build.
This leaves just four math aliases:
* math.archHypot and math.archModf do not have a LLVM builtin
equivalent. They could be replaced with calls to libm, and I think
that would be a good idea in the long term.
* math.archMax and math.archMin do have a LLVM builtin equivalent
(llvm.maximum.f64, llvm.minimum.f64), but unfortunately they crash
when used. Apparently these exact operations are not yet widely
supported in hardware and they don't have a libm equivalent either.
There are more LLVM builtins that we could use for the math package
(such as FMA), but I will leave that to a future change. It could
potentially speed up some math operations.
Diffstat (limited to 'testdata/reflect.go')
0 files changed, 0 insertions, 0 deletions