add x86_64 Int Num.neg support for gen_dev

This commit is contained in:
satotake 2021-11-16 15:21:44 +00:00 committed by GitHub
parent b03ed18553
commit 71bef85984
5 changed files with 59 additions and 1 deletions

View file

@ -368,6 +368,18 @@ where
);
self.build_num_mul(sym, &args[0], &args[1], ret_layout)
}
LowLevel::NumNeg => {
debug_assert_eq!(
1,
args.len(),
"NumNeg: expected to have exactly one argument"
);
debug_assert_eq!(
arg_layouts[0], *ret_layout,
"NumNeg: expected to have the same argument and return layout"
);
self.build_num_neg(sym, &args[0], ret_layout)
}
LowLevel::NumPowInt => self.build_fn_call(
sym,
bitcode::NUM_POW_INT[IntWidth::I64].to_string(),
@ -459,6 +471,14 @@ where
layout: &Layout<'a>,
) -> Result<(), String>;
/// build_num_neg stores the negated value of src into dst.
fn build_num_neg(
&mut self,
dst: &Symbol,
src: &Symbol,
layout: &Layout<'a>,
) -> Result<(), String>;
/// build_num_sub stores the `src1 - src2` difference into dst.
fn build_num_sub(
&mut self,