dmd.backend.cgen

Generate code instructions

Members

Functions

addtofixlist
size_t addtofixlist(Symbol* s, targ_size_t offset, int seg, targ_size_t val, int flags)

Add to the fix list.

cat
code* cat(code* c1, code* c2)

Concatenate two code lists together. Return pointer to result.

cgen_prelinnum
void cgen_prelinnum(code** pc, Srcpos srcpos)

Prepend line number to existing code.

code_last
code* code_last(code* c)

Find last code in list.

code_orflag
void code_orflag(code* c, uint flag)

Set flag bits on last code in list.

code_orrex
void code_orrex(code* c, uint rex)

Set rex bits on last code in list.

gen
code* gen(code* c, code* cs)

Add code to end of linked list. Note that unused operands are garbage. gen1() and gen2() are shortcut routines. Input: c -> linked list that code is to be added to end of cs -> data for the code

genadjfpu
code* genadjfpu(code* c, int offset)

Generate 'instruction' which tells the scheduler that the fpu stack has changed.

genc
code* genc(code* c, opcode_t op, uint ea, uint FL1, targ_size_t EV1, uint FL2, targ_size_t EV2)

Generate code.

gencodelem
void gencodelem(CodeBuilder cdb, elem* e, regm_t* pretregs, bool constflag)

Clean stack after call to codelem().

genlinnum
code* genlinnum(code* c, Srcpos srcpos)

Generate 'instruction' which is actually a line number.

gennop
code* gennop(code* c)

Generate 'nop'

outfixlist
void outfixlist()

End of module. Output fixups as references to external Symbols.

reghasvalue
bool reghasvalue(regm_t regm, targ_size_t value, reg_t* preg)

Determine if one of the registers in regm has value in it. If so, return !=0 and set *preg to which register it is.

regwithvalue
void regwithvalue(CodeBuilder cdb, regm_t regm, targ_size_t value, reg_t* preg, regm_t flags)

Load a register from the mask regm with value. Output: *preg the register selected

Structs

Fixup
struct Fixup

When we don't know whether a function symbol is defined or not within this module, we stuff it in an array of references to be fixed up later.

Meta

Suggestion Box / Bug Report