summaryrefslogtreecommitdiff
path: root/utils/genprimopcode
Commit message (Collapse)AuthorAgeFilesLines
* Fix typosBrian Wignall2019-11-231-1/+1
|
* Remove unneeded CPP now that GHC 8.6 is the minimumRyan Scott2019-09-251-7/+0
| | | | | | | The minimum required GHC version for bootstrapping is 8.6, so we can get rid of some unneeded `#if `__GLASGOW_HASKELL__` CPP guards, as well as one `MIN_VERSION_ghc_prim(0,5,3)` guard (since GHC 8.6 bundles `ghc-prim-0.5.3`).
* Add MonadFail instance for ParserMErik de Castro Lopo2019-06-241-0/+11
|
* Update Wiki URLs to point to GitLabTakenobu Tani2019-03-252-4/+4
| | | | | | | | | | | | | | | | | | | | | | | This moves all URL references to Trac Wiki to their corresponding GitLab counterparts. This substitution is classified as follows: 1. Automated substitution using sed with Ben's mapping rule [1] Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy... New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy... 2. Manual substitution for URLs containing `#` index Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy...#Zzz New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy...#zzz 3. Manual substitution for strings starting with `Commentary` Old: Commentary/XxxYyy... New: commentary/xxx-yyy... See also !539 [1]: https://gitlab.haskell.org/bgamari/gitlab-migration/blob/master/wiki-mapping.json
* Always do the worker/wrapper split for NOINLINEsSebastian Graf2019-03-071-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trac #10069 revealed that small NOINLINE functions didn't get split into worker and wrapper. This was due to `certainlyWillInline` saying that any unfoldings with a guidance of `UnfWhen` inline unconditionally. That isn't the case for NOINLINE functions, so we catch this case earlier now. Nofib results: -------------------------------------------------------------------------------- Program Allocs Instrs -------------------------------------------------------------------------------- fannkuch-redux -0.3% 0.0% gg +0.0% +0.1% maillist -0.2% -0.2% minimax 0.0% -0.8% -------------------------------------------------------------------------------- Min -0.3% -0.8% Max +0.0% +0.1% Geometric Mean -0.0% -0.0% Fixes #10069. ------------------------- Metric Increase: T9233 -------------------------
* Add AnonArgFlag to FunTySimon Peyton Jones2019-02-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The big payload of this patch is: Add an AnonArgFlag to the FunTy constructor of Type, so that (FunTy VisArg t1 t2) means (t1 -> t2) (FunTy InvisArg t1 t2) means (t1 => t2) The big payoff is that we have a simple, local test to make when decomposing a type, leading to many fewer calls to isPredTy. To me the code seems a lot tidier, and probably more efficient (isPredTy has to take the kind of the type). See Note [Function types] in TyCoRep. There are lots of consequences * I made FunTy into a record, so that it'll be easier when we add a linearity field, something that is coming down the road. * Lots of code gets touched in a routine way, simply because it pattern matches on FunTy. * I wanted to make a pattern synonym for (FunTy2 arg res), which picks out just the argument and result type from the record. But alas the pattern-match overlap checker has a heart attack, and either reports false positives, or takes too long. In the end I gave up on pattern synonyms. There's some commented-out code in TyCoRep that shows what I wanted to do. * Much more clarity about predicate types, constraint types and (in particular) equality constraints in kinds. See TyCoRep Note [Types for coercions, predicates, and evidence] and Note [Constraints in kinds]. This made me realise that we need an AnonArgFlag on AnonTCB in a TyConBinder, something that was really plain wrong before. See TyCon Note [AnonTCB InivsArg] * When building function types we must know whether we need VisArg (mkVisFunTy) or InvisArg (mkInvisFunTy). This turned out to be pretty easy in practice. * Pretty-printing of types, esp in IfaceType, gets tidier, because we were already recording the (->) vs (=>) distinction in an ad-hoc way. Death to IfaceFunTy. * mkLamType needs to keep track of whether it is building (t1 -> t2) or (t1 => t2). See Type Note [mkLamType: dictionary arguments] Other minor stuff * Some tidy-up in validity checking involving constraints; Trac #16263
* Remove warnings-silencing flags for code generated by AlexSimon Jakobi2018-11-221-8/+0
| | | | | | | | | | | | | | | | | | Current versions of Alex don't seem to produce as many warnings any more. In order to silence a warning and to avoid overlong lines, I've taken the liberty of refactoring 'tok_num'. Test Plan: ./validate Reviewers: bgamari, simonmar Reviewed By: simonmar Subscribers: erikd, rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5319
* Introduce Int16# and Word16#Abhiroop Sarkar2018-11-171-1/+3
| | | | | | | | | | | | This builds off of D4475. Bumps binary submodule. Reviewers: carter, AndreasK, hvr, goldfire, bgamari, simonmar Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D5006
* Add Int8# and Word8#Michal Terepeta2018-11-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first step of implementing: https://github.com/ghc-proposals/ghc-proposals/pull/74 The main highlights/changes: primops.txt.pp gets two new sections for two new primitive types for signed and unsigned 8-bit integers (Int8# and Word8 respectively) along with basic arithmetic and comparison operations. PrimRep/RuntimeRep get two new constructors for them. All of the primops translate into the existing MachOPs. For CmmCalls the codegen will now zero-extend the values at call site (so that they can be moved to the right register) and then truncate them back their original width. x86 native codegen needed some updates, since it wasn't able to deal with the new widths, but all the changes are quite localized. LLVM backend seems to just work. This is the second attempt at merging this, after the first attempt in D4475 had to be backed out due to regressions on i386. Bumps binary submodule. Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com> Test Plan: ./validate (on both x86-{32,64}) Reviewers: bgamari, hvr, goldfire, simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5258
* Revert "Add Int8# and Word8#"Ben Gamari2018-10-091-2/+0
| | | | | | | | | This unfortunately broke i386 support since it introduced references to byte-sized registers that don't exist on that architecture. Reverts binary submodule This reverts commit 5d5307f943d7581d7013ffe20af22233273fba06.
* Add Int8# and Word8#Michal Terepeta2018-10-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first step of implementing: https://github.com/ghc-proposals/ghc-proposals/pull/74 The main highlights/changes: - `primops.txt.pp` gets two new sections for two new primitive types for signed and unsigned 8-bit integers (`Int8#` and `Word8` respectively) along with basic arithmetic and comparison operations. `PrimRep`/`RuntimeRep` get two new constructors for them. All of the primops translate into the existing `MachOP`s. - For `CmmCall`s the codegen will now zero-extend the values at call site (so that they can be moved to the right register) and then truncate them back their original width. - x86 native codegen needed some updates, since it wasn't able to deal with the new widths, but all the changes are quite localized. LLVM backend seems to just work. Bumps binary submodule. Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com> Test Plan: ./validate with new tests Reviewers: hvr, goldfire, bgamari, simonmar Subscribers: Abhiroop, dfeuer, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4475
* Set `infixr -1 ->`Alec Theriault2018-10-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This simply makes explicit what is already the case. Due to special treatment in the parser, `->` has the lowest fixity. This patch propagates that information to: * GHCi, where `:info ->` now return the right fixity * TH, where `reifyFixity` returns the right fixity * the generated sources for `GHC.Prim` See #15235. Test Plan: make test Reviewers: bgamari, alanz, RyanGlScott Reviewed By: RyanGlScott Subscribers: int-index, RyanGlScott, rwbarton, mpickering, carter GHC Trac Issues: #15235 Differential Revision: https://phabricator.haskell.org/D5199
* Improve generated `GHC.Prim` docsAlec Theriault2018-10-043-47/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: * Extended `genprimcode` to generate Haddock-compatible deprecations, as well as displaying information about which functions are LLVM-only and which functions can fail with an unchecked exception. * Ported existing deprecations to the new format, and also added a deprecation on `par#` (see Trac #15227). * Emit an error on fixity/deprecation of builtins, unless we are processing the module in which that name is defined (see Trac #15233). That means the following is no longer accepted (outside of `GHC.Types`): ``` infixr 7 : {-# DEPRECATED (:) "cons is deprecated" #-} ``` * Generate `data (->) a b` with docs and fixity in `GHC.Prim`. This means: GHC can now parse `data (->) a b` and `infixr 0 ->` (only in `GHC.Prim`) and `genprimcode` can digest `primtype (->) a b` (See Trac #4861) as well as some misc fixes along the way. Reviewers: bgamari, RyanGlScott Reviewed By: RyanGlScott Subscribers: RyanGlScott, rwbarton, mpickering, carter GHC Trac Issues: #15227, #15233, #4861 Differential Revision: https://phabricator.haskell.org/D5167
* Typofixes [ci skip]Gabor Greif2018-05-291-1/+1
|
* Add HsSyn prettyprinter testsAlan Zimmerman2016-12-072-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add prettyprinter tests, which take a file, parse it, pretty print it, re-parse the pretty printed version and then compare the original and new ASTs (ignoring locations) Updates haddock submodule to match the AST changes. There are three issues outstanding 1. Extra parens around a context are not reproduced. This will require an AST change and will be done in a separate patch. 2. Currently if an `HsTickPragma` is found, this is not pretty-printed, to prevent noise in the output. I am not sure what the desired behaviour in this case is, so have left it as before. Test Ppr047 is marked as expected fail for this. 3. Apart from in a context, the ParsedSource AST keeps all the parens from the original source. Something is happening in the renamer to remove the parens around visible type application, causing T12530 to fail, as the dumped splice decl is after the renamer. This needs to be fixed by keeping the parens, but I do not know where they are being removed. I have amended the test to pass, by removing the parens in the expected output. Test Plan: ./validate Reviewers: goldfire, mpickering, simonpj, bgamari, austin Reviewed By: simonpj, bgamari Subscribers: simonpj, goldfire, thomie, mpickering Differential Revision: https://phabricator.haskell.org/D2752 GHC Trac Issues: #3384
* Compact RegionsGiovanni Campagna2016-07-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This brings in initial support for compact regions, as described in the ICFP 2015 paper "Efficient Communication and Collection with Compact Normal Forms" (Edward Z. Yang et.al.) and implemented by Giovanni Campagna. Some things may change before the 8.2 release, but I (Simon M.) wanted to get the main patch committed so that we can iterate. What documentation there is is in the Data.Compact module in the new compact package. We'll need to extend and polish the documentation before the release. Test Plan: validate (new test cases included) Reviewers: ezyang, simonmar, hvr, bgamari, austin Subscribers: vikraman, Yuras, RyanGlScott, qnikst, mboes, facundominguez, rrnewton, thomie, erikd Differential Revision: https://phabricator.haskell.org/D1264 GHC Trac Issues: #11493
* Address #11471 by putting RuntimeRep in kinds.wip/runtime-repRichard Eisenberg2016-02-241-57/+57
| | | | | | | | | | | | | | | | | | | | | See Note [TYPE] in TysPrim. There are still some outstanding pieces in #11471 though, so this doesn't actually nail the bug. This commit also contains a few performance improvements: * Short-cut equality checking of nullary type syns * Compare types before kinds in eqType * INLINE coreViewOneStarKind * Store tycon binders separately from kinds. This resulted in a ~10% performance improvement in compiling the Cabal package. No change in functionality other than performance. (This affects the interface file format, though.) This commit updates the haddock submodule.
* Work SourceText in for all integer literalsAlan Zimmerman2016-01-163-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Certain syntactic elements have integers in them, such as fixity specifications, SPECIALISE pragmas and so on. The lexer will accept mult-radix literals, with arbitrary leading zeros in these. Bring in a SourceText field to each affected AST element to capture the original literal text for use with API Annotations. Affected hsSyn elements are ``` -- See note [Pragma source text] data Activation = NeverActive | AlwaysActive | ActiveBefore SourceText PhaseNum -- Active only *strictly before* this phase | ActiveAfter SourceText PhaseNum -- Active in this phase and later deriving( Eq, Data, Typeable ) -- Eq used in comparing rules in HsDecls data Fixity = Fixity SourceText Int FixityDirection -- Note [Pragma source text] deriving (Data, Typeable) ``` and ``` | HsTickPragma -- A pragma introduced tick SourceText -- Note [Pragma source text] in BasicTypes (StringLiteral,(Int,Int),(Int,Int)) -- external span for this tick ((SourceText,SourceText),(SourceText,SourceText)) -- Source text for the four integers used in the span. -- See note [Pragma source text] in BasicTypes (LHsExpr id) ``` Updates haddock submodule Test Plan: ./validate Reviewers: goldfire, bgamari, austin Reviewed By: bgamari Subscribers: thomie, mpickering Differential Revision: https://phabricator.haskell.org/D1781 GHC Trac Issues: #11430
* Add Cabal synopses and descriptionsBen Gamari2016-01-051-2/+8
| | | | | | | | | | | | | | | | Various people (myself included) have complained about the lack of useful descriptions for the various packages included in GHC's source tree. Fix this. Test Plan: Validate Reviewers: austin, thomie Reviewed By: thomie Subscribers: angerman, ezyang Differential Revision: https://phabricator.haskell.org/D1736
* drop obsolete/redundant OPTIONS pragma [skip ci]Herbert Valerio Riedel2015-12-291-1/+0
|
* Add kind equalities to GHC.Richard Eisenberg2015-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Build system: cabalise deriveConstants + genprimopcodeThomas Miedema2015-10-302-3/+26
| | | | | | | | | This is needed for #10374 (but doesn't fix it yet). Also rename DeriveConstants.hs to Main.hs, because the build system has trouble with Main modules not called Main.hs. Differential Revision: https://phabricator.haskell.org/D1380
* Refactor: delete most of the module FastTypesThomas Miedema2015-08-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverses some of the work done in #1405, and goes back to the assumption that the bootstrap compiler understands GHC-haskell. In particular: * use MagicHash instead of _ILIT and _CLIT * pattern matching on I# if possible, instead of using iUnbox unnecessarily * use Int#/Char#/Addr# instead of the following type synonyms: - type FastInt = Int# - type FastChar = Char# - type FastPtr a = Addr# * inline the following functions: - iBox = I# - cBox = C# - fastChr = chr# - fastOrd = ord# - eqFastChar = eqChar# - shiftLFastInt = uncheckedIShiftL# - shiftR_FastInt = uncheckedIShiftRL# - shiftRLFastInt = uncheckedIShiftRL# * delete the following unused functions: - minFastInt - maxFastInt - uncheckedIShiftRA# - castFastPtr - panicDocFastInt and pprPanicFastInt * rename panicFastInt back to panic# These functions remain, since they actually do something: * iUnbox * bitAndFastInt * bitOrFastInt Test Plan: validate Reviewers: austin, bgamari Subscribers: rwbarton Differential Revision: https://phabricator.haskell.org/D1141 GHC Trac Issues: #1405
* Add Note [Warnings in code generated by Alex]Thomas Miedema2015-07-071-5/+1
| | | | Differential Revision: https://phabricator.haskell.org/D1044
* Replace usages of `-w` by `-fno-warn`sThomas Miedema2015-07-042-15/+11
| | | | | | | | | | | And remove unused imports and language pragmas. I checked that the minimum Happy and Alex version requirements, as listed in aclocal.m4, don't have to change. Before building ghc, I ran: - cabal install happy==1.19.4 --with-ghc=ghc-7.8.4 - cabal install alex==3.1.0 --with-ghc=ghc-7.6.3 Differential Revision: https://phabricator.haskell.org/D1032
* Refactor tuple constraintsSimon Peyton Jones2015-05-181-12/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make tuple constraints be handled by a perfectly ordinary type class, with the component constraints being the superclasses: class (c1, c2) => (c2, c2) This change was provoked by #10359 inability to re-use a given tuple constraint as a whole #9858 confusion between term tuples and constraint tuples but it's generally a very nice simplification. We get rid of - In Type, the TuplePred constructor of PredTree, and all the code that dealt with TuplePreds - In TcEvidence, the constructors EvTupleMk, EvTupleSel See Note [How tuples work] in TysWiredIn. Of course, nothing is ever entirely simple. This one proved quite fiddly. - I did quite a bit of renaming, which makes this patch touch a lot of modules. In partiuclar tupleCon -> tupleDataCon. - I made constraint tuples known-key rather than wired-in. This is different to boxed/unboxed tuples, but it proved awkward to have all the superclass selectors wired-in. Easier just to use the standard mechanims. - While I was fiddling with known-key names, I split the TH Name definitions out of DsMeta into a new module THNames. That meant that the known-key names can all be gathered in PrelInfo, without causing module loops. - I found that the parser was parsing an import item like T( .. ) as a *data constructor* T, and then using setRdrNameSpace to fix it. Stupid! So I changed the parser to parse a *type constructor* T, which means less use of setRdrNameSpace. I also improved setRdrNameSpace to behave better on Exact Names. Largely on priciple; I don't think it matters a lot. - When compiling a data type declaration for a wired-in thing like tuples (,), or lists, we don't really need to look at the declaration. We have the wired-in thing! And not doing so avoids having to line up the uniques for data constructor workers etc. See Note [Declarations for wired-in things] - I found that FunDeps.oclose wasn't taking superclasses into account; easily fixed. - Some error message refactoring for invalid constraints in TcValidity - Haddock needs to absorb the change too; so there is a submodule update
* Revert multiple commitsAustin Seipp2015-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | This reverts multiple commits from Simon: - 04a484eafc9eb9f8774b4bdd41a5dc6c9f640daf Test Trac #10359 - a9ccd37add8315e061c02e5bf26c08f05fad9ac9 Test Trac #10403 - c0aae6f699cbd222d826d0b8d78d6cb3f682079e Test Trac #10248 - eb6ca851f553262efe0824b8dcbe64952de4963d Make the "matchable-given" check happen first - ca173aa30467a0b1023682d573fcd94244d85c50 Add a case to checkValidTyCon - 51cbad15f86fca1d1b0e777199eb1079a1b64d74 Update haddock submodule - 6e1174da5b8e0b296f5bfc8b39904300d04eb5b7 Separate transCloVarSet from fixVarSet - a8493e03b89f3b3bfcdb6005795de050501f5c29 Fix imports in HscMain (stage2) - a154944bf07b2e13175519bafebd5a03926bf105 Two wibbles to fix the build - 5910a1bc8142b4e56a19abea104263d7bb5c5d3f Change in capitalisation of error msg - 130e93aab220bdf14d08028771f83df210da340b Refactor tuple constraints - 8da785d59f5989b9a9df06386d5bd13f65435bc0 Delete commented-out line These break the build by causing Haddock to fail mysteriously when trying to examine GHC.Prim it seems.
* Refactor tuple constraintsSimon Peyton Jones2015-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make tuple constraints be handled by a perfectly ordinary type class, with the component constraints being the superclasses: class (c1, c2) => (c2, c2) This change was provoked by #10359 inability to re-use a given tuple constraint as a whole #9858 confusion between term tuples and constraint tuples but it's generally a very nice simplification. We get rid of - In Type, the TuplePred constructor of PredTree, and all the code that dealt with TuplePreds - In TcEvidence, the constructors EvTupleMk, EvTupleSel See Note [How tuples work] in TysWiredIn. Of course, nothing is ever entirely simple. This one proved quite fiddly. - I did quite a bit of renaming, which makes this patch touch a lot of modules. In partiuclar tupleCon -> tupleDataCon. - I made constraint tuples known-key rather than wired-in. This is different to boxed/unboxed tuples, but it proved awkward to have all the superclass selectors wired-in. Easier just to use the standard mechanims. - While I was fiddling with known-key names, I split the TH Name definitions out of DsMeta into a new module THNames. That meant that the known-key names can all be gathered in PrelInfo, without causing module loops. - I found that the parser was parsing an import item like T( .. ) as a *data constructor* T, and then using setRdrNameSpace to fix it. Stupid! So I changed the parser to parse a *type constructor* T, which means less use of setRdrNameSpace. I also improved setRdrNameSpace to behave better on Exact Names. Largely on priciple; I don't think it matters a lot. - When compiling a data type declaration for a wired-in thing like tuples (,), or lists, we don't really need to look at the declaration. We have the wired-in thing! And not doing so avoids having to line up the uniques for data constructor workers etc. See Note [Declarations for wired-in things] - I found that FunDeps.oclose wasn't taking superclasses into account; easily fixed. - Some error message refactoring for invalid constraints in TcValidity
* Typos in error messages and in commentsGabor Greif2015-04-102-2/+2
|
* Update list of primops that don't get wrappers (#10191)Reid Barton2015-03-271-6/+4
| | | | | | | | | | | | | | | | | | | Summary: The list was 14 years old, and there don't seem to be any problems with seq# or par#; the other par*# primops were not actually implemented at all and were removed in D758. Test Plan: validate; will also try to locally validate an unregisterised build in case there was some truth to the deleted comment Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D759 GHC Trac Issues: #10191
* Delete vestigial external core code (#9402)Thomas Miedema2015-02-171-120/+0
| | | | | | | | | | | | | | Test Plan: harbormaster Reviewers: austin Reviewed By: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D659 GHC Trac Issues: #9402
* Another fix to genprimopcode, when generating Prim.hsSimon Peyton Jones2015-01-061-1/+17
| | | | | | | | | When haddock processes Prim.hs, it was calling TcEnv.tcGetDefaultTys, and that made it look for Integer and String, which are not in ghc-prim. Result was a crash. But we don't need defaulting in Prim.hs, so add default ()
* Update haddock submodule, and fix haddock input file from genprimopcodeSimon Peyton Jones2015-01-061-0/+6
| | | | | | | | | * A module in haddock an unused constraint, now fixed and pushed to ghc-head This patch records the new commit in GHC repo * genprimopcode generates a dummy Prim.hs for haddock. But then Haddock was complaining about redundant constraints. So this patch makes genprimopcode generate a warning-suppression OPTIONS_GHC pragma in Prim.hs
* Avoid redundant-import warning (w/o CPP)Herbert Valerio Riedel2014-12-271-0/+3
|
* genprimopcode: GHC.Prim is Unsafe (#9449)Austin Seipp2014-09-011-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Make sure the documentation for `GHC.Prim` adequately reflects the fact it is unsafe. Also clean up some 80-column violations. Signed-off-by: Austin Seipp <austin@well-typed.com> Test Plan: Build documentation, check `GHC.Prim`. It's properly marked as `Unsafe`. Reviewers: hvr, goldfire, ezyang Reviewed By: ezyang Subscribers: nomeata, simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D182 GHC Trac Issues: #9449
* genprimopcode: Don't output tabsAustin Seipp2014-08-201-2/+2
| | | | | | | Otherwise the build breaks, because its output is included in tab-free files. See ef9dd9f. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Remove external coreAustin Seipp2014-05-031-5/+1
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Add SmallArray# and SmallMutableArray# typesJohan Tibell2014-03-291-0/+3
| | | | | | | | | | | | | | | These array types are smaller than Array# and MutableArray# and are faster when the array size is small, as they don't have the overhead of a card table. Having no card table reduces the closure size with 2 words in the typical small array case and leads to less work when updating or GC:ing the array. Reduces both the runtime and memory allocation by 8.8% on my insert benchmark for the HashMap type in the unordered-containers package, which makes use of lots of small arrays. With tuned GC settings (i.e. `+RTS -A6M`) the runtime reduction is 15%. Fixes #8923.
* Remove support for "primclass"Joachim Breitner2014-03-165-23/+0
| | | | | | This partly reverts commit e239753c349f925b576b72dc3445934cba8bcd50. Since Coercible is exported via GHC.Types, so "primclass" is no longer needed. The support for => in primops.pp is still required for coerce.
* Coercible is now exported from GHC.Types (#8894)Joachim Breitner2014-03-161-0/+1
| | | | | so do not export it in GHC.Prim, and also have the pseudo-code for GHC.Prim import GHC.Types, so that haddock is happy.
* genprimopcode: Applicative instance for ParserMAustin Seipp2014-01-141-1/+9
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Add more missing `{-# LANGUAGE #-}`s to `genprimopcode` outputHerbert Valerio Riedel2013-10-271-2/+2
| | | | | | | | | | | This is a follow-up to 0620241a0f09d1ff865fa575eadb61aa59d2fe4f which addressed only the `Prim.hs` output; this commit adds the missing `LANGUAGE` pragmas for the generated `PrimopWrappers.hs` output as well. While at it, the redundant `CPP` pragma is removed from the generated `Prim.hs` file. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Add `{-# LANGUAGE MagicHash #-}` in output of `genprimopcode`Herbert Valerio Riedel2013-10-271-1/+1
| | | | Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Globally replace "hackage.haskell.org" with "ghc.haskell.org"Simon Marlow2013-10-014-6/+6
|
* SIMD primops are now generated using schemas that are polymorphic inGeoffrey Mainland2013-09-225-88/+372
| | | | | | | | | | | | | width and element type. SIMD primops are now polymorphic in vector size and element type, but only internally to the compiler. More specifically, utils/genprimopcode has been extended so that it "knows" about SIMD vectors. This allows us to, for example, write a single definition for the "add two vectors" primop in primops.txt.pp and have it instantiated at many vector types. This generates a primop in GHC.Prim for each vector type at which "add two vectors" is instantiated, but only one data constructor for the PrimOp data type, so the code generator is much, much simpler.
* Do not expose LLVM-only primops in GHC.PrimopWrappers.Geoffrey Mainland2013-09-221-20/+7
| | | | | GHC.PrimopWrappers is only used by GHCi, which cannot evaluate LLVM-only primops in any case.
* Allow primclass and class constraints in primopsJoachim Breitner2013-09-135-9/+48
| | | | In preparation for the primitive class Coercible
* Update email addressesGabor Greif2013-08-221-1/+1
|
* Comparison primops return Int# (Fixes #6135)Jan Stolarek2013-08-142-4/+1
| | | | | | | | | | | | This patch modifies all comparison primops for Char#, Int#, Word#, Double#, Float# and Addr# to return Int# instead of Bool. A value of 1# represents True and 0# represents False. For a more detailed description of motivation for this change, discussion of implementation details and benchmarking results please visit the wiki page: http://hackage.haskell.org/trac/ghc/wiki/PrimBool There's also some cleanup: whitespace fixes in files that were extensively edited in this patch and constant folding rules for Integer div and mod operators (which for some reason have been left out up till now).
* Automatically add the $(exeext) to program namesIan Lynagh2013-03-031-1/+1
| | | | | | | We now define _PROGNAME, and _PROG is automatically defined with $(exeext). This will shortly automatically use the right exeext depending on what stage it is being compiled with (exeext may be different for different stages when cross-compiling).