C Compiler. * Autoincrement/autodecrement insertion code in the optimiser failed to check that the constant was the correct value. made struct { char a, b } *p, *q; (p++)->a = (q++)->a; fail. * Sethi set regs needed to n+1 for assignment type operators. When deleting conversions in match, don't delete both! * Clasfy had a blo in it that should have been blos. This made it avoid the last available register termporary. * First pass F.P. code (reader). New preprocessor. Run code for OP.FLD * "unsigned x" in struct. didn't work. movb b,r0 bic $!377,r0 => clr r0 bisb b,r0 mov $n,n(r0) => mov (pc),n(r0) ext[i] should be mov i,r0 asl r0 mov ext(r0),r0 char *p; i = *p++; movb *p,r0 inc p if codes not needed. * char *p; *p |= 0; *p &= ~0; cause bus error in compiler. * * of * passed junk to clasfy; must make fake other node! * Int to long gets "Botch in laddr -- address not indirect" * if ((a <<= 1) == 0) wrong code * reg += reg via stack funny code * long x in struct didn't work * if (? :) wrong code * 0xE is not a floating point number. * Number too long only if floating point constant. If not -s, should you delete .src before pass2 to save disc space ? * Global ref redeclared as static external now legal. N.B. This wasn't fixed for routines with a dimp !! Local with same name as global gets a redeclaration, shouldn't. (Block structure will fix this, though). Global collisions (6 bytes) should be checked. Make the error recovery less arcane. Local initialisers. Option to put out .text, .data and .bss for UNIX people. * Diagnostics tagged with function name. Line numbers; should have line number per window slot. User settable psections. Done via #psect? #text? etc. Optimise multiply by -1 to a neg. Optimise unsigned divide by power of 2 to unsigned shift. Unsigned multiply/divide to special operators. Is it possible to reorder things like "1-a-2" so they will fold ? Yes. Transform -2 into +(-2) because + is commutative. The mask thing in `pinst.c' compiles very badly. Find out why. Assembler * ; (Multiple statements per line) * Expression statements * C style escapes in strings and character constants * Ill-formed expressions loop Exec directives * Use $cat5b instead of $cat5 in object file code for v3.1 and v3.2 * UNIX style ascii directives * Float directives (.flt2 .flt4) Conditional assembly * Expand bad branches to mode 67 jumps (not mode 37 jumps) Allocate and grow symbol table Branch table overflow, fatal?? 0 length absolute items in object deck, can they be removed?? Look a bit more at a DEC object file. complex relocation ".." * Case sensitive Default .ident for the date of assembly RT-11 object file?? Don't make versions. Editor * "&" if no text loops. * If you delete all the text, "&" prints 1 line. * Grow temp. file in one big chunk * { } in substitute. * Sometimes closures loop. * ! command as in unix using spawn. * Grow core. * Print funny characters in octal * oos oor to control above Perm. file for scratch and a salvager for the file. * o& * oi and os => os[sr] * ot and ov => op[sr] * ^ in substitute swaps case. * ous our to control above * & = 23. * h[elp] command prints last error. Replace ^ by \u, \l, \r, etc. Library. * Change names to avoid RMS-11K V1.8 * Flseek bug introduced by Phil. Misc. Programme to print the sizes of a task image. (Objects too ??) Tree structured source/documentation archiver Make Clean up decus focal for RSX so it isn't so grotty. * Put said focal on a ticky disc. Nroff for rsx. With runoff compatable macros !! Wildcard file name expander. Shared code routine. Random thoughts on floating point code generation for the C compiler. Non fpp coder (nothing or FIS). Nothing is the same as the FIS, except that you say "jsr pc,_fadd" instead of "fadd sp". The routines will set the codes the same way. Compares are done via subtracts. There is no way to pop the stack and not lose the condition codes so there will be a routine "jsr pc,_fpop" that pops a float (2 words) from the stack and sets the codes on it. If you just want to discard the value a simple "cmp (sp)+,(sp)+" will do. Perhaps there should be a routine "jsr pc,_fcmp" that compares the top two elements of the stack and sets all of the codes correctly. Then "_fpop" will only be used for things like "if (a+b == 3)" and "_fcmp" will be used for the others. This saves a subtract instruction for each compare since "_fpop" would have to be called in any case. _fcmp: mov (sp)+,r0 / Save return address. fsub sp br 0f _fpop: mov (sp)+,r0 / Save return address. 0: mov (sp)+,r1 / Hi half of result. tst (sp)+ / Lo half. tst r1 / Set Z and N. jmp (r0) / To caller. These routines are no worse than the other things in the library. Then the coding for compares (in jumpc) is easy. If you have an FPP the code is a standard setup, followed by a "cmpd", followed by a "cfcc" (the call will have a "tstd r0" here bacause the call does no set the condition codes correctly. For calls the other coder will compile the result into the rtab using r0 then generate a "tst r0" to set the codes. If the op is not a call but can be mad addressable it just makes it addressable and does a "tst" on the high order word. Otherwise for compares it pushes the two operands and compiles a "jsr pc,_fcmp"; for others it calls "cexpr" to compile the tree and a "jsr pc,_fpop" to set the codes. In all cases we now have Z and N (which is enough because there are no unsigned floating point branches!). The other basic ops (+, -, *, /) are easier. They are only compilable in the stab. If another table is required special things must be done. If the table is the etab then compile it with the stab and compile a "cmp (sp)+,(sp)+" (using the popstk routine?) to clear off the result. If the table is rtab then make a special check for function call. If the thing is addressable do any required addressing setup and load the thing into the registers. Otherwise compile it via the stab and put out two move instructions to load up the result. Basic assignment is special. The constants probably should not be put into the MWCN psection as they may be used directly. Go about it in basicly the same way as longs. The same may be said of the binary assignments. Since the arguments to the FIS and the simulation routines go on the stack very little optimisation is ever worth it!. It may be a fine idea to put out a global symbol like "fltused" in UNIX to haul in the floating point part of printf. The floating point part of printf is not that tiny. The "atof" routine out of the compiler should be made into a renterable library routine (i.e. rewritten in "as"). Some of the more common routines ("sin", "cos", "atan", "exp", "log", "pow" etc.) should be provided. They are basicly fairly easy given the floating point routines and the paper tape manual (for the magic numbers). For machines with nothing it may be possible to make the code smaller by having a routine a bit like the polish interpreter in the DEC stuff. Call it (in the traditional fashon) with a "jsr pc,_fpol". It goes. _fpol: mov (sp)+,r4 0: mov (r4)+,r3 beq 0f jsr pc,(r3) br 0b 0: jmp (r4) And is used like: jsr pc,_fpol _fadd _fmul _flit; loc 0 _flit: mov (sp)+,r0 mov (r4)+,r1 mov 2(r1),-(sp) mov (r1),-(sp) jmp (r0) Bell calling sequence --------------------- Args at 4, 6, .... Autos at 177770, 177766, 177764 The *$ is used whenever the first arg goes to (sp). This is never done with longs or floats. Enter with jsr r5,csv; leave with jmp cret