summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/SPARC/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* SPARC nativeGen: Support for MO_SS_Conv_W32_W64Peter Trommler2018-03-191-0/+18
| | | | | | | | | | | | | | | Support for signed conversion from 32 bit to 64 bit integers is required by D4363. Test Plan: validate (perhaps also on SPARC) Reviewers: simonmar, bgamari, kgardas, jrtc27 Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4489
* Get rid of some stuttering in comments and docsGabor Greif2017-12-191-1/+1
|
* compiler: introduce custom "GhcPrelude" PreludeHerbert Valerio Riedel2017-09-197-0/+14
| | | | | | | | | | | | | | | | | | This switches the compiler/ component to get compiled with -XNoImplicitPrelude and a `import GhcPrelude` is inserted in all modules. This is motivated by the upcoming "Prelude" re-export of `Semigroup((<>))` which would cause lots of name clashes in every modulewhich imports also `Outputable` Reviewers: austin, goldfire, bgamari, alanz, simonmar Reviewed By: bgamari Subscribers: goldfire, rwbarton, thomie, mpickering, bgamari Differential Revision: https://phabricator.haskell.org/D3989
* Nix typo and redundant where-clausesRyan Scott2017-01-251-2/+0
|
* Add kind equalities to GHC.Richard Eisenberg2015-12-111-34/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements the ideas originally put forward in "System FC with Explicit Kind Equality" (ICFP'13). There are several noteworthy changes with this patch: * We now have casts in types. These change the kind of a type. See new constructor `CastTy`. * All types and all constructors can be promoted. This includes GADT constructors. GADT pattern matches take place in type family equations. In Core, types can now be applied to coercions via the `CoercionTy` constructor. * Coercions can now be heterogeneous, relating types of different kinds. A coercion proving `t1 :: k1 ~ t2 :: k2` proves both that `t1` and `t2` are the same and also that `k1` and `k2` are the same. * The `Coercion` type has been significantly enhanced. The documentation in `docs/core-spec/core-spec.pdf` reflects the new reality. * The type of `*` is now `*`. No more `BOX`. * Users can write explicit kind variables in their code, anywhere they can write type variables. For backward compatibility, automatic inference of kind-variable binding is still permitted. * The new extension `TypeInType` turns on the new user-facing features. * Type families and synonyms are now promoted to kinds. This causes trouble with parsing `*`, leading to the somewhat awkward new `HsAppsTy` constructor for `HsType`. This is dispatched with in the renamer, where the kind `*` can be told apart from a type-level multiplication operator. Without `-XTypeInType` the old behavior persists. With `-XTypeInType`, you need to import `Data.Kind` to get `*`, also known as `Type`. * The kind-checking algorithms in TcHsType have been significantly rewritten to allow for enhanced kinds. * The new features are still quite experimental and may be in flux. * TODO: Several open tickets: #11195, #11196, #11197, #11198, #11203. * TODO: Update user manual. Tickets addressed: #9017, #9173, #7961, #10524, #8566, #11142. Updates Haddock submodule.
* Implement function-sections for Haskell code, #8405Simon Brenner2015-11-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a flag -split-sections that does similar things to -split-objs, but using sections in single object files instead of relying on the Satanic Splitter and other abominations. This is very similar to the GCC flags -ffunction-sections and -fdata-sections. The --gc-sections linker flag, which allows unused sections to actually be removed, is added to all link commands (if the linker supports it) so that space savings from having base compiled with sections can be realized. Supported both in LLVM and the native code-gen, in theory for all architectures, but really tested on x86 only. In the GHC build, a new SplitSections variable enables -split-sections for relevant parts of the build. Test Plan: validate with both settings of SplitSections Reviewers: dterei, Phyx, austin, simonmar, thomie, bgamari Reviewed By: simonmar, thomie, bgamari Subscribers: hsyl20, erikd, kgardas, thomie Differential Revision: https://phabricator.haskell.org/D1242 GHC Trac Issues: #8405
* Fix todo in compiler/nativeGen: Rename Size to Formatmarkus2015-07-076-49/+49
| | | | | | | | | | | | | | | | | | This commit renames the Size module in the native code generator to Format, as proposed by a todo, as well as adjusting parameter names in other modules that use it. Test Plan: validate Reviewers: austin, simonmar, bgamari Reviewed By: simonmar, bgamari Subscribers: bgamari, simonmar, thomie Projects: #ghc Differential Revision: https://phabricator.haskell.org/D865
* nativeGen: detabify/dewhitespace SPARC/CodeGen/BaseAustin Seipp2014-07-201-53/+41
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* nativeGen: detabify/dewhitespace SPARC/CodeGen/Gen32Austin Seipp2014-07-201-373/+361
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* nativeGen: detabify/dewhitespace SPARC/CodeGen/SanityAustin Seipp2014-07-201-53/+42
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* nativeGen: detabify/dewhitespace SPARC/CodeGen/ExpandAustin Seipp2014-07-201-106/+91
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* nativeGen: detabify/dewhitespace SPARC/CodeGen/AmodeAustin Seipp2014-07-201-23/+15
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* nativeGen: detabify/dewhitespace SPARC/CodeGen/CondCodeAustin Seipp2014-07-201-29/+21
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Add LANGUAGE pragmas to compiler/ source filesHerbert Valerio Riedel2014-05-156-6/+6
| | | | | | | | | | | | | | | | | | In some cases, the layout of the LANGUAGE/OPTIONS_GHC lines has been reorganized, while following the convention, to - place `{-# LANGUAGE #-}` pragmas at the top of the source file, before any `{-# OPTIONS_GHC #-}`-lines. - Moreover, if the list of language extensions fit into a single `{-# LANGUAGE ... -#}`-line (shorter than 80 characters), keep it on one line. Otherwise split into `{-# LANGUAGE ... -#}`-lines for each individual language extension. In both cases, try to keep the enumeration alphabetically ordered. (The latter layout is preferable as it's more diff-friendly) While at it, this also replaces obsolete `{-# OPTIONS ... #-}` pragma occurences by `{-# OPTIONS_GHC ... #-}` pragmas.
* Fix a popular typo in commentsGabor Greif2014-02-011-1/+1
|
* Globally replace "hackage.haskell.org" with "ghc.haskell.org"Simon Marlow2013-10-016-6/+6
|
* Remove dead codeJan Stolarek2013-09-101-0/+1
|
* Remove tabs (M-x untabify)Gabor Greif2013-04-071-99/+91
|
* Fix typosGabor Greif2013-04-071-1/+1
|
* Remove OldCmm, convert backends to consume new CmmSimon Marlow2012-11-128-10/+9
| | | | | | | | | | | | | | | | | | 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-2/+2
| | | | | | | 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.
* Pass DynFlags down to bWordIan Lynagh2012-09-124-12/+17
| | | | | | 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.
* Move more code into codeGen/CodeGen/Platform.hsIan Lynagh2012-08-282-7/+11
| | | | | | | | HaskellMachRegs.h is no longer included in anything under compiler/ Also, includes/CodeGen.Platform.hs now includes "stg/MachRegs.h" rather than <stg/MachRegs.h> which means that we always get the file from the tree, rather than from the bootstrapping compiler.
* Remove some more Platform argumentsIan Lynagh2012-06-131-4/+2
|
* Remove PlatformOutputableIan Lynagh2012-06-133-10/+6
| | | | | We can now get the Platform from the DynFlags inside an SDoc, so we no longer need to pass the Platform in.
* Define a quotRem CallishMachOp; fixes #5598Ian Lynagh2012-02-141-343/+0
| | | | | This means we no longer do a division twice when we are using quotRem (on platforms on which the op is supported; currently only amd64).
* de-tabbed the hs-boot filesIan Lynagh2012-01-261-9/+2
|
* Make getDynFlags* functions use HasDynFlags/getDynFlags tooIan Lynagh2011-12-193-6/+6
|
* Tabs -> SpacesDavid Terei2011-11-221-184/+178
|
* Explicitly handle unsupported Cmm prim ops.David Terei2011-11-221-2/+5
|
* Use -fwarn-tabs when validatingIan Lynagh2011-11-049-0/+63
| | | | | We only use it for "compiler" sources, i.e. not for libraries. Many modules have a -fno-warn-tabs kludge for now.
* More CPP removal: pprDynamicLinkerAsmLabel in CLabelIan Lynagh2011-10-022-3/+7
| | | | And some knock-on changes
* Renaming onlySimon Peyton Jones2011-08-251-1/+1
| | | | | CmmTop -> CmmDecl CmmPgm -> CmmGroup
* Add popCnt# primopJohan Tibell2011-08-161-0/+3
|
* Remove more defaultTargetPlatform usesIan Lynagh2011-07-152-11/+17
|
* More work towards cross-compilationIan Lynagh2011-07-151-6/+8
| | | | | | | | | | | | 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.
* Refactoring: use a structured CmmStatics type rather than [CmmStatic]Max Bolingbroke2011-07-052-7/+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.
* 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>
* Fix some validation errorsDavid Terei2011-05-311-2/+2
|
* Add new mem{cpy,set,move} cmm prim ops.David Terei2011-05-311-8/+22
|
* Merge in new code generator branch.Simon Marlow2011-01-249-16/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-151-5/+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.
* Tag ForeignCalls with the package they correspond toBen.Lippmeier@anu.edu.au2010-01-021-1/+1
|
* Split Reg into vreg/hreg and add register pairsBen.Lippmeier@anu.edu.au2009-05-185-14/+176
| | | | | | | | | | | | | * 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.
* SPARC NCG: Fix 64 bit addition, carry bit wasn't getting set.Ben.Lippmeier@anu.edu.au2009-03-301-9/+22
|
* SPARC NCG: Split out sanity checking into its own moduleBen.Lippmeier@anu.edu.au2009-02-231-0/+70
|
* SPARC NCG: Add jumps to end of blocks when working out condition codesBen.Lippmeier@anu.edu.au2009-02-231-15/+39
|
* 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-167-0/+1442