Extra information about each CLIB runtime library function.
Determine index if we can do two LEA instructions as a multiply.
tyf: type of the function
Build an EA of the form dispbase[index*scale]. Input: c struct to fill in base base register (-1 if none) index index register (-1 if none) scale scale factor - 1,2,4,8 disp displacement
Build REX, modregrm and sib bytes
Generate code sequence to call C runtime library support routine. clib = CLIB.xxxx keepmask = mask of registers not to destroy. Currently can handle only 1. Should use a temporary rather than push/pop for speed.
Generate code sequence for function call.
Generate code for which isscaledindex(e) returned a non-zero result.
Given the result of an expression is in retregs, generate necessary code to return result in *pretregs.
Given an opcode and EA in cs, generate code for each floating register in turn. Input: tym either TYdouble or TYfloat
Generate code for eecontext
Gen a save/restore sequence for mask of registers.
Clean parameters off stack. Input: numpara amount to adjust stack pointer keepmsk mask of registers to not destroy
Get addressing mode.
Compute addressing mode. Generate & return sequence of code (if any). Return in cs the info on it. Input: pcs -> where to store data about addressing mode e -> the lvalue elem keepmsk mask of registers we must not destroy or use if (keepmsk & RMstore), this will be only a store operation into the lvalue if (keepmsk & RMload), this will be a read operation only
Determine if e is a 32 bit scaled index addressing mode.
Generate code to load data into registers.
Routine to aid in setting things up for gen(). Look for common subexpression. Can handle indirection operators, but not if they're common subs. Input: e -> elem where we get some of the data from cs -> partially filled code to add op = opcode reg = reg field of (mod reg r/m) offset = data to be added to Voffset field keepmsk = mask of registers we must not destroy desmsk = mask of registers destroyed by executing the instruction
Generate code for a logical expression. Input: e elem jcond bit 1 if true then goto jump address if e if false then goto jump address if !e 2 don't call save87() fltarg FLcode or FLblock, flavor of target if e evaluates to jcond targ either code or block pointer to destination
Get offset portion of e, and store it in an index register. Return mask of index register in *pretregs.
Determine size of argument e that will be pushed.
Generate code to push argument e on the stack. stackpush is incremented by stackalign for each PUSH.
Determine if we should leave parameter s in the register it came in, or allocate a register it using the register allocator.
Given a result in registers, test it for true or false. Will fail if TYfptr and the reg is ES! If saveflag is true, preserve the contents of the registers.
Helper function for converting OPparam's into array of Parameters.
Compiler implementation of the D programming language.