mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-02 19:32:17 +00:00
split out int and frac division into separate lowlevels
This commit is contained in:
parent
2151891ecd
commit
2d366acc6e
6 changed files with 30 additions and 31 deletions
|
@ -442,19 +442,19 @@ trait Backend<'a> {
|
|||
);
|
||||
self.build_num_mul(sym, &args[0], &args[1], ret_layout)
|
||||
}
|
||||
LowLevel::NumDivUnchecked => {
|
||||
LowLevel::NumDivTruncUnchecked | LowLevel::NumDivFrac => {
|
||||
debug_assert_eq!(
|
||||
2,
|
||||
args.len(),
|
||||
"NumMul: expected to have exactly two argument"
|
||||
"NumDiv: expected to have exactly two argument"
|
||||
);
|
||||
debug_assert_eq!(
|
||||
arg_layouts[0], arg_layouts[1],
|
||||
"NumMul: expected all arguments of to have the same layout"
|
||||
"NumDiv: expected all arguments of to have the same layout"
|
||||
);
|
||||
debug_assert_eq!(
|
||||
arg_layouts[0], *ret_layout,
|
||||
"NumMul: expected to have the same argument and return layout"
|
||||
"NumDiv: expected to have the same argument and return layout"
|
||||
);
|
||||
self.build_num_div(sym, &args[0], &args[1], ret_layout)
|
||||
}
|
||||
|
@ -694,13 +694,6 @@ trait Backend<'a> {
|
|||
self.load_literal_symbols(args);
|
||||
self.build_fn_call(sym, fn_name, args, arg_layouts, ret_layout)
|
||||
}
|
||||
Symbol::NUM_DIV_TRUNC | Symbol::NUM_DIV_FRAC => self.build_run_low_level(
|
||||
sym,
|
||||
&LowLevel::NumDivUnchecked,
|
||||
args,
|
||||
arg_layouts,
|
||||
ret_layout,
|
||||
),
|
||||
_ => todo!("the function, {:?}", func_sym),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue