dmd.backend.cod2

Compiler implementation of the D programming language.

Members

Functions

cdabs
void cdabs(ref CodeBuilder cdb, elem* e, regm_t* pretregs)

Absolute value operator

cdbswap
void cdbswap(ref CodeBuilder cdb, elem* e, regm_t* pretregs)

Bswap operator

cdcom
void cdcom(ref CodeBuilder cdb, elem* e, regm_t* pretregs)

Complement operator

cdcomma
void cdcomma(ref CodeBuilder cdb, elem* e, regm_t* pretregs)

Comma operator OPcomma

cdcond
void cdcond(ref CodeBuilder cdb, elem* e, regm_t* pretregs)

?: operator

cdctor
void cdctor(ref CodeBuilder cdb, elem* e, regm_t* pretregs)

C++ constructor.

cddctor
void cddctor(ref CodeBuilder cdb, elem* e, regm_t* pretregs)

D constructor.

cdddtor
void cdddtor(ref CodeBuilder cdb, elem* e, regm_t* pretregs)

D destructor.

cdhalt
void cdhalt(ref CodeBuilder cdb, elem* e, regm_t* pretregs)
cdind
void cdind(ref CodeBuilder cdb, elem* e, regm_t* pretregs)

Perform a 'star' reference (indirection).

cdloglog
void cdloglog(ref CodeBuilder cdb, elem* e, regm_t* pretregs)

Do && and || operators. Generate: (evaluate e1 and e2, if true goto cnop1) cnop3: NOP cg: [save reg code] ;if we must preserve reg CLR reg ;false result (set Z also) JMP cnop2

cdmemcmp
void cdmemcmp(ref CodeBuilder cdb, elem* e, regm_t* pretregs)

Generate code for memcmp(s1,s2,n) intrinsic.

cdmemcpy
void cdmemcpy(ref CodeBuilder cdb, elem* e, regm_t* pretregs)

Generate code for memcpy(s1,s2,n) intrinsic. OPmemcpy / \ s1 OPparam / \ s2 n

cdmemset
void cdmemset(ref CodeBuilder cdb, elem* e, regm_t* pretregs)

Generate code for memset(s,val,n) intrinsic. (s OPmemset (n OPparam val))

cdmul
void cdmul(ref CodeBuilder cdb, elem* e, regm_t* pretregs)

Handle multiply, divide, modulo and remquo. Note that modulo isn't defined for doubles.

cdneg
void cdneg(ref CodeBuilder cdb, elem* e, regm_t* pretregs)

OPneg, OPsqrt, OPsin, OPcos, OPrint

cdnot
void cdnot(ref CodeBuilder cdb, elem* e, regm_t* pretregs)

Handle OPnot and OPbool. Generate: c: [evaluate e1] cfalse: [save reg code] clr reg jmp cnop ctrue: [save reg code] clr reg inc reg cnop: nop

cdorth
void cdorth(ref CodeBuilder cdb, elem* e, regm_t* pretregs)

Handle operators which are more or less orthogonal ( + - & | ^ )

cdpost
void cdpost(ref CodeBuilder cdb, elem* e, regm_t* pretregs)

Post increment and post decrement.

cdrelconst
void cdrelconst(ref CodeBuilder cdb, elem* e, regm_t* pretregs)

Get the address of. Is also called by cdstreq() to set up pointer to a structure.

cdshift
void cdshift(ref CodeBuilder cdb, elem* e, regm_t* pretregs)

Generate code for shift left or shift right (OPshl,OPshr,OPashr,OProl,OPror).

cdstrcmp
void cdstrcmp(ref CodeBuilder cdb, elem* e, regm_t* pretregs)

Generate code for strcmp(s1,s2) intrinsic.

cdstrcpy
void cdstrcpy(ref CodeBuilder cdb, elem* e, regm_t* pretregs)

Generate code for strcpy(s1,s2) intrinsic.

cdstreq
void cdstreq(ref CodeBuilder cdb, elem* e, regm_t* pretregs)

Do structure assignments. This should be fixed so that (s1 = s2) is rewritten to (&s1 = &s2). Mebbe call cdstreq() for double assignments???

cdstrlen
void cdstrlen(ref CodeBuilder cdb, elem* e, regm_t* pretregs)

Generate code for intrinsic strlen().

cdvoid
void cdvoid(ref CodeBuilder cdb, elem* e, regm_t* pretregs)
getoffset
void getoffset(ref CodeBuilder cdb, elem* e, reg_t reg)

Load the offset portion of the address represented by e into reg.

idxregm
regm_t idxregm(const code* c)

Determine index registers used by addressing mode. Index is rm of modregrm field.

movOnly
bool movOnly(const elem* e)
opdouble
void opdouble(ref CodeBuilder cdb, elem* e, regm_t* pretregs, uint clib)

Gen code for call to floating point routine.

Meta