40 lines
799 B
C
40 lines
799 B
C
#include<stdio.h>
|
|
#include<stdlib.h>
|
|
#include"gen.h"
|
|
#include"x86_64.h"
|
|
#include"i386.h"
|
|
#include"state.h"
|
|
|
|
LangDef gen_x86_64_langdef(void)
|
|
{
|
|
LangDef ld={
|
|
.acc_32="eax",
|
|
.acc_wordsize="rax",
|
|
.add_32="addl",
|
|
.add_wordsize="addq",
|
|
.bp="rbp",
|
|
.cmp_32="cmpl",
|
|
.cmp_wordsize="cmpq",
|
|
.div_32="idivl",
|
|
.div_wordsize="idivq",
|
|
.lea_wordsize="leaq",
|
|
.mov_32="movl",
|
|
.mov_wordsize="movq",
|
|
.mul_32="imull",
|
|
.mul_wordsize="imulq",
|
|
.pop_wordsize="popq",
|
|
.push_wordsize="pushq",
|
|
.registers_abi_32={"edi","esi","edx","ecx","r8d","r9d"},
|
|
.registers_abi_wordsize={"rdi","rsi","rdx","rcx","r8","r9"},
|
|
.scratch1_32="r8d",
|
|
.scratch1_wordsize="r8",
|
|
.sp="rsp",
|
|
.sub_32="subl",
|
|
.sub_wordsize="subq",
|
|
.wordsize=8,
|
|
.xor_32="xorl",
|
|
.xor_wordsize="xorq",
|
|
};
|
|
return ld;
|
|
}
|