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:
Folkert de Vries 2023-01-19 20:49:06 +01:00 committed by GitHub
commit 810e05cd9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 180 additions and 10 deletions

View file

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