mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Add greater than
comparison
This commit is contained in:
parent
3683e9d436
commit
6670a5d205
5 changed files with 128 additions and 2 deletions
|
@ -584,6 +584,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,
|
||||
|
@ -837,6 +854,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