Dummy implementation that doesn't do what we want

This commit is contained in:
Joshua Hoeflich 2021-08-14 17:59:53 -05:00
parent b031eb0e54
commit ff2c3d7945
10 changed files with 79 additions and 2 deletions

View file

@ -4738,6 +4738,36 @@ fn run_low_level<'a, 'ctx, 'env>(
}
}
}
// TODO: Obviously, this is completely wrong! Fix me!
NumBytesToU16 => {
debug_assert_eq!(args.len(), 1);
let (arg, arg_layout) = load_symbol_and_layout(scope, &args[0]);
match arg_layout {
Layout::Builtin(arg_builtin) => {
use roc_mono::layout::Builtin::*;
match arg_builtin {
Usize | Int128 | Int64 | Int32 | Int16 | Int8 => {
build_int_unary_op(env, arg.into_int_value(), arg_builtin, op)
}
Float128 | Float64 | Float32 | Float16 => {
build_float_unary_op(env, arg.into_float_value(), op)
}
_ => {
unreachable!("Compiler bug: tried to run numeric operation {:?} on invalid builtin layout: ({:?})", op, arg_layout);
}
}
}
_ => {
unreachable!(
"Compiler bug: tried to run numeric operation {:?} on invalid layout: {:?}",
op, arg_layout
);
}
}
}
NumCompare => {
use inkwell::FloatPredicate;