summaryrefslogtreecommitdiff
path: root/ghc/compiler
Commit message (Collapse)AuthorAgeFilesLines
* [project @ 2000-01-26 13:38:02 by sewardj]sewardj2000-01-261-2/+2
| | | | | | spillReg, loadReg (x86): always spill fp registers using double-sized loads/stores, even if they nominally contain only a float value -- otherwise the spill loses the extra guard bits.
* [project @ 2000-01-26 11:40:26 by sewardj]sewardj2000-01-261-5/+5
| | | | | | spillReg, loadReg (x86): spill above %esp, not below it. Duh. If you spill below %esp, ccalls, which use stack below %esp, can trash the spill area.
* [project @ 2000-01-25 20:09:22 by sewardj]sewardj2000-01-251-0/+6
| | | | Teach magicIdRegMaybe about R9 and R10.
* [project @ 2000-01-25 20:08:33 by sewardj]sewardj2000-01-251-2/+5
| | | | Print a useful panic msg if getRegister(x86) can't reduce a tree.
* [project @ 2000-01-25 19:49:45 by sewardj]sewardj2000-01-251-3/+3
| | | | pprInstr: implement GABS, GNEG, GSQRT.
* [project @ 2000-01-25 19:33:32 by sewardj]sewardj2000-01-251-5/+4
| | | | Handle float args correctly for x86 ccalls.
* [project @ 2000-01-25 19:18:42 by sewardj]sewardj2000-01-251-74/+6
| | | | | Disable a dubious looking clause for trivialCode (x86), which was generating bad code for some subtracts.
* [project @ 2000-01-25 18:09:52 by sewardj]sewardj2000-01-253-4/+25
| | | | | Implement the HP_CHK_GEN macro. As a result, teach mkNativeHdr et al about R9 and R10.
* [project @ 2000-01-25 16:59:30 by sewardj]sewardj2000-01-251-10/+4
| | | | wibble
* [project @ 2000-01-25 16:58:57 by sewardj]sewardj2000-01-251-3/+11
| | | | | | amodeToStix, GET_TAG: implement correctly for little-endian-32 and supply implementation for big-endian-32. Definitely won't work on 64-bit platforms.
* [project @ 2000-01-25 16:57:40 by sewardj]sewardj2000-01-251-1/+8
| | | | genCodeInfoTable: put tag value into srt_len field for constr info tables.
* [project @ 2000-01-25 14:40:32 by sewardj]sewardj2000-01-251-1/+4
| | | | | x86: free up all FP regs before doing a ccall. This appears to be a part of the x86 calling convention(s).
* [project @ 2000-01-25 10:25:15 by sewardj]sewardj2000-01-251-0/+6
| | | | Add missing final paragraph of explaination about x86 FP trickery.
* [project @ 2000-01-25 10:23:34 by sewardj]sewardj2000-01-251-4/+6
| | | | Minor improvements to x86 FP fake-to-real insn translation.
* [project @ 2000-01-25 10:22:55 by sewardj]sewardj2000-01-251-35/+43
| | | | | | | | | | | | | | | genCCall for x86, as supplied, used PUSH et al to move args onto the C stack ready for the call. Reasonable as this seems, it causes a problem with spill code, since the spiller spills relative to %esp and assumes that %esp doesn't move. If the args of a ccall involved any spilled values, the resulting code would be wrong. The One True Way is to do it like a RISC: move args to the stack without adjusting %esp for each argument, then adjust it all at once immediately prior to the call insn and un-adjust it immediately afterwards. genCCall now does this. In general, push/pop and other C-stack effecting operations should not be generated for the same reason.
* [project @ 2000-01-25 10:15:55 by simonmar]simonmar2000-01-251-2/+2
| | | | Add -optCrts-M80m for older compilers. Sigh.
* [project @ 2000-01-24 18:33:34 by sewardj]sewardj2000-01-241-0/+22
| | | | Start a NOTES file, recording known but un-fixed nativeGen bugs.
* [project @ 2000-01-24 18:28:53 by sewardj]sewardj2000-01-241-7/+13
| | | | Fix syntax errors in #ifdef'd Alpha/Sparc bits.
* [project @ 2000-01-24 18:25:17 by sewardj]sewardj2000-01-241-0/+28
| | | | Insert large commit message re x86 FP rehash as a comment.
* [project @ 2000-01-24 18:22:07 by sewardj]sewardj2000-01-245-22/+30
| | | | | | | ARR_HDR_SIZE --> ARR_WORDS_HDR_SIZE, and derived quantities in Constants.h, Constants.lhs et al are similarly renamed. new constant ARR_PTRS_HDR_SIZE, with corresponding derivatives.
* [project @ 2000-01-24 17:24:23 by sewardj]sewardj2000-01-247-512/+442
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Major reworking of the x86 floating point code generation. Intel, in their infinite wisdom, selected a stack model for floating point registers on x86. That might have made sense back in 1979 -- nowadays we can see it for the nonsense it really is. A stack model fits poorly with the existing nativeGen infrastructure, which assumes flat integer and FP register sets. Prior to this commit, nativeGen could not generate correct x86 FP code -- to do so would have meant somehow working the register-stack paradigm into the register allocator and spiller, which sounds very difficult. We have decided to cheat, and go for a simple fix which requires no infrastructure modifications, at the expense of generating ropey but correct FP code. All notions of the x86 FP stack and its insns have been removed. Instead, we pretend (to the instruction selector and register allocator) that x86 has six floating point registers, %fake0 .. %fake5, which can be used in the usual flat manner. We further claim that x86 has floating point instructions very similar to SPARC and Alpha, that is, a simple 3-operand register-register arrangement. Code generation and register allocation proceed on this basis. When we come to print out the final assembly, our convenient fiction is converted to dismal reality. Each fake instruction is independently converted to a series of real x86 instructions. %fake0 .. %fake5 are mapped to %st(0) .. %st(5). To do reg-reg arithmetic operations, the two operands are pushed onto the top of the FP stack, the operation done, and the result copied back into the relevant register. There are only six %fake registers because 2 are needed for the translation, and x86 has 8 in total. The translation is inefficient but is simple and it works. A cleverer translation would handle a sequence of insns, simulating the FP stack contents, would not impose a fixed mapping from %fake to %st regs, and hopefully could avoid most of the redundant reg-reg moves of the current translation.
* [project @ 2000-01-24 09:25:36 by simonmar]simonmar2000-01-241-6/+3
| | | | Increase the heap size for Parser.hs to 80M (for 4.04).
* [project @ 2000-01-20 13:58:13 by sewardj]sewardj2000-01-201-2/+2
| | | | | trivialCode (x86), when fst arg is immediate, assumed you could reverse the order of operands, but not true for eg subtract. Fixed.
* [project @ 2000-01-19 16:47:16 by sewardj]sewardj2000-01-191-1/+1
| | | | amodeToStix: correctly compute offset for CHARLIKE_closure-s.
* [project @ 2000-01-19 16:44:51 by sewardj]sewardj2000-01-191-0/+2
| | | | Add comment about code generation for debug tracing.
* [project @ 2000-01-19 11:05:36 by sewardj]sewardj2000-01-193-7/+34
| | | | | MachCode.stmt2Instrs, StFunBegin, x86 case only: for debugging, generate trace code to print the name of each labelled code block.
* [project @ 2000-01-18 15:59:53 by sewardj]sewardj2000-01-181-33/+23
| | | | | genCCall for x86 assumed that all args were 4 bytes long :-(. Now works with doubles too.
* [project @ 2000-01-18 13:29:35 by sewardj]sewardj2000-01-184-29/+70
| | | | | | Don't spew floating/double literals into assembly output, since this causes difficulties with FP numbers near the edges of the allowed ranges. Instead, convert them to a sequence of bytes and emit those.
* [project @ 2000-01-18 11:12:57 by sewardj]sewardj2000-01-184-53/+45
| | | | | Remove StLitLit, and clean up somewhat the handling of stdout/stderr/stdin in CLitLits (in StixPrim.amodeToStix).
* [project @ 2000-01-17 16:25:56 by sewardj]sewardj2000-01-171-3/+3
| | | | Zap a couple of trace-s.
* [project @ 2000-01-17 16:24:45 by sewardj]sewardj2000-01-171-2/+10
| | | | | Change alignment directives for x86 segment changes to something more plausible-looking for Linux.
* [project @ 2000-01-17 16:22:33 by sewardj]sewardj2000-01-171-11/+4
| | | | | genCodeInfoTable, genBitmapInfoTable: construct type_info to reflect non-presence of flags in type info field.
* [project @ 2000-01-17 12:05:12 by sewardj]sewardj2000-01-172-2/+27
| | | | | StixPrim.amodeToStix case CMacroExpr: handle UPD_FRAME_UPDATEE StixMacro.macroCode: handle UPDATE_SU_FROM_UPD_FRAME
* [project @ 2000-01-17 10:48:08 by sewardj]sewardj2000-01-171-4/+6
| | | | | Print a couple of blank lines in final assembly output in between basic blocks, to make it easier to match up with the output of -ddump-stix.
* [project @ 2000-01-17 10:10:17 by sewardj]sewardj2000-01-171-2/+16
| | | | macroCode: implement PUSH_SEQ_FRAME
* [project @ 2000-01-14 14:57:08 by sewardj]sewardj2000-01-141-1/+6
| | | | checkCode: handle HP_CHK_UT_ALT.
* [project @ 2000-01-14 14:08:55 by sewardj]sewardj2000-01-141-1/+20
| | | | primCode: implement DataToTagOp.
* [project @ 2000-01-14 11:45:21 by hwloidl]hwloidl2000-01-141-3/+3
| | | | Bugfix (raiseError in non-enterable closures); added GranSim code to Schedule.c
* [project @ 2000-01-13 17:01:16 by sewardj]sewardj2000-01-131-1/+1
| | | | stmt2Instrs: correctly handle StData with zero data words
* [project @ 2000-01-13 15:25:39 by sewardj]sewardj2000-01-131-6/+9
| | | | | genCodeInfoTable: don't do getSRTInfo on the closure info if we already know via infoTblNeedsSRT that an SRT isn't needed.
* [project @ 2000-01-13 15:22:58 by sewardj]sewardj2000-01-131-1/+15
| | | | gentopcode: handle CClosureTbl.
* [project @ 2000-01-13 14:33:57 by hwloidl]hwloidl2000-01-138-76/+121
| | | | | Merged GUM-4-04 branch into the main trunk. In particular merged GUM and SMP code. Most of the GranSim code in GUM-4-04 still has to be carried over.
* [project @ 2000-01-13 14:11:51 by sewardj]sewardj2000-01-132-22/+19
| | | | | Rearrange top-level nativeGen plumbing so that -ddump-stix is visible even if subsequent nativeGen passes crash.
* [project @ 2000-01-13 12:59:58 by sewardj]sewardj2000-01-135-22/+97
| | | | Added a rudimentary implementation of -ddump-stix.
* [project @ 2000-01-06 10:43:15 by simonmar]simonmar2000-01-062-3/+15
| | | | | Fix a bug in inlining that gave unresolved references whenever you compile without -O. Silly me.
* [project @ 2000-01-05 17:23:34 by simonmar]simonmar2000-01-052-11/+12
| | | | | Emit a reasonable error message instead of crashing when there's an unterminated literal-liberal in the source file.
* [project @ 2000-01-04 17:40:46 by simonpj]simonpj2000-01-0419-264/+693
| | | | | | | | | | | | | | | | | This commit arranges that literal strings will fuse nicely, by expressing them as an application of build. * NoRepStr is now completely redundant, though I havn't removed it yet. * The unpackStr stuff moves from PrelPack to PrelBase. * There's a new form of Rule, a BuiltinRule, for rules that can't be expressed in Haskell. The string-fusion rule is one such. It's defined in prelude/PrelRules.lhs. * PrelRules.lhs also contains a great deal of code that implements constant folding. In due course this will replace ConFold.lhs, but for the moment it simply duplicates it.
* [project @ 1999-12-29 12:17:36 by simonpj]simonpj1999-12-292-24/+54
| | | | | | | | Fix a renamer bug that rejected import M hiding( C ) where C is a constructor.
* [project @ 1999-12-22 10:36:34 by simonmar]simonmar1999-12-221-67/+0
| | | | Remove more vestiges of IntAbsOp, and now unused absIntCode.
* [project @ 1999-12-20 22:21:09 by lewie]lewie1999-12-203-5/+1
| | | | Remove *uses* of unused IntAbsOp (see recent log message in prelude/PrimOp).