#alias type declarations; core library additions; _global import name for the global scope

This commit is contained in:
gingerBill
2017-10-29 11:35:21 +00:00
parent 0ed34af19d
commit a43b89f36e
18 changed files with 367 additions and 49 deletions
+8 -2
View File
@@ -37,6 +37,13 @@ foreign __llvm_core {
cos :: proc(θ: f32) -> f32 #link_name "llvm.cos.f32" ---;
cos :: proc(θ: f64) -> f64 #link_name "llvm.cos.f64" ---;
// asin :: proc(x: f32) -> f32 #link_name "llvm.asin.f32" ---;
// asin :: proc(x: f64) -> f64 #link_name "llvm.asin.f64" ---;
// acos :: proc(x: f32) -> f32 #link_name "llvm.acos.f32" ---;
// acos :: proc(x: f64) -> f64 #link_name "llvm.acos.f64" ---;
pow :: proc(x, power: f32) -> f32 #link_name "llvm.pow.f32" ---;
pow :: proc(x, power: f64) -> f64 #link_name "llvm.pow.f64" ---;
@@ -47,9 +54,8 @@ foreign __llvm_core {
tan :: proc(θ: f32) -> f32 #inline do return sin(θ)/cos(θ);
tan :: proc(θ: f64) -> f64 #inline do return sin(θ)/cos(θ);
lerp :: proc(a, b: $T, t: $E) -> (x: T) do return a*(1-t) + b*t;
lerp :: proc(a, b, t: f32) -> (x: f32) do return a*(1-t) + b*t;
lerp :: proc(a, b, t: f64) -> (x: f64) do return a*(1-t) + b*t;
unlerp :: proc(a, b, x: f32) -> (t: f32) do return (x-a)/(b-a);
unlerp :: proc(a, b, x: f64) -> (t: f64) do return (x-a)/(b-a);