Search
View source code
Display the source code in dmd/backend/cod2.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

# Module `dmd.backend.cod2`

Code generation 2

## Includes

- math operators (+ - * / %) and functions (abs, cos, sqrt) - 'string' functions (strlen, memcpy, memset) - pointers (address of / dereference) - struct assign, constructor, destructor

Compiler implementation of the D programming language.

## Coverage

https://codecov.io/gh/dlang/dmd/src/master/src/dmd/backend/cod2.d

## Functions

NameDescription
``` cdabs(cdb, e, pretregs) ``` Absolute value operator
``` cdbswap(cdb, e, pretregs) ``` Bswap operator
``` cdcom(cdb, e, pretregs) ``` Complement operator
``` cdcomma(cdb, e, pretregs) ``` Comma operator OPcomma
``` cdcond(cdb, e, pretregs) ``` ?: operator
``` cdctor(cdb, e, pretregs) ``` C++ constructor.
``` cddctor(cdb, e, pretregs) ``` D constructor. OPdctor
``` cdddtor(cdb, e, pretregs) ``` D destructor. OPddtor
``` cddiv(cdb, e, pretregs) ``` Handle divide, modulo and remquo. Note that modulo isn't defined for doubles.
``` cddtor(cdb, e, pretregs) ``` OPdtor
``` cdhalt(cdb, e, pretregs) ```
``` cdind(cdb, e, pretregs) ``` Perform a 'star' reference (indirection).
``` cdloglog(cdb, e, pretregs) ``` Do && and || operators.
``` cdmemcmp(cdb, e, pretregs) ``` Generate code for memcmp(s1,s2,n) intrinsic.
``` cdmemcpy(cdb, e, pretregs) ``` Generate code for memcpy(s1,s2,n) intrinsic. OPmemcpy / \ s1 OPparam / \ s2 n
``` cdmemset(cdb, e, pretregs) ``` Generate code for memset(s,value,numbytes) intrinsic. (s OPmemset (numbytes OPparam value))
``` cdmul(cdb, e, pretregs) ``` Handle multiply.
``` cdneg(cdb, e, pretregs) ``` OPneg, OPsqrt, OPsin, OPcos, OPrint
``` cdnot(cdb, e, pretregs) ``` Handle OPnot and OPbool.
``` cdorth(cdb, e, pretregs) ``` Handle operators which are more or less orthogonal ( + - & | ^ )
``` cdpost(cdb, e, pretregs) ``` Post increment and post decrement.
``` cdrelconst(cdb, e, pretregs) ``` Get the address of. Is also called by cdstreq() to set up pointer to a structure.
``` cdshift(cdb, e, pretregs) ``` Generate code for shift left or shift right (OPshl,OPshr,OPashr,OProl,OPror).
``` cdstrcmp(cdb, e, pretregs) ``` Generate code for strcmp(s1,s2) intrinsic.
``` cdstrcpy(cdb, e, pretregs) ``` Generate code for strcpy(s1,s2) intrinsic.
``` cdstreq(cdb, e, pretregs) ``` Do structure assignments. This should be fixed so that (s1 = s2) is rewritten to (&s1 = &s2). Mebbe call cdstreq() for double assignments???
``` cdstrlen(cdb, e, pretregs) ``` Generate code for intrinsic strlen().
``` cdvoid(cdb, e, pretregs) ```
``` getoffset(cdb, e, reg) ``` Load the offset portion of the address represented by e into reg.
``` idxregm(c) ``` Determine index registers used by addressing mode. Index is rm of modregrm field.
``` movOnly(e) ```
``` opdouble(cdb, e, pretregs, clib) ``` Gen code for call to floating point routine.