summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/PIC.hs
Commit message (Collapse)AuthorAgeFilesLines
* PPC: Fix loads of PIC data with > 16 bit offsets (#7830).Erik de Castro Lopo2014-02-281-2/+3
| | | | Loads should now handle up to 32 bit offsets.
* nativeGen: Fix spelling in commentBen Gamari2014-01-071-1/+1
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Make the current module available to labelDynamicIan Lynagh2013-05-131-20/+25
| | | | It doesn't actually use it yet
* Refactor cmmMakeDynamicReferenceIan Lynagh2013-05-131-8/+13
| | | | | It now has its own class, and the addImport function is defined in that class, rather than needing to be passed as an argument.
* Remove redundant cmmMakeDynamicReference' wrapperIan Lynagh2013-05-131-4/+2
|
* No need to map over all blocks, setting up PIC.Gabor Greif2013-04-131-12/+4
| | | | | Darwin x86 has inconsistent PIC base register, so splitting (which happened before) ensures that each cmm procedure only has one entry point (namely the first block).
* Make explicit that there can be only one entry pointGabor Greif2013-04-121-3/+3
| | | | | | per cmm procedure on Darwin/PPC, because of splitting. x86 should be treated the same way, I'll come back to that later.
* There can be several blocks in a PPC/ELF cmm procGabor Greif2013-04-081-8/+15
| | | | add FETCHPC to all of them (this fixes #7814).
* Remove OldCmm, convert backends to consume new CmmSimon Marlow2012-11-121-1/+1
| | | | | | | | | | | | | | | | | | This removes the OldCmm data type and the CmmCvt pass that converts new Cmm to OldCmm. The backends (NCGs, LLVM and C) have all been converted to consume new Cmm. The main difference between the two data types is that conditional branches in new Cmm have both true/false successors, whereas in OldCmm the false case was a fallthrough. To generate slightly better code we occasionally need to invert a conditional to ensure that the branch-not-taken becomes a fallthrough; this was previously done in CmmCvt, and it is now done in CmmContFlowOpt. We could go further and use the Hoopl Block representation for native code, which would mean that we could use Hoopl's postorderDfs and analyses for native code, but for now I've left it as is, using the old ListGraph representation for native code.
* Attach global register liveness info to Cmm procedures.Geoffrey Mainland2012-10-301-8/+8
| | | | | | | All Cmm procedures now include the set of global registers that are live on procedure entry, i.e., the global registers used to pass arguments to the procedure. Only global registers that are use to pass arguments are included in this list.
* Whitespace only in nativeGen/PIC.hsIan Lynagh2012-10-191-282/+275
|
* Some alpha renamingIan Lynagh2012-10-161-16/+16
| | | | | Mostly d -> g (matching DynFlag -> GeneralFlag). Also renamed if* to when*, matching the Haskell if/when names
* Pass DynFlags down to wordWidthIan Lynagh2012-09-121-4/+5
|
* Pass DynFlags down to bWordIan Lynagh2012-09-121-1/+1
| | | | | | I've switched to passing DynFlags rather than Platform, as (a) it's simpler to not have to extract targetPlatform in so many places, and (b) it may be useful to have DynFlags around in future.
* Make the ways dynamicIan Lynagh2012-09-031-8/+7
|
* Load the PIC base register on every entry pointSimon Marlow2012-08-311-7/+27
| | | | (fixes dyn tests with -fnew-codegen on x86)
* Make -fPIC a dynamic flagIan Lynagh2012-07-161-32/+32
| | | | | | Hopefully I've kept the logic the same, and we now generate warnings if the user does -fno-PIC but we ignore them (e.g. because they're on OS X amd64).
* Use SDoc rather than Doc in the native gensIan Lynagh2012-06-121-54/+39
| | | | This avoid lots of converting back and forth between the two types.
* Remove some old comments about the manglerDavid Terei2011-11-221-5/+0
|
* Use -fwarn-tabs when validatingIan Lynagh2011-11-041-0/+7
| | | | | We only use it for "compiler" sources, i.e. not for libraries. Many modules have a -fno-warn-tabs kludge for now.
* Add "have subsections via symbols" to the Platform typeIan Lynagh2011-10-191-7/+7
|
* More CPP removal: pprDynamicLinkerAsmLabel in CLabelIan Lynagh2011-10-021-44/+44
| | | | And some knock-on changes
* Some CPP removalIan Lynagh2011-10-021-8/+8
|
* Renaming onlySimon Peyton Jones2011-08-251-6/+6
| | | | | CmmTop -> CmmDecl CmmPgm -> CmmGroup
* Refactoring: use a structured CmmStatics type rather than [CmmStatic]Max Bolingbroke2011-07-051-6/+5
| | | | | | | | | | | | | | | | | | 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.
* Merge in new code generator branch.Simon Marlow2011-01-241-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* comment typoSimon Marlow2010-06-181-1/+1
|
* Patch for shared libraries support on FreeBSDIan Lynagh2010-01-061-56/+66
| | | | From Maxime Henrion <mhenrion@gmail.com>
* Fix warningssimonpj@microsoft.com2010-01-051-5/+3
|
* Tag ForeignCalls with the package they correspond toBen.Lippmeier@anu.edu.au2010-01-021-5/+12
|
* Fix building of the RTS with the NCG under WindowsBen.Lippmeier@anu.edu.au2009-09-261-4/+28
|
* NCG: validate fixes for ppc-darwinBen.Lippmeier@anu.edu.au2009-02-151-3/+2
|
* NCG: Haddock validate fixBen.Lippmeier@anu.edu.au2009-02-151-2/+2
|
* NCG: Split up the native code generator into arch specific modulesBen.Lippmeier@anu.edu.au2009-02-151-0/+746
- 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.