summaryrefslogtreecommitdiff
path: root/yjit/src/backend/x86_64/mod.rs
blob: 257373e86f666d5e6bd891612965724ec97cc94a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#![allow(dead_code)]
#![allow(unused_variables)]
#![allow(unused_imports)]

use crate::asm::{CodeBlock};
use crate::asm::x86_64::*;
use crate::backend::ir::*;

// Use the x86 register type for this platform
pub type Reg = X86Reg;

// Callee-saved registers
pub const CFP: Opnd = Opnd::Reg(R13_REG);
pub const EC: Opnd = Opnd::Reg(R12_REG);
pub const SP: Opnd = Opnd::Reg(RBX_REG);

impl Assembler
{
    // Get the list of registers from which we can allocate on this platform
    pub fn get_scrach_regs() -> Vec<Reg>
    {
        vec![
            RAX_REG,
            RCX_REG,
        ]
    }

    // Emit platform-specific machine code
    pub fn target_emit(&self, cb: &mut CodeBlock)
    {



        for insn in &self.insns {


            // For each instruction, either handle it here or allow the map_insn
            // callback to handle it.
            match insn.op {
                Op::Comment => {
                },
                Op::Label => {
                },
                _ => {
                }
            };


        }




    }
}