add x86_64 Int is zero support for gen_dev

This commit is contained in:
satotake 2021-11-21 10:29:55 +00:00 committed by GitHub
parent da2ba6c0f2
commit eec8ad7112
9 changed files with 73 additions and 1 deletions

View file

@ -450,6 +450,19 @@ where
);
self.build_num_lt(sym, &args[0], &args[1], &arg_layouts[0])
}
LowLevel::NumIsZero => {
debug_assert_eq!(
1,
args.len(),
"NumIsZero: expected to have exactly one argument"
);
debug_assert_eq!(
Layout::Builtin(Builtin::Int1),
*ret_layout,
"NumIsZero: expected to have return layout of type I1"
);
self.build_num_is_zero(sym, &args[0], ret_layout)
}
LowLevel::NumRound => self.build_fn_call(
sym,
bitcode::NUM_ROUND[FloatWidth::F64].to_string(),
@ -549,6 +562,14 @@ where
arg_layout: &Layout<'a>,
) -> Result<(), String>;
/// build_num_is_zero stores the result of `src == 0` into dst.
fn build_num_is_zero(
&mut self,
dst: &Symbol,
src: &Symbol,
arg_layout: &Layout<'a>,
) -> Result<(), String>;
/// literal_map gets the map from symbol to literal, used for lazy loading and literal folding.
fn literal_map(&mut self) -> &mut MutMap<Symbol, Literal<'a>>;