Align sections on the stack. base negative offset of section from frame pointer alignment alignment to use bias difference between where frame pointer points and the STACKALIGNed part of the stack
Allocate a scratch register.
Allocate some registers. Input: pretregs Pointer to mask of registers to make selection from. tym Mask of type we will store in registers. Output: *pretregs Mask of allocated registers. *preg Register number of first allocated register. msavereg,mfuncreg retregs bits are cleared. regcon.cse.mval,regcon.cse.mops updated
For elems in regcon that don't match regconsave, clear the corresponding bit in regcon.cse.mval. Do same for regcon.immed.
Predicate for sorting auto symbols for qsort().
Generate code sequence for an elem. Input: pretregs = mask of possible registers to return result in Note: longs are in AX,BX or CX,DX or SI,DI doubles are AX,BX,CX,DX only constflag = 1 for user of result will not modify the registers returned in *pretregs. 2 for freenode() not called. Output: *pretregs mask of registers result is returned in
Generate code for a function. Note at the end of this routine mfuncreg will contain the mask of registers not affected by the function. Some minor optimization possibilities are here.
Flush all CSE's out of registers and into memory. Input: do87 !=0 means save 87 registers too
Common subexpressions exist in registers. Note this in regcon.cse.mval. Input: e the subexpression regm mask of registers holding it opsflag if != 0 then regcon.cse.mops gets set too
Scan down comma-expressions. Output: *pe = first elem down right side that is not an OPcomma
Determine if a computation should be done into a register.
Given a register mask, find and return the number of the first register that fits.
Free element (but not its leaves! (assume they are already freed)) Don't decrement Ecount! This is so we can detect if the common subexp has already been evaluated. If common subexpression is not required anymore, eliminate references to it.
We are going to use the registers in mask r. Generate any code necessary to save any regs.
We are going to use the registers in mask r. Same as getregs(), but assert if code is needed to be generated.
Getregs without marking immediate register values as gone.
Return mask of scratch registers.
Determine if elem e is a register variable. If so: *pregm = mask of registers that make up the variable *preg = the least significant register returns true Else returns false
Determine registers that should be destroyed upon arrival to code entry point for exception handling.
Generate code for a function start. Input: Offset(cseg) address of start of code Auto.alignment Output: Offset(cseg) adjusted for size of code generated EBPtoESP hasframe BPoff
Turn register mask into a string suitable for printing.
Same as codelem(), but do not destroy the registers in keepmsk. Use scratch registers as much as possible, then use stack. Input: constflag true if user of result will not modify the registers returned in *pretregs.
Compute stack frame offsets for local variables. that did not make it into registers.
Mark registers as used.
Top level code for the code generator.