linc 0.7
Linc is a general-purpose programming language inspired by C
Loading...
Searching...
No Matches
linc::EmitterAMD64 Class Referencefinal

Public Types

enum class  UnaryInstruction : unsigned char {
  Push , Pop , Call , Jump ,
  JumpIfZero , JumpIfNotZero , JumpIfEqual , JumpIfNotEqual ,
  JumpIfGreater , JumpIfLess , JumpIfGreaterEqual , JumpIfLessEqual ,
  Negate , Increment , Decrement , Not ,
  UnsignedMultiply , SignedMultiply , UnsignedDivide , SignedDivide ,
  SetIfEqual , SetIfNotEqual , SetIfGreater , SetIfGreaterEqual ,
  SetIfLess , SetIfLessEqual
}
 
enum class  NullaryInstruction : unsigned char {
  Syscall , Leave , Return , ConvertDoubleQuad ,
  ConvertQuadOctal
}
 
enum class  BinaryInstruction : unsigned char {
  Move , MoveExtend , MoveIfZero , And ,
  Or , Xor , Add , Subtract ,
  Multiply , Divide , Compare , Test ,
  ConvertFloatToInt , ConvertDoubleToInt , ConvertIntToFloat , ConvertIntToDouble ,
  ConvertFloatToDouble , ConvertDoubleToFloat , BitShiftLeft , BitShiftRight
}
 
enum class  InstructionKind : unsigned char { General , Float , Double }
 

Public Member Functions

const std::string & getDataSegment () const
 
const std::string & getCodeSegment () const
 
std::string get () const
 
std::size_t getStackPosition () const
 
std::string unaryAddress (std::string_view register_name, Registers::Size size)
 
std::string binaryAddress (std::string_view first_register, std::string_view second_register, Registers::Size size)
 
void reset ()
 
void emit (const std::string &line, bool has_indent=true)
 
void emitData (const std::string &line, bool has_indent=true)
 
std::string reserveLabel ()
 
std::string label (std::string_view name=std::string{})
 
std::string getLocalLabel (std::size_t label_identifier_index) const
 
std::string localLabel (std::size_t label_identifier_index)
 
std::string identifier (std::string_view data)
 
void push (std::string_view register_name)
 
void pop (std::string_view register_name)
 
void test (std::string_view register_name)
 
void external (std::string_view symbol_name)
 
void global (std::string_view symbol_name)
 
void prologue ()
 
void epilogue ()
 
std::string getStackOffset (std::size_t offset)
 
std::string defineStringLiteral (std::string_view contents, bool unique=false)
 
std::string defineNumeral (Types::u64 numeral, Registers::Size size)
 
void binary (BinaryInstruction instruction, std::string_view destination, std::string_view source, InstructionKind kind=InstructionKind::General)
 
void unary (UnaryInstruction instruction, std::string_view operand, InstructionKind kind=InstructionKind::General)
 
void nullary (NullaryInstruction instruction)
 

The documentation for this class was generated from the following file: