mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
sign extension WIP
This commit is contained in:
parent
d10ae2412a
commit
10a497fdde
4 changed files with 40 additions and 1 deletions
|
@ -765,6 +765,17 @@ impl Assembler<AArch64GeneralReg, AArch64FloatReg> for AArch64Assembler {
|
|||
}
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn movsx_reg_reg(
|
||||
_buf: &mut Vec<'_, u8>,
|
||||
_input_width: RegisterWidth,
|
||||
_output_width: RegisterWidth,
|
||||
_dst: AArch64GeneralReg,
|
||||
_src: AArch64GeneralReg,
|
||||
) {
|
||||
todo!("move with sign extension");
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn mov_freg64_base32(_buf: &mut Vec<'_, u8>, _dst: AArch64FloatReg, _offset: i32) {
|
||||
todo!("loading floating point reg from base offset for AArch64");
|
||||
|
|
|
@ -288,6 +288,15 @@ pub trait Assembler<GeneralReg: RegTrait, FloatReg: RegTrait>: Sized + Copy {
|
|||
Self::mov_reg_reg(buf, RegisterWidth::W8, dst, src);
|
||||
}
|
||||
|
||||
// move with sign extension
|
||||
fn movsx_reg_reg(
|
||||
buf: &mut Vec<'_, u8>,
|
||||
input_width: RegisterWidth,
|
||||
output_width: RegisterWidth,
|
||||
dst: GeneralReg,
|
||||
src: GeneralReg,
|
||||
);
|
||||
|
||||
// base32 is similar to stack based instructions but they reference the base/frame pointer.
|
||||
fn mov_freg64_base32(buf: &mut Vec<'_, u8>, dst: FloatReg, offset: i32);
|
||||
|
||||
|
@ -2993,7 +3002,13 @@ impl<
|
|||
ASM::xor_reg64_reg64_reg64(buf, dst_reg, dst_reg, dst_reg);
|
||||
|
||||
// move the 8-bit integer
|
||||
ASM::mov_reg_reg(buf, RegisterWidth::W8, dst_reg, src_reg);
|
||||
ASM::movsx_reg_reg(
|
||||
buf,
|
||||
RegisterWidth::W8,
|
||||
RegisterWidth::W16,
|
||||
dst_reg,
|
||||
src_reg,
|
||||
);
|
||||
}
|
||||
// -- CASTING DOWN --
|
||||
(U64 | I64, I32 | U32) => {
|
||||
|
|
|
@ -1490,6 +1490,16 @@ impl Assembler<X86_64GeneralReg, X86_64FloatReg> for X86_64Assembler {
|
|||
) {
|
||||
mov_reg_reg(buf, register_width, dst, src);
|
||||
}
|
||||
#[inline(always)]
|
||||
fn movsx_reg_reg(
|
||||
buf: &mut Vec<'_, u8>,
|
||||
input_width: RegisterWidth,
|
||||
output_width: RegisterWidth,
|
||||
dst: X86_64GeneralReg,
|
||||
src: X86_64GeneralReg,
|
||||
) {
|
||||
raw_movsx_reg_reg(buf, input_width, output_width, dst, src);
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn mov_freg64_base32(buf: &mut Vec<'_, u8>, dst: X86_64FloatReg, offset: i32) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue