ported technotunnel

This commit is contained in:
2021-11-03 23:59:40 +01:00
parent 4793c4eb69
commit 387f389c28
4 changed files with 33 additions and 4 deletions

View File

@@ -546,6 +546,8 @@ fn builtin_function(name: &str, params: &[ast::Type]) -> Option<Instruction<'sta
let inst = match (name, params) {
("sqrt", &[F32]) => Instruction::F32Sqrt,
("abs", &[F32]) => Instruction::F32Abs,
("min", &[F32, F32]) => Instruction::F32Min,
("max", &[F32, F32]) => Instruction::F32Max,
_ => return None,
};
Some(inst)

View File

@@ -674,6 +674,8 @@ fn builtin_function_types(name: &str) -> Option<(&'static [ast::Type], Option<as
let types: (&'static [ast::Type], Option<ast::Type>) = match name {
"sqrt" => (&[F32], Some(F32)),
"abs" => (&[F32], Some(F32)),
"min" => (&[F32, F32], Some(F32)),
"max" => (&[F32, F32], Some(F32)),
_ => return None,
};
Some(types)