mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
Merge pull request #4922 from thehabbos007/asa/numgt
gen_dev: fix signed/unsigned `less than` and add signed/unsigned `greater than`
This commit is contained in:
commit
810e05cd9a
5 changed files with 180 additions and 10 deletions
|
@ -600,6 +600,23 @@ trait Backend<'a> {
|
|||
);
|
||||
self.build_num_lt(sym, &args[0], &args[1], &arg_layouts[0])
|
||||
}
|
||||
LowLevel::NumGt => {
|
||||
debug_assert_eq!(
|
||||
2,
|
||||
args.len(),
|
||||
"NumGt: expected to have exactly two argument"
|
||||
);
|
||||
debug_assert_eq!(
|
||||
arg_layouts[0], arg_layouts[1],
|
||||
"NumGt: expected all arguments of to have the same layout"
|
||||
);
|
||||
debug_assert_eq!(
|
||||
Layout::BOOL,
|
||||
*ret_layout,
|
||||
"NumGt: expected to have return layout of type Bool"
|
||||
);
|
||||
self.build_num_gt(sym, &args[0], &args[1], &arg_layouts[0])
|
||||
}
|
||||
LowLevel::NumToFrac => {
|
||||
debug_assert_eq!(
|
||||
1,
|
||||
|
@ -862,6 +879,15 @@ trait Backend<'a> {
|
|||
arg_layout: &InLayout<'a>,
|
||||
);
|
||||
|
||||
/// build_num_gt stores the result of `src1 > src2` into dst.
|
||||
fn build_num_gt(
|
||||
&mut self,
|
||||
dst: &Symbol,
|
||||
src1: &Symbol,
|
||||
src2: &Symbol,
|
||||
arg_layout: &InLayout<'a>,
|
||||
);
|
||||
|
||||
/// build_num_to_frac convert Number to Frac
|
||||
fn build_num_to_frac(
|
||||
&mut self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue