missing functions for dev backend for glue

This commit is contained in:
Folkert 2024-01-27 14:51:09 +01:00
parent e2dac4f022
commit 1e744dca7c
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
9 changed files with 113 additions and 17 deletions

View file

@ -2019,6 +2019,24 @@ trait Backend<'a> {
self.build_num_cmp(sym, &args[0], &args[1], &arg_layouts[0]);
}
LowLevel::NumToFloatCast => {
let float_width = match *ret_layout {
Layout::F64 => FloatWidth::F64,
Layout::F32 => FloatWidth::F32,
_ => unreachable!("invalid return layout for NumToFloatCast"),
};
match arg_layouts[0].try_to_int_width() {
Some(int_width) => {
self.build_int_to_float_cast(sym, &args[0], int_width, float_width);
}
None => {
//
todo!("other NumToFloatCast cases");
}
}
}
x => todo!("low level, {:?}", x),
}
}
@ -2135,6 +2153,14 @@ trait Backend<'a> {
target: IntWidth,
);
fn build_int_to_float_cast(
&mut self,
dst: &Symbol,
src: &Symbol,
int_width: IntWidth,
float_width: FloatWidth,
);
/// build_num_abs stores the absolute value of src into dst.
fn build_num_abs(&mut self, dst: &Symbol, src: &Symbol, layout: &InLayout<'a>);