dmd.backend.cod4

Code generation 4

Includes: - assignemt variations of operators (+= -= *= /= %= <<= >>=) - integer comparison (< > <= >=) - converting integers to a different size (e.g. short to int) - bit instructions (bit scan, population count)

Compiler implementation of the D programming language.

Mostly code generation for assignment operators.

Members

Functions

cdaddass
void cdaddass(CodeBuilder cdb, elem* e, regm_t* pretregs)

Generate code for += -= &= |= ^= negass

cdasm
void cdasm(CodeBuilder cdb, elem* e, regm_t* pretregs)

Generate code for an asm elem.

cdbscan
void cdbscan(CodeBuilder cdb, elem* e, regm_t* pretregs)

Generate code for OPbsf and OPbsr.

cdbt
void cdbt(CodeBuilder cdb, elem* e, regm_t* pretregs)

Generate code for OPbt, OPbtc, OPbtr, OPbts

cdbtst
void cdbtst(CodeBuilder cdb, elem* e, regm_t* pretregs)

Generate code for OPbtst

cdbyteint
void cdbyteint(CodeBuilder cdb, elem* e, regm_t* pretregs)

Convert byte to int. For OPu8_16 and OPs8_16.

cdcmp
void cdcmp(CodeBuilder cdb, elem* e, regm_t* pretregs)

Generate code for compares. Handles lt,gt,le,ge,eqeq,ne for all data types.

cdcmpxchg
void cdcmpxchg(CodeBuilder cdb, elem* e, regm_t* pretregs)

Generate code for OPcmpxchg

cdcnvt
void cdcnvt(CodeBuilder cdb, elem* e, regm_t* pretregs)

Do conversions. Depends on OPd_s32 and CLIB.dbllng being in sequence.

cddivass
void cddivass(CodeBuilder cdb, elem* e, regm_t* pretregs)

Generate code for /= %=

cdeq
void cdeq(CodeBuilder cdb, elem* e, regm_t* pretregs)

Generate code for an assignment.

cdfar16
void cdfar16(CodeBuilder cdb, elem* e, regm_t* pretregs)

Generate code for OPnp_f16p and OPf16p_np.

cdlngsht
void cdlngsht(CodeBuilder cdb, elem* e, regm_t* pretregs)

Convert long to short (OP32_16). Get offset of far pointer (OPoffset). Convert int to byte (OP16_8). Convert long long to long (OP64_32). OP128_64

cdmsw
void cdmsw(CodeBuilder cdb, elem* e, regm_t* pretregs)

Get top 32 bits of 64 bit value (I32) or top 16 bits of 32 bit value (I16) or top 64 bits of 128 bit value (I64). OPmsw

cdmulass
void cdmulass(CodeBuilder cdb, elem* e, regm_t* pretregs)

Generate code for *=

cdpair
void cdpair(CodeBuilder cdb, elem* e, regm_t* pretregs)

Generate code for OPpair, OPrpair.

cdpopcnt
void cdpopcnt(CodeBuilder cdb, elem* e, regm_t* pretregs)

OPpopcnt operator

cdport
void cdport(CodeBuilder cdb, elem* e, regm_t* pretregs)

Handle operators OPinp and OPoutp.

cdprefetch
void cdprefetch(CodeBuilder cdb, elem* e, regm_t* pretregs)

Generate code for OPprefetch

cdshass
void cdshass(CodeBuilder cdb, elem* e, regm_t* pretregs)

Generate code for <<= and >>=

cdshtlng
void cdshtlng(CodeBuilder cdb, elem* e, regm_t* pretregs)

Convert short to long. For OPs16_32, OPu16_32, OPnp_fp, OPu32_64, OPs32_64, OPu64_128, OPs64_128

doinreg
int doinreg(Symbol* s, elem* e)

Determine if expression e can be evaluated directly into register variable s. Have to be careful about things like x=x+x+x, and x=a+x.

longcmp
void longcmp(CodeBuilder cdb, elem* e, bool jcond, uint fltarg, code* targ)

Generate code for signed compare of longs. Input: targ block* or code*

modEA
void modEA(CodeBuilder cdb, code* c)

Return code for saving common subexpressions if EA turns out to be a register. This is called just before modifying an EA.

Meta