Skip to content

Commit

Permalink
WIP backend IR sketch
Browse files Browse the repository at this point in the history
  • Loading branch information
maximecb authored and noahgibbs committed Aug 25, 2022
1 parent f5f81bb commit 21de32e
Show file tree
Hide file tree
Showing 3 changed files with 492 additions and 12 deletions.
24 changes: 12 additions & 12 deletions yjit/src/asm/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ mod tests;
pub struct X86Imm
{
// Size in bits
num_bits: u8,
pub num_bits: u8,

// The value of the immediate
value: i64
pub value: i64
}

#[derive(Clone, Copy, Debug)]
pub struct X86UImm
{
// Size in bits
num_bits: u8,
pub num_bits: u8,

// The value of the immediate
value: u64
pub value: u64
}

#[derive(Clone, Copy, Debug, Eq, PartialEq)]
Expand All @@ -38,32 +38,32 @@ pub enum RegType
pub struct X86Reg
{
// Size in bits
num_bits: u8,
pub num_bits: u8,

// Register type
reg_type: RegType,
pub reg_type: RegType,

// Register index number
reg_no: u8,
pub reg_no: u8,
}

#[derive(Clone, Copy, Debug)]
pub struct X86Mem
{
// Size in bits
num_bits: u8,
pub num_bits: u8,

/// Base register number
base_reg_no: u8,
pub base_reg_no: u8,

/// Index register number
idx_reg_no: Option<u8>,
pub idx_reg_no: Option<u8>,

/// SIB scale exponent value (power of two, two bits)
scale_exp: u8,
pub scale_exp: u8,

/// Constant displacement from the base, not scaled
disp: i32,
pub disp: i32,
}

#[derive(Clone, Copy, Debug)]
Expand Down
Loading

0 comments on commit 21de32e

Please sign in to comment.