compiler: move LLVM math builtin support into the compiler

This simplifies src/runtime/math.go, which I eventually want to remove
entirely by moving the given functionality into the compiler.
This commit is contained in:
Ayke van Laethem
2021-08-06 15:49:02 +02:00
committed by Ron Evans
parent ca7c849da3
commit 58565b42cc
7 changed files with 138 additions and 37 deletions
+14
View File
@@ -0,0 +1,14 @@
package main
// Test how intrinsics are lowered: either as regular calls to the math
// functions or as LLVM builtins (such as llvm.sqrt.f64).
import "math"
func mySqrt(x float64) float64 {
return math.Sqrt(x)
}
func myTrunc(x float64) float64 {
return math.Trunc(x)
}