| 1 |
|
| 2 |
|
| 3 |
8086/80186 |
| 4 |
---------- |
| 5 |
Add CPU options |
| 6 |
Make push immediate, imul, shift immediate and enter/leave 186 specific |
| 7 |
Optimise >> 8 and friends as register moves (note that the core compiler |
| 8 |
code also goes off and turns * 256 into << 8) |
| 9 |
|
| 10 |
Unstarted |
| 11 |
--------- |
| 12 |
Float |
| 13 |
|
| 14 |
Struct/Union testing |
| 15 |
|
| 16 |
Maths optimisation. Div/mul on 8086 are *slow* so generate stack/double and |
| 17 |
other optimised forms |
| 18 |
|
| 19 |
Long helper methods (out of line 32bit mul etc) |
| 20 |
|
| 21 |
Make long long a class E with 64bit types and four virtual registers |
| 22 |
rewritten as memory. |
| 23 |
|
| 24 |
Other call formats |
| 25 |
|
| 26 |
Optimisation |
| 27 |
------------ |
| 28 |
Avoid sp,bp set up if we can on entry/exit |
| 29 |
|
| 30 |
Delayed sp adjustments |
| 31 |
|
| 32 |
Don't adjust sp then reload it from bp! |
| 33 |
|
| 34 |
Register constant tracking (especially important as we often know where a |
| 35 |
zero word or byte is and we can use it for push immediate #0) |
| 36 |
|
| 37 |
Spotting two halves of a 32bit value being the same and merging |
| 38 |
|
| 39 |
Allow moves between half registers and their full shadow (al->ax) for char |
| 40 |
to short etc. How to balance compilers tendancy to allocate AL, AH, etc |
| 41 |
which is good for register freedom and bad for chars ? |
| 42 |
|
| 43 |
Better uchar handling - if we allocated xL before xH somehow in all cases |
| 44 |
then we would be able to do xL -> xX efficiently. |
| 45 |
|
| 46 |
We get very poor code because the compiler doesn't understand that type |
| 47 |
converting al does not destroy al, only ah and the al/ax relationship. In |
| 48 |
particular with char args it loves to write crap like |
| 49 |
|
| 50 |
|
| 51 |
mov bl, 1 |
| 52 |
... |
| 53 |
mov al, bl |
| 54 |
cbw |
| 55 |
push ax |
| 56 |
mov al, bl |
| 57 |
cbw |
| 58 |
inc ax |
| 59 |
push ax |
| 60 |
|
| 61 |
not |
| 62 |
mov al, 1 |
| 63 |
cbw |
| 64 |
push ax |
| 65 |
inc al |
| 66 |
cbw |
| 67 |
push ax |
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
Questions |
| 76 |
--------- |
| 77 |
An assembler programmer would not |
| 78 |
|
| 79 |
mov al, #14 |
| 80 |
cbw |
| 81 |
|
| 82 |
but would |
| 83 |
|
| 84 |
mov ax, #0014 |
| 85 |
|
| 86 |
not obvious how we do that optimisation with pcc in all cases but its important |
| 87 |
|
| 88 |
Can we optimise compare with zero cases ? |
| 89 |
|
| 90 |
How do we make use of rep and loopXX, these are rather useful on 8086 but |
| 91 |
need indexes to tend to use the right register |
| 92 |
|
| 93 |
Should there be a CPU type/feature match in table.c ? |