5f76d695d402c9d85c63edd9723a9e96c807e283
[ghc-hetmet.git] / ghc / compiler / nativeGen / NOTES
1
2 Known bugs/issues in nativeGen, 000202 (JRS)
3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4
5 All these bugs are for x86; I don't know about sparc/alpha.
6
7 -- absC -> stix translation for GET_TAG and in fact anything
8    to do with the packed-halfword layout info itbl field is
9    pretty dubious.  I think I have it fixed for big and little
10    endian 32-bit, but it won't work at all on a 64 bit platform.
11
12 -- Most of the x86 insn selector code in MachCode.lhs needs to
13    be checked against the Rules of the Game recorded in that file.
14    I think there are a lot of subtle violations.
15
16 -- When selecting spill regs, don't use %eax if there is a CALL insn
17    (perhaps excluding calls to newCAF, since it doesn't return a
18     result).
19
20 -- Keep track of the stack offset so that correct spill code can
21    be generated even if %esp moves.  At the moment %esp doesn't
22    move, so the problem doesn't exist, but there is a different
23    problem: ccalls put args in memory below %esp and only move
24    %esp immediately prior to the call.  This is dangerous because
25    (1) writing below %esp can cause a segmentation fault (as deemed
26    by the OS), and (2) if a signal should be handled on that stack
27    during argument construction, the args will get silently trashed.
28
29    Currently, implementation of GITOF et al use the stack, so are
30    incompatible with current ccall implementation.  When the latter
31    is fixed, GITOF et al should present no problem.
32
33 -- nofib/real/hidden gets slightly different FP answers from the
34    via-C route; possibly due to exp/log not being done in-line.
35
36 -- Possibly implement GLDZ and GLD1 as analogues of FLDZ and FLD1
37    (x86), to reduce number of constants emitted in f-p code.
38