summaryrefslogtreecommitdiff
path: root/compiler/prelude
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge branch 'master' of http://darcs.haskell.org/ghcSimon Peyton Jones2012-12-241-1/+1
|\
| * Make {-# UNPACK #-} work for type/data family invocationsSimon Peyton Jones2012-12-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes most of Trac #3990. Consider data family D a data instance D Double = CD Int Int data T = T {-# UNPACK #-} !(D Double) Then we want the (D Double unpacked). To do this we need to construct a suitable coercion, and it's much safer to record that coercion in the interface file, lest the in-scope instances differ somehow. That in turn means elaborating the HsBang type to include a coercion. To do that I moved HsBang from BasicTypes to DataCon, which caused quite a few minor knock-on changes. Interface-file format has changed! Still to do: need to do knot-tying to allow instances to take effect within the same module.
* | Use expectP in deriving( Read )Simon Peyton Jones2012-12-211-1/+2
|/ | | | | | | | | | | | | Note [Use expectP] in TcGenDeriv ~~~~~~~~~~~~~~~~~~ Note that we use expectP (Ident "T1") rather than Ident "T1" <- lexP The latter desugares to inline code for matching the Ident and the string, and this can be very voluminous. The former is much more compact. Cf Trac #7258, although that also concerned non-linearity in the occurrence analyser, a separate issue.
* Move the kind Nat and Symbol out of TysPrim and into TysWiredInSimon Peyton Jones2012-12-194-14/+31
| | | | | | | | | They properly belong in TysWiredIn, since they are defined in Haskell in GHC.TypeLits. Moveover, make them WiredIn (again as they should be) and use checkWiredInTyCon when encountering them in TcHsType.tc_hs_type, so that the interface file is loaded. This fixes Trac #7502.
* Merge branch 'master' of darcs.haskell.org:/home/darcs/ghcSimon Peyton Jones2012-12-191-1/+2
|\
| * Inline some FastBytes/ByteString wrappersIan Lynagh2012-12-141-1/+2
| | | | | | | | Working towards removing FastBytes
* | Merge branch 'master' of darcs.haskell.org:/home/darcs/ghcSimon Peyton Jones2012-12-141-0/+3
|\ \ | |/ | | | | | | Conflicts: compiler/typecheck/TcTyClsDecls.lhs
| * Implement word2Float# and word2Double#Johan Tibell2012-12-131-0/+3
| |
* | Major refactoring of the way that UNPACK pragmas are handledSimon Peyton Jones2012-12-141-5/+3
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | The situation was pretty dire. The way in which data constructors were handled, notably the mapping between their *source* argument types and their *representation* argument types (after seq'ing and unpacking) was scattered in three different places, and hard to keep in sync. Now it is all in one place: * The dcRep field of a DataCon gives its representation, specified by a DataConRep * As well as having the wrapper, the DataConRep has a "boxer" of type DataConBoxer (defined in MkId for loopy reasons). The boxer used at a pattern match to reconstruct the source-level arguments from the rep-level bindings in the pattern match. * The unboxing in the wrapper and the boxing in the boxer are dual, and are now constructed together, by MkId.mkDataConRep. This is the key function of this change. * All the computeBoxingStrategy code in TcTyClsDcls disappears. Much nicer. There is a little bit of refactoring left to do; the strange deepSplitProductType functions are now called only in WwLib, so I moved them there, and I think they could be tidied up further.
* Added GHC formalism to the GHC source tree.Richard Eisenberg2012-12-011-0/+2
| | | | | | | | | As per a request from Simon PJ, I wrote up a formalism of the core language in GHC, System FC. The writeup lives in docs/core-spec. I also added comments to a number of files dealing with the core language reminding authors to update the formalism when updating the code. In the next commit will be a README file in docs/core-spec with more details of how to do this.
* Revert "Move seq's fixity declaration info primops.txt.pp"Ian Lynagh2012-11-231-1/+0
| | | | | | | This reverts commit eb5196c48480c7dbec25aa175e43b9c20277f29c. For some reason it didn't work, and I don't have time to look into it right now.
* Move seq's fixity declaration info primops.txt.ppIan Lynagh2012-11-231-0/+1
|
* Add fixity information to primops (ticket #6026)Michal Terepeta2012-11-232-2/+37
|
* Remove the nonexistent lazy primop, and follow move from GHC.Base to GHC.MagicIan Lynagh2012-11-131-20/+0
|
* Remove the inline primopIan Lynagh2012-11-131-20/+0
| | | | | It's not really a primop, and GHC.Prim doesn't export it. It has a definition in GHC.Magic.
* Merge branch 'master' of http://darcs.haskell.org/ghcSimon Peyton Jones2012-10-242-0/+43
|\
| * Use fromRational when pre-computing fromRational literalsIan Lynagh2012-10-211-1/+2
| | | | | | | | | | This makes it easier to be confident that the optimisation gives the right answer.
| * add GHC.Float.rationalToFloat, rationalToDouble (fixes #7295)John Lato2012-10-212-0/+42
| | | | | | | | | | | | Adds better support for constant folding of Float/Double literals. - add rationalToFloat, rationalToDouble with associated Name/Id's in PrelNames. - add a matching rule in PrelRules for rationalTo* functions.
* | Merge branch 'master' of http://darcs.haskell.org/ghcSimon Peyton Jones2012-10-221-11/+54
|\ \ | |/
| * Add a rule for (plusAddr# x 0) == x; fixes #7284Ian Lynagh2012-10-211-0/+2
| |
| * Add some more PrimOp rulesIan Lynagh2012-10-211-0/+7
| |
| * Add some more primop rules; fixes #7286Ian Lynagh2012-10-211-11/+45
| | | | | | | | | | As well as the rules mentioned in the ticket, I've also gone through and added some more rules that might be useful in other cases.
* | Merge branch 'master' of http://darcs.haskell.org/ghcSimon Peyton Jones2012-10-192-2/+13
|\ \ | |/
| * Some alpha renamingIan Lynagh2012-10-161-2/+2
| | | | | | | | | | Mostly d -> g (matching DynFlag -> GeneralFlag). Also renamed if* to when*, matching the Haskell if/when names
| * Add a new traceMarker# primop for use in profiling outputDuncan Coutts2012-10-151-0/+11
| | | | | | | | | | | | | | | | | | In time-based profiling visualisations (e.g. heap profiles and ThreadScope) it would be useful to be able to mark particular points in the execution and have those points in time marked in the visualisation. The traceMarker# primop currently emits an event into the eventlog. In principle it could be extended to do something in the heap profiling too.
* | Only promote *non-existential* data constructorsSimon Peyton Jones2012-10-191-3/+3
| | | | | | | | | | | | | | | | I don't konw how this was left out before; Trac #7347. In fixing this I did the usual round of refactoring. In particular, I cached the fact that a DataCon can be promoted in the DataCon itself (the dcPromoted field).
* | Deprecate Rank2Types and PolymorphicComponents, in favour of RankNTypesSimon Peyton Jones2012-10-191-1/+1
|/ | | | | We agreed that it's not worth the bother of trying to maintain all these distinct flags; RankNTypes will do the job fine. Trac #6032.
* Move the primop bits into the compiler/stage<n>/build directoriesIan Lynagh2012-10-101-4/+2
| | | | We shouldn't be generating files in the source directories
* Make -fexcess-precision a fully-dynamic flagIan Lynagh2012-10-091-17/+16
| | | | It used to be part-dynamic, part-static.
* Make the -dsuppress-* flags dynamicIan Lynagh2012-10-091-0/+9
|
* Produce new-style Cmm from the Cmm parserSimon Marlow2012-10-081-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main change here is that the Cmm parser now allows high-level cmm code with argument-passing and function calls. For example: foo ( gcptr a, bits32 b ) { if (b > 0) { // we can make tail calls passing arguments: jump stg_ap_0_fast(a); } return (x,y); } More details on the new cmm syntax are in Note [Syntax of .cmm files] in CmmParse.y. The old syntax is still more-or-less supported for those occasional code fragments that really need to explicitly manipulate the stack. However there are a couple of differences: it is now obligatory to give a list of live GlobalRegs on every jump, e.g. jump %ENTRY_CODE(Sp(0)) [R1]; Again, more details in Note [Syntax of .cmm files]. I have rewritten most of the .cmm files in the RTS into the new syntax, except for AutoApply.cmm which is generated by the genapply program: this file could be generated in the new syntax instead and would probably be better off for it, but I ran out of enthusiasm. Some other changes in this batch: - The PrimOp calling convention is gone, primops now use the ordinary NativeNodeCall convention. This means that primops and "foreign import prim" code must be written in high-level cmm, but they can now take more than 10 arguments. - CmmSink now does constant-folding (should fix #7219) - .cmm files now go through the cmmPipeline, and as a result we generate better code in many cases. All the object files generated for the RTS .cmm files are now smaller. Performance should be better too, but I haven't measured it yet. - RET_DYN frames are removed from the RTS, lots of code goes away - we now have some more canned GC points to cover unboxed-tuples with 2-4 pointers, which will reduce code size a little.
* Merge remote-tracking branch 'origin/master' into tc-untouchablesSimon Peyton Jones2012-09-281-27/+28
|\
| * Make some uses of minBound/maxBound use the target Int/Word sizesIan Lynagh2012-09-191-27/+28
| |
* | Merge remote-tracking branch 'origin/master' into tc-untouchablesSimon Peyton Jones2012-09-181-148/+206
|\ \ | |/
| * Remove the Target* types from HaskellConstantsIan Lynagh2012-09-171-7/+13
| |
| * Move tARGET_* out of HaskellConstantsIan Lynagh2012-09-171-105/+140
| |
| * Pass DynFlags to the ru_try functions of built-in rulesIan Lynagh2012-09-171-41/+58
| |
* | Undo making Any into a type family, for nowSimon Peyton Jones2012-09-181-0/+6
| | | | | | | | | | | | | | | | Making Any a type family is the right thing to do, but it messes up the proxy kind arguments in TypeLits and Singletons, so I'm backing it out for now. More thought required!
* | Make a start towards eta-rules and injective familiesSimon Peyton Jones2012-09-181-3/+14
|/ | | | | | | | | | | | | | | | | | | | * Make Any into a type family (which it should always have been) This is to support the future introduction of eta rules for product types (see email on ghc-users title "PolyKind issue" early Sept 2012) * Add the *internal* data type support for (a) closed type families [so that you can't give type instance for 'Any'] (b) injective type families [because Any is really injective] This amounts to two boolean flags on the SynFamilyTyCon constructor of TyCon.SynTyConRhs. There is some knock-on effect, but all of a routine nature. It remains to offer source syntax for either closed or injective families.
* generalise the type of eqStableName#Simon Marlow2012-08-281-1/+1
| | | | | | Now the StableName#s don't need to have the same type parameters: eqStableName# :: StableName# a -> StableName# b -> Int#
* Fix warning on x86-64Paolo Capriotti2012-07-271-6/+3
|
* Migrate more rules to PrelRules.Paolo Capriotti2012-07-261-9/+37
| | | | | | | | | | Move the following primop rules from GHC.Base to PrelRules: "narrow32Int#" forall x#. narrow32Int# x# = x# "narrow32Word#" forall x#. narrow32Word# x# = x# "int2Word2Int" forall x#. int2Word# (word2Int# x#) = x# "word2Int2Word" forall x#. word2Int# (int2Word# x#) = x#
* Refactor prel rules: always return a single rule.Paolo Capriotti2012-07-241-84/+72
|
* Refactor PrelRules and add more rules (#7014)Paolo Capriotti2012-07-241-246/+334
| | | | | Ported various rules for numeric types from GHC.Base. Added new rules for bitwise operations, shifts and word comparisons.
* Add some more Integer rulesIan Lynagh2012-07-181-10/+14
|
* Implement FastBytes, and use it for MachStrIan Lynagh2012-07-141-1/+1
| | | | | | | | | | | | | This is a first step on the way to refactoring the FastString type. FastBytes currently has no unique, mainly because there isn't currently a nice way to produce them in Binary. Also, we don't currently do the "Dictionary" thing with FastBytes in Binary. I'm not sure whether this is important. We can change both decisions later, but in the meantime this gets the refactoring underway.
* Comments onlySimon Peyton Jones2012-07-141-0/+5
|
* Add some more Integer rules; fixes #6111Ian Lynagh2012-06-272-1/+43
|
* Fix Word64ToInteger conversion rule.Paolo Capriotti2012-06-251-1/+1
|
* Allow deriving Generic1Jose Pedro Magalhaes2012-06-211-3/+10
| | | | | | | | | | | | This completes the support for generic programming introduced in GHC 7.2. Generic1 allows defining generic functions that operate on type containers, such as `fmap`, for instance. Along the way we have fixed #5936 and #5939, allowing deriving Generic/Generic1 for data families, and disallowing deriving Generic/Generic1 for instantiated types. Most of this patch is Nicolas Frisby's work.