mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
remove num_is_zero in assembly
use high level
This commit is contained in:
parent
fe4e574cf9
commit
c9ec095741
8 changed files with 8 additions and 76 deletions
|
@ -186,8 +186,6 @@ pub trait Assembler<GeneralReg: RegTrait, FloatReg: RegTrait> {
|
|||
src2: GeneralReg,
|
||||
);
|
||||
|
||||
fn num_is_zero_reg64_reg64(buf: &mut Vec<'_, u8>, dst: GeneralReg, src: GeneralReg);
|
||||
|
||||
fn ret(buf: &mut Vec<'_, u8>);
|
||||
}
|
||||
|
||||
|
@ -502,6 +500,11 @@ impl<
|
|||
|
||||
// move return value to dst.
|
||||
match ret_layout {
|
||||
Layout::Builtin(Builtin::Int1) => {
|
||||
let dst_reg = self.claim_general_reg(dst)?;
|
||||
ASM::mov_reg64_reg64(&mut self.buf, dst_reg, CC::GENERAL_RETURN_REGS[0]);
|
||||
Ok(())
|
||||
}
|
||||
Layout::Builtin(Builtin::Int64) => {
|
||||
let dst_reg = self.claim_general_reg(dst)?;
|
||||
ASM::mov_reg64_reg64(&mut self.buf, dst_reg, CC::GENERAL_RETURN_REGS[0]);
|
||||
|
@ -896,22 +899,6 @@ impl<
|
|||
}
|
||||
}
|
||||
|
||||
fn build_num_is_zero(
|
||||
&mut self,
|
||||
dst: &Symbol,
|
||||
src: &Symbol,
|
||||
arg_layout: &Layout<'a>,
|
||||
) -> Result<(), String> {
|
||||
match arg_layout {
|
||||
Layout::Builtin(Builtin::Int1) => {
|
||||
let dst_reg = self.claim_general_reg(dst)?;
|
||||
let src_reg = self.load_to_general_reg(src)?;
|
||||
ASM::num_is_zero_reg64_reg64(&mut self.buf, dst_reg, src_reg);
|
||||
Ok(())
|
||||
}
|
||||
x => Err(format!("NumIsZero: layout, {:?}, not implemented yet", x)),
|
||||
}
|
||||
}
|
||||
fn create_struct(
|
||||
&mut self,
|
||||
sym: &Symbol,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue