mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
use existing base pointer constant
This commit is contained in:
parent
e7791443e6
commit
7546726866
3 changed files with 1 additions and 14 deletions
|
@ -458,11 +458,6 @@ impl CallConv<AArch64GeneralReg, AArch64FloatReg, AArch64Assembler> for AArch64C
|
|||
}
|
||||
|
||||
impl Assembler<AArch64GeneralReg, AArch64FloatReg> for AArch64Assembler {
|
||||
#[inline(always)]
|
||||
fn base_pointer() -> AArch64GeneralReg {
|
||||
AArch64GeneralReg::FP
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn abs_reg64_reg64(buf: &mut Vec<'_, u8>, dst: AArch64GeneralReg, src: AArch64GeneralReg) {
|
||||
cmp_reg64_imm12(buf, src, 0);
|
||||
|
|
|
@ -150,8 +150,6 @@ pub enum CompareOperation {
|
|||
/// Generally, I prefer explicit sources, as opposed to dst being one of the sources. Ex: `x = x + y` would be `add x, x, y` instead of `add x, y`.
|
||||
/// dst should always come before sources.
|
||||
pub trait Assembler<GeneralReg: RegTrait, FloatReg: RegTrait>: Sized + Copy {
|
||||
fn base_pointer() -> GeneralReg;
|
||||
|
||||
fn abs_reg64_reg64(buf: &mut Vec<'_, u8>, dst: GeneralReg, src: GeneralReg);
|
||||
fn abs_freg64_freg64(
|
||||
buf: &mut Vec<'_, u8>,
|
||||
|
@ -3001,8 +2999,7 @@ impl<
|
|||
);
|
||||
|
||||
// index into the table
|
||||
let base_pointer = ASM::base_pointer();
|
||||
ASM::add_reg64_reg64_reg64(&mut self.buf, dst_reg, dst_reg, base_pointer);
|
||||
ASM::add_reg64_reg64_reg64(&mut self.buf, dst_reg, dst_reg, CC::BASE_PTR_REG);
|
||||
|
||||
// load the 16-bit value at the pointer
|
||||
ASM::mov_reg16_mem16_offset32(&mut self.buf, dst_reg, dst_reg, table_offset);
|
||||
|
|
|
@ -1139,11 +1139,6 @@ where
|
|||
}
|
||||
|
||||
impl Assembler<X86_64GeneralReg, X86_64FloatReg> for X86_64Assembler {
|
||||
#[inline(always)]
|
||||
fn base_pointer() -> X86_64GeneralReg {
|
||||
X86_64GeneralReg::RBP
|
||||
}
|
||||
|
||||
// These functions should map to the raw assembly functions below.
|
||||
// In some cases, that means you can just directly call one of the direct assembly functions.
|
||||
#[inline(always)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue