summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/SPARC
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove more defaultTargetPlatform usesIan Lynagh2011-07-153-30/+40
|
* More work towards cross-compilationIan Lynagh2011-07-153-21/+24
| | | | | | | | | | | | There's now a variant of the Outputable class that knows what platform we're targetting: class PlatformOutputable a where pprPlatform :: Platform -> a -> SDoc pprPlatformPrec :: Platform -> Rational -> a -> SDoc and various instances have had to be converted to use that class, and we pass Platform around accordingly.
* CPP removalIan Lynagh2011-07-131-5/+6
|
* Refactoring: explicitly mark whether we have an info table in RawCmmMax Bolingbroke2011-07-061-14/+16
| | | | | | | | | | | | I introduced this to support explicitly recording the info table label in RawCmm for another patch I am working on, but it turned out to lead to significant simplification in those parts of the compiler that consume RawCmm. Now, instead of lots of tests for null [CmmStatic] we have a simple test of a Maybe, and have reduced the number of guys that need to know how to convert entry->info labels by a TON. There are only 3 callers of that function now!
* Remove the unused CmmAlign and CmmDataLabel from CmmStaticMax Bolingbroke2011-07-051-7/+1
|
* Refactoring: use a structured CmmStatics type rather than [CmmStatic]Max Bolingbroke2011-07-056-22/+30
| | | | | | | | | | | | | | | | | | I observed that the [CmmStatics] within CmmData uses the list in a very stylised way. The first item in the list is almost invariably a CmmDataLabel. Many parts of the compiler pattern match on this list and fail if this is not true. This patch makes the invariant explicit by introducing a structured type CmmStatics that holds the label and the list of remaining [CmmStatic]. There is one wrinkle: the x86 backend sometimes wants to output an alignment directive just before the label. However, this can be easily fixed up by parameterising the native codegen over the type of CmmStatics (though the GenCmmTop parameterisation) and using a pair (Alignment, CmmStatics) there instead. As a result, I think we will be able to remove CmmAlign and CmmDataLabel from the CmmStatic data type, thus nuking a lot of code and failing pattern matches. This change will come as part of my next patch.
* Remove type synonyms for CmmFormals, CmmActuals (and hinted versions).Edward Z. Yang2011-06-131-3/+3
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* cmmTopCodeGen no longer takes DynFlags as an argumentIan Lynagh2011-06-081-5/+3
| | | | It is in the NatM monad, which has DynFlags as part of its state.
* Eliminate IF_ARCH_sparcIan Lynagh2011-05-311-3/+1
|
* Fix some validation errorsDavid Terei2011-05-311-2/+2
|
* Add new mem{cpy,set,move} cmm prim ops.David Terei2011-05-311-8/+22
|
* Remove most of the CPP from AsmCodeGenIan Lynagh2011-05-291-1/+5
| | | | | | | | In particular, the "#error" for platforms without a NCG is gone, which means the module should now build on all platforms again. I'm not sure if this is the nicest way to handle multiple platforms here, but it works for now.
* Remove unused pprUserReg functionsIan Lynagh2011-05-081-7/+0
|
* Implement jump table fix-ups for linear register allocator.Edward Z. Yang2011-04-273-12/+16
| | | | | | | | | | | | | 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>
* Merge in new code generator branch.Simon Marlow2011-01-2415-40/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add new LLVM code generator to GHC. (Version 2)David Terei2010-06-152-23/+6
| | | | | | | | | | | | | | | | | | 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.
* Implement SSE2 floating-point support in the x86 native code generator (#594)Simon Marlow2010-02-043-7/+11
| | | | | | | | | | | | | | | | | | | | | 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 toBen.Lippmeier@anu.edu.au2010-01-021-1/+1
|
* RTS tidyup sweep, first phaseSimon Marlow2009-08-023-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove unused importsIan Lynagh2009-07-071-2/+0
|
* Trim unused imports detected by new unused-import codesimonpj@microsoft.com2009-07-061-1/+0
|
* Follow vreg/hreg patch in x86 NCGBen.Lippmeier@anu.edu.au2009-05-191-1/+1
|
* Split Reg into vreg/hreg and add register pairsBen.Lippmeier@anu.edu.au2009-05-1810-282/+421
| | | | | | | | | | | | | * The old Reg type is now split into VirtualReg and RealReg. * For the graph coloring allocator, the type of the register graph is now (Graph VirtualReg RegClass RealReg), which shows that it colors in nodes representing virtual regs with colors representing real regs. (as was intended) * RealReg contains two contructors, RealRegSingle and RealRegPair, where RealRegPair is used to represent a SPARC double reg constructed from two single precision FP regs. * On SPARC we can now allocate double regs into an arbitrary register pair, instead of reserving some reg ranges to only hold float/double values.
* Fix SPARC build, missing #includeBen.Lippmeier@anu.edu.au2009-04-251-0/+2
|
* SPARC NCG: validate fixesBen.Lippmeier@anu.edu.au2009-04-202-4/+12
|
* SPARC NCG: Base freeRegs on includes/MachRegs.h againBen.Lippmeier@anu.edu.au2009-04-203-84/+385
|
* SPARC NCG: Fix 64 bit addition, carry bit wasn't getting set.Ben.Lippmeier@anu.edu.au2009-03-302-9/+27
|
* SPARC NCG: HpLim is now always stored on the stack, not in a registerBen.Lippmeier@anu.edu.au2009-03-311-3/+4
| | | | | | | | | | | | This fixes the out of memory errors we were getting on sparc after the following patch: Fri Mar 13 03:45:16 PDT 2009 Simon Marlow <marlowsd@gmail.com> * Instead of a separate context-switch flag, set HpLim to zero Ignore-this: 6c5bbe1ce2c5ef551efe98f288483b0 This reduces the latency between a context-switch being triggered and the thread returning to the scheduler, which in turn should reduce the cost of the GC barrier when there are many cores.
* SPARC NCG: Split out sanity checking into its own moduleBen.Lippmeier@anu.edu.au2009-02-233-35/+87
|
* SPARC NCG: Add jumps to end of blocks when working out condition codesBen.Lippmeier@anu.edu.au2009-02-231-15/+39
|
* SPARC NCG: Enforce the invariant that each block ends with a jump.Ben.Lippmeier@anu.edu.au2009-02-231-14/+50
| | | | | | - If each basic block doesn't end with a jump then the register liveness determinator will get the cross-block liveness info wrong, resulting in a bad allocation.
* SPARC NCG: Unsigned comparisons are unsignedBen.Lippmeier@anu.edu.au2009-02-171-4/+4
|
* SPARC NCG: Fix word size conversionsBen.Lippmeier@anu.edu.au2009-02-171-24/+69
|
* SPARC NCG: Split up into chunks, and fix warnings.Ben.Lippmeier@anu.edu.au2009-02-1610-1243/+1473
|
* SPARC NCG: Reorganise Reg and RegInfoBen.Lippmeier@anu.edu.au2009-02-1610-370/+436
|
* NCG: Split up the native code generator into arch specific modulesBen.Lippmeier@anu.edu.au2009-02-156-553/+2160
| | | | | | | | | | | | | | | | | | | | | | | | | | | - nativeGen/Instruction defines a type class for a generic instruction set. Each of the instruction sets we have, X86, PPC and SPARC are instances of it. - The register alloctors use this type class when they need info about a certain register or instruction, such as regUsage, mkSpillInstr, mkJumpInstr, patchRegs.. - nativeGen/Platform defines some data types enumerating the architectures and operating systems supported by the native code generator. - DynFlags now keeps track of the current build platform, and the PositionIndependentCode module uses this to decide what to do instead of relying of #ifdefs. - It's not totally retargetable yet. Some info info about the build target is still hardwired, but I've tried to contain most of it to a single module, TargetRegs. - Moved the SPILL and RELOAD instructions into LiveInstr. - Reg and RegClass now have their own modules, and are shared across all architectures.
* SPARC NCG: Enumerate freeRegs / globalRegMaybe instead of using #ifdeferyBen.Lippmeier@anu.edu.au2009-02-111-306/+268
|
* NCG: Split PprMach into arch specific modulesBen.Lippmeier@anu.edu.au2009-02-053-193/+841
| | | | | | - There are still some #ifdefs for choosing between i386, x86_64, linux, darwin and other OS's. - Also reformat SPARC.RegInfo to remove some of the visual noise.
* NCG: Validate fixesBen.Lippmeier@anu.edu.au2009-02-052-3/+24
|
* NCG: Split RegAllocInfo into arch specific modulesBen.Lippmeier@anu.edu.au2009-02-042-3/+343
|
* NCG: Rename MachRegs, MachInstrs -> Regs, Instrs to reflect arch specific namingBen.Lippmeier@anu.edu.au2009-02-041-1/+1
|
* NCG: Split MachRegs.hs into arch specific modulesBen.Lippmeier@anu.edu.au2009-02-041-0/+572
|
* NCG: Split MachInstrs into arch specific modulesBen.Lippmeier@anu.edu.au2009-02-031-0/+188