Add greater than comparison

This commit is contained in:
Ahmad Sattar 2023-01-18 20:21:57 +01:00
parent 3683e9d436
commit 6670a5d205
No known key found for this signature in database
GPG key ID: 6EAC5AB400A49604
5 changed files with 128 additions and 2 deletions

View file

@ -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,