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