1 //===-- jitcs_machine_x86_64.h - Machine info -------------------*- C++ -*-===//
3 //===----------------------------------------------------------------------===//
5 #ifndef _JITCS_MACHINE_X86_64_H_
6 #define _JITCS_MACHINE_X86_64_H_
8 #include "jitcs_adt_ref.h"
9 #include "jitcs_base.h"
10 #include "jitcs_dumper.h"
11 #include "jitcs_machine.h"
12 #include "jitcs_x86_64.h"
16 class CallingConvention
;
19 class X86_64MachineInfo
: public MachineInfo
{
21 enum ABIEnum
{ ABI_Win
, ABI_Posix
};
23 X86_64MachineInfo(ABIEnum
);
25 X86_64MachineInfo() = delete;
26 X86_64MachineInfo(const X86_64MachineInfo
&) = delete;
27 X86_64MachineInfo
& operator =(const X86_64MachineInfo
&) = delete;
29 //static std::string GetInsName(InsId id);
30 //static std::string GetRegName(RegId r);
31 //static std::string GetRegClassName(RegClassId r);
32 //static void dump(IDumper&, Ref<Instruction>, const Function&);
33 virtual std::shared_ptr
<const CallingConvention
>
34 getCC(FTSubType
, Slice
<FTTypeId
>, Slice
<FTTypeId
>);
36 class X86_64WinMachineInfo
: public X86_64MachineInfo
{
38 X86_64WinMachineInfo() : X86_64MachineInfo(ABI_Win
) {}
40 X86_64WinMachineInfo(const X86_64WinMachineInfo
&) = delete;
41 X86_64WinMachineInfo
& operator =(const X86_64WinMachineInfo
&) = delete;
43 class X86_64PosixMachineInfo
: public X86_64MachineInfo
{
45 X86_64PosixMachineInfo() : X86_64MachineInfo(ABI_Posix
) {}
47 X86_64PosixMachineInfo(const X86_64PosixMachineInfo
&) = delete;
48 X86_64PosixMachineInfo
& operator =(const X86_64PosixMachineInfo
&) = delete;
51 class X86_64MachineDumper
: public IMachineDumper
{
53 X86_64MachineDumper(std::unique_ptr
<IDumper
> &&);
55 X86_64MachineDumper() = delete;
56 X86_64MachineDumper(const X86_64MachineDumper
&) = delete;
57 X86_64MachineDumper
& operator =(const X86_64MachineDumper
&) = delete;
59 /*[[override]]*/ virtual void write(Ref
<Instruction
>);
60 /*[[override]]*/ virtual void write(Ref
<VirtualRegister
>);
63 } // end namespace jitcs
66 // _JITCS_MACHINE_X86_64_H_