Revision: 1175 Author: robhamerling Date: Fri Aug 7 12:47:25 2009 Log: JalV2 compiler version 2.4l
http://code.google.com/p/jallib/source/detail?r=1175 Modified: /trunk/compiler/README.txt /trunk/compiler/decode.txt /trunk/compiler/jalopts.txt /trunk/compiler/jalpragm.txt /trunk/compiler/jalv2 /trunk/compiler/jalv2.exe /trunk/compiler/jalv2ecs.exe ======================================= --- /trunk/compiler/README.txt Tue May 12 22:48:39 2009 +++ /trunk/compiler/README.txt Fri Aug 7 12:47:25 2009 @@ -27,7 +27,36 @@ History ======= -2.4k -- ?? ??? ???? +2.4l -- 7 Aug 2009 + * -const-detect ordered the constant big endian instead + if little endian + * 16 bit code generation fixed to match mpasm (namely, + the PC is shown in bytes not words) + * Added inline assembly: reset + * A procedure taking a volatile parameter and also + re-entrant would cause an assert() + * Changed re-rentrant entry/exit to *not* use stkpush/pop + * A re-entrant *function's* return value was over-written + if there were any non-volatile OUT paramters + * added a numeric option to -loader18 to set the offset + Examples: + -loader18 : starts the code at 2048 + -loader18 4096 : starts the code a 4096 + * Added units to jalpragm.txt to explain that for + `PRAGMA CODE size', size is in WORDs for 12/14 bit + cores, and BYTEs for 16 bit cores (thanks MicroChip!). + This follows from the second bullet above. + * Included inclue assembly opcodes: rlcf/rlncf/rrcf/rrncf + * Fixed 16-bit code to use rrcf instead of rrf + * Make sure variables don't span banks even if the banks + are contiguous (a problem seen on 16 bit cores). + * `ALIAS...IS' should work even if the underlying variable + is only a pseudo-variable + * Output of `Code area' was screwy on 16 bit cores + * Changed `pragma code' on the 18 series to use bytes instead + of words + +2.4k -- 08 May 2009 * very minor optimization for bit value return * B00059: compiler generated 'put for bits doesn't work * B00058: compiler generated 'put doesn't work ======================================= --- /trunk/compiler/decode.txt Mon Dec 29 12:27:54 2008 +++ /trunk/compiler/decode.txt Fri Aug 7 12:47:25 2009 @@ -22,9 +22,6 @@ s : The state of status:rp0 before this instruction is executed. 's' = clear, 'S' = set -r : The state of status:rp1 after this instruction is executed -s : The state of status:rp0 after this instruction is executed - h : The state of pclath<4> before this instruction is executed 'h' = clear, 'H' = set l : The state of pclath<3> before this instruction is executed ======================================= --- /trunk/compiler/jalopts.txt Mon Dec 29 12:27:54 2008 +++ /trunk/compiler/jalopts.txt Fri Aug 7 12:47:25 2009 @@ -44,6 +44,20 @@ Force the first generated instruction to be a long jump (needed by some bootloaders) + -bloader + Using the screamer/bloader PIC loader. The first instruction + starts at 0x0003 and is a `goto start' + + -loader18 [n] + Used on the 16 bit cores (PIC18xxxxx) this sets an offset + from the beginning of code space for the loader. Normally + the reset vector is 0x0000, the high priority interrupt at + 0x0008, and the low priority interrupt at 0x0018. This + simply offsets the value. If n is present, that value is + used as the offset, if not the default is 0x0800 (putting the + reset vector at 0x0800, high priority interrupt at 0x0808, and + low priority at 0x0818). + Warnings -------- -Wdirectives @@ -72,6 +86,12 @@ Turns on or off expression reduction (see EXPRESSION REDUCTION below) default : on + -expr-simplify + -no-expr-simplify + Turns on or off expression simplification (see EXPRESSION SIMPLIFICATION + below) + default : off + -cexpr-reduction -no-cexpr-reduction Turns on or off constant expression reduction, also known as constant @@ -150,4 +170,86 @@ x >> 0 --> x x >> n, n is greater than 8 * size x --> 0 - +EXPRESSION SIMPLIFICATION +========================= + +Introduced in jal24l, currently an *experimental* feature. The +JAL --> pcode conversion is rather stupid. It takes JAL code and +directly creates a simple list of three address codes in the form + + operator (dst, val1, val2) + +This leaves little room for optimization, and tends to use quite +a few temporary variables for any complex expression. For example, +the expression: + + xx = ((xx + 1) + 2) + 3) + +literally translates to: + + t0 = xx + 1 + t1 = t0 + 2 + t2 = t1 + 3 + xx = t2 + +Expression simplification looks for expressions and from +them creates an n-way tree, looking vaguely like: + + = + / \ + xx t0 + | + xx + 1 + 2 + 3 + +which can be simplified to: + + = + / \ + xx t0 + | + xx + 6 + +which can be further simplified as: + + xx += 6 + +of equal importance, this also introduces the concept of subexpression +elimination. The following: + + xx = xx * yy + yy * xx + xx * yy + yy * xx + +formerly: + + t0 = xx * yy + t1 = yy * xx + t2 = t0 + t1 + xx = t2 + +becomes: + + t0 = xx * yy + xx = t0 + t0 + +(yes, this actually becomes: xx = t0 << 1) + +This will also detect identities: + + xx = xx + 1 - xx + +becomes: + + xx = 1 + +It should not, however, change the results of any operation, and +that is why it is currently experimental. Algebraically, the +following is true: + + xx = (xx / 10) * 10 + +is the same as: + + xx = xx (aka, no-op) + +however in integer arithmetic this is *not* true, so this +change is not done. + ======================================= --- /trunk/compiler/jalpragm.txt Tue May 12 22:48:39 2009 +++ /trunk/compiler/jalpragm.txt Fri Aug 7 12:47:25 2009 @@ -361,6 +361,8 @@ PRAGMA CODE size Defines the code size for a device -- used to detect code too large. + For the 12 & 14 bit cores, this number is in WORDs, for the 16 bit + cores, this number is in BYTEs. Blame MicroChip. PRAGMA [DATA | SHARED] lo['-'hi[',' ...] ======================================= --- /trunk/compiler/jalv2 Tue May 12 22:48:39 2009 +++ /trunk/compiler/jalv2 Fri Aug 7 12:47:25 2009 Binary file, no diff available. ======================================= --- /trunk/compiler/jalv2.exe Tue May 12 22:48:39 2009 +++ /trunk/compiler/jalv2.exe Fri Aug 7 12:47:25 2009 Binary file, no diff available. ======================================= --- /trunk/compiler/jalv2ecs.exe Wed May 13 07:44:00 2009 +++ /trunk/compiler/jalv2ecs.exe Fri Aug 7 12:47:25 2009 Binary file, no diff available. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jallib" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jallib?hl=en -~----------~----~----~----~------~----~------~--~---
