Remove type synonyms for CmmFormals, CmmActuals (and hinted versions). Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
cmmTopCodeGen no longer takes DynFlags as an argument It is in the NatM monad, which has DynFlags as part of its state.
Fix some validation errors
Fix warnings in X86/CodeGen
Add new mem{cpy,set,move} cmm prim ops.
Fix build on OS X amd64
Implement jump table fix-ups for linear register allocator. We achieve this by splitting up instruction selection for case switches into two parts: the actual code generation, and the generation of the accompanying jump table. With this scheme, the jump fixup code can modify the contents of the jump table stored within the JMP_TBL (or BCTL) instruction, before the actual data section is created. SPARC and PPC patches are untested; they might not work! Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Fix bug in X86 codegen: use GMOV instead of MOV for F64 w/o SSE2. Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Pop OS X stack padding even if the foreign call is stdcall (#5052) The problem was that the codegen for foreign calls makes sure the stack is 16-byte aligned on OS X by pushing some padding. In the case where the foreign call is cdecl, that padding gets popped after the call, but if the convention is stdcall then it doesn't generate any popping code at all. However, this is incorrect because the stdcall only promises to pop the arguments, not the padding. The fix is to generate code to pop the padding (if any) on OS X.
implement double-to-float narrowing in the x86 NCG (#4441)
Merge in new code generator branch. This changes the new code generator to make use of the Hoopl package for dataflow analysis. Hoopl is a new boot package, and is maintained in a separate upstream git repository (as usual, GHC has its own lagging darcs mirror in http://darcs.haskell.org/packages/hoopl). During this merge I squashed recent history into one patch. I tried to rebase, but the history had some internal conflicts of its own which made rebase extremely confusing, so I gave up. The history I squashed was: - Update new codegen to work with latest Hoopl - Add some notes on new code gen to cmm-notes - Enable Hoopl lag package. - Add SPJ note to cmm-notes - Improve GC calls on new code generator. Work in this branch was done by: - Milan Straka <fox@ucw.cz> - John Dias <dias@cs.tufts.edu> - David Terei <davidterei@gmail.com> Edward Z. Yang <ezyang@mit.edu> merged in further changes from GHC HEAD and fixed a few bugs.
generate "movl lbl(%reg1), %reg2" instructions, better codegen for -fPIC
Add new LLVM code generator to GHC. (Version 2) This was done as part of an honours thesis at UNSW, the paper describing the work and results can be found at: http://www.cse.unsw.edu.au/~pls/thesis/davidt-thesis.pdf A Homepage for the backend can be found at: http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/Backends/LLVM Quick summary of performance is that for the 'nofib' benchmark suite, runtimes are within 5% slower than the NCG and generally better than the C code generator. For some code though, such as the DPH projects benchmark, the LLVM code generator outperforms the NCG and C code generator by about a 25% reduction in run times.
generate slightly better code for ccall argument-pushing on x86
Implement SSE2 floating-point support in the x86 native code generator (#594) The new flag -msse2 enables code generation for SSE2 on x86. It results in substantially faster floating-point performance; the main reason for doing this was that our x87 code generation is appallingly bad, and since we plan to drop -fvia-C soon, we need a way to generate half-decent floating-point code. The catch is that SSE2 is only available on CPUs that support it (P4+, AMD K8+). We'll have to think hard about whether we should enable it by default for the libraries we ship. In the meantime, at least -msse2 should be an acceptable replacement for "-fvia-C -optc-ffast-math -fexcess-precision". SSE2 also has the advantage of performing all operations at the correct precision, so floating-point results are consistent with other platforms. I also tweaked the x87 code generation a bit while I was here, now it's slighlty less bad than before.
Tag ForeignCalls with the package they correspond to
Nicer panic message
RTS tidyup sweep, first phase The first phase of this tidyup is focussed on the header files, and in particular making sure we are exposinng publicly exactly what we need to, and no more. - Rts.h now includes everything that the RTS exposes publicly, rather than a random subset of it. - Most of the public header files have moved into subdirectories, and many of them have been renamed. But clients should not need to include any of the other headers directly, just #include the main public headers: Rts.h, HsFFI.h, RtsAPI.h. - All the headers needed for via-C compilation have moved into the stg subdirectory, which is self-contained. Most of the headers for the rest of the RTS APIs have moved into the rts subdirectory. - I left MachDeps.h where it is, because it is so widely used in Haskell code. - I left a deprecated stub for RtsFlags.h in place. The flag structures are now exposed by Rts.h. - Various internal APIs are no longer exposed by public header files. - Various bits of dead code and declarations have been removed - More gcc warnings are turned on, and the RTS code is more warning-clean. - More source files #include "PosixSource.h", and hence only use standard POSIX (1003.1c-1995) interfaces. There is a lot more tidying up still to do, this is just the first pass. I also intend to standardise the names for external RTS APIs (e.g use the rts_ prefix consistently), and declare the internal APIs as hidden for shared libraries.
Follow vreg/hreg patch in X86_64 NCG
Follow vreg/hreg patch in x86 NCG