summaryrefslogtreecommitdiff
path: root/compiler/cmm/PprC.hs
Commit message (Collapse)AuthorAgeFilesLines
...
* GHC 7.4 is now required for building HEADIan Lynagh2012-07-201-4/+0
|
* Remove redundant Platform arguments in cmm/PprC.hsIan Lynagh2012-07-191-140/+137
|
* Pass DynFlags down to printForC and printForAsmIan Lynagh2012-06-111-1/+1
|
* Cast memory primops in the C backend (#5976)Paolo Capriotti2012-05-021-16/+25
| | | | | | | To prevent conflicts with GCC builtins, generate identical code for calls to mem primos and FFI calls. Based on a patch by Joachim Breitner.
* Add a quotRemWord2 primopIan Lynagh2012-04-211-5/+6
| | | | | | | | It allows you to do (high, low) `quotRem` d provided high < d. Currently only has an inefficient fallback implementation.
* Fix PprC for 64bit platforms with 32bit long'sIan Lynagh2012-03-151-4/+5
| | | | e.g. Win64
* Fix the unregisterised build; fixes #5901Ian Lynagh2012-02-271-4/+10
|
* Add a 2-word-multiply operatorIan Lynagh2012-02-241-0/+1
| | | | Currently no NCGs support it
* Add a Word add-with-carry primopIan Lynagh2012-02-231-5/+4
| | | | No special-casing in any NCGs yet
* Add a primop for unsigned quotRem; part of #5598Ian Lynagh2012-02-171-0/+1
| | | | Only amd64 has an efficient implementation currently.
* Define a quotRem CallishMachOp; fixes #5598Ian Lynagh2012-02-141-1/+9
| | | | | 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).
* Track STG live register information for use in LLVMDavid Terei2012-01-091-2/+2
| | | | | | | | | We now carry around with CmmJump statements a list of the STG registers that are live at that jump site. This is used by the LLVM backend so it can avoid unnesecarily passing around dead registers, improving perfromance. This gives us the framework to finally fix trac #4308.
* Remove unused arg field of CmmReturnDavid Terei2012-01-051-1/+1
|
* Remove unused argument field on CmmJumpDavid Terei2012-01-051-2/+2
|
* Fix for unregisterised compilation: isStrangeTypeGlobal CCCS = TrueSimon Marlow2012-01-051-0/+2
| | | | Needed by #5357
* Fix the C backend after making CCCS an STG registerSimon Marlow2012-01-031-0/+1
|
* Remove old mangler commentDavid Terei2011-12-031-3/+0
|
* Get rid of the "safety" field of CmmCall (OldCmm)Simon Marlow2011-11-291-10/+10
| | | | | This field was doing nothing. I think it originally appeared in a very old incarnation of the new code generator.
* Implement a capi calling convention; fixes #2979Ian Lynagh2011-11-281-0/+1
| | | | | | | | | In GHC, this provides an easy way to call a C function via a C wrapper. This is important when the function is really defined by CPP. Requires the new CApiFFI extension. Not documented yet, as it's still an experimental feature at this stage.
* Small refactoringIan Lynagh2011-11-261-1/+1
|
* Formatting fixesDavid Terei2011-11-221-16/+16
|
* Specify unsupported ops, don't just use a catch allDavid Terei2011-11-221-13/+17
| | | | | | | | Better to specifically list the unsupported cases in code than to have a catch all that panics. The later method hides problems when new constructors are added such as the recent additions to the supported Cmm prim ops that weren't ported to the C backend since no one noticed.
* Remove registerised code for dead architectures: mips, ia64, alpha,David Terei2011-11-221-3/+0
| | | | hppa1, m68k
* Fix missing primop in PprCDavid Terei2011-11-221-2/+3
|
* Formatting of PprCDavid Terei2011-11-221-42/+41
|
* Tabs -> SpacesDavid Terei2011-11-221-175/+168
|
* 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.
* A little more CPP removalIan Lynagh2011-10-191-14/+15
|
* Pass Platform to pprExpr1Ben Gamari2011-10-171-1/+1
| | | | | | | | | | | | Fixes build error: compiler/cmm/PprC.hs:961:33: Couldn't match expected type `Platform' against inferred type `CmmExpr' In the first argument of `pprExpr1', namely `expr' In the second argument of `(<+>)', namely `pprExpr1 expr' In the first argument of `parens', namely `(cast <+> pprExpr1 expr)'
* More CPP removal: pprDynamicLinkerAsmLabel in CLabelIan Lynagh2011-10-021-125/+128
| | | | And some knock-on changes
* Renaming onlySimon Peyton Jones2011-08-251-4/+4
| | | | | CmmTop -> CmmDecl CmmPgm -> CmmGroup
* Snapshot of codegen refactoring to share with simonpjSimon Marlow2011-08-251-4/+4
|
* fix some #ifdefs that were making compilation with 7.2.1 fail - theSimon Marlow2011-08-141-1/+1
| | | | safified array package is not in 7.2.1
* Fix import DEPRECATE failures for castSTUArraySimon Peyton Jones2011-08-021-0/+7
|
* Refactoring: explicitly mark whether we have an info table in RawCmmMax Bolingbroke2011-07-061-5/+5
| | | | | | | | | | | | 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-2/+0
|
* Refactoring: use a structured CmmStatics type rather than [CmmStatic]Max Bolingbroke2011-07-051-14/+4
| | | | | | | | | | | | | | | | | | 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.
* Fix warnings in PprCDavid Terei2011-06-231-40/+48
|
* Add support for new mem primops to C backendDavid Terei2011-06-231-9/+9
|
* Remove type synonyms for CmmFormals, CmmActuals (and hinted versions).Edward Z. Yang2011-06-131-2/+2
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Remove some dead codeIan Lynagh2011-05-071-15/+0
| | | | Not needed now that we don't support registerised via-C compilation.
* Don't expose the cas definition to .hc filesIan Lynagh2011-04-301-1/+1
| | | | | This is more pleasant than having the C generator check whether the function it's calling is cas, and not generate a prototype if so.
* Don't generate a prototype for casIan Lynagh2011-04-201-1/+1
| | | | | I'm not sure if this is the best way to fix this, but it fixes the unreg build.
* Change the way module initialisation is done (#3252, #4417)Simon Marlow2011-04-121-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the code generator generated small code fragments labelled with __stginit_M for each module M, and these performed whatever initialisation was necessary for that module and recursively invoked the initialisation functions for imported modules. This appraoch had drawbacks: - FFI users had to call hs_add_root() to ensure the correct initialisation routines were called. This is a non-standard, and ugly, API. - unless we were using -split-objs, the __stginit dependencies would entail linking the whole transitive closure of modules imported, whether they were actually used or not. In an extreme case (#4387, #4417), a module from GHC might be imported for use in Template Haskell or an annotation, and that would force the whole of GHC to be needlessly linked into the final executable. So now instead we do our initialisation with C functions marked with __attribute__((constructor)), which are automatically invoked at program startup time (or DSO load-time). The C initialisers are emitted into the stub.c file. This means that every time we compile with -prof or -hpc, we now get a stub file, but thanks to #3687 that is now invisible to the user. There are some refactorings in the RTS (particularly for HPC) to handle the fact that initialisers now get run earlier than they did before. The __stginit symbols are still generated, and the hs_add_root() function still exists (but does nothing), for backwards compatibility.
* Force re-linking if the options have changed (#4451)Simon Marlow2011-04-081-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A common sequence of commands (at least for me) is this: $ ghc hello 1 of 1] Compiling Main ( hello.hs, hello.o ) Linking hello ... $ ./hello +RTS -s hello: Most RTS options are disabled. Link with -rtsopts to enable them. $ ghc hello -rtsopts $ grr, nothing happened. I could use -fforce-recomp, but if this was a large program I probably don't want to recompile it all again, so: $ rm hello removed `hello' $ ghc hello -rtsopts Linking hello ... $ ./hello +RTS -s ./hello +RTS -s Hello World! 51,264 bytes allocated in the heap 2,904 bytes copied during GC 43,808 bytes maximum residency (1 sample(s)) 17,632 bytes maximum slop etc. With this patch, GHC notices when the options have changed and forces a relink, so you don't need to rm the binary or use -fforce-recomp. This is done by adding the pertinent stuff to the binary in a special section called ".debug-ghc-link-info": $ readelf -p .debug-ghc-link-info ./hello String dump of section 'ghc-linker-opts': [ 0] (["-lHSbase-4.3.1.0","-lHSinteger-gmp-0.2.0.2","-lgmp","-lHSghc-prim-0.2.0.0","-lHSrts","-lm","-lrt","-ldl","-u","ghczmprim_GHCziTypes_Izh_static_info","-u","ghczmprim_GHCziTypes_Czh_static_info","-u","ghczmprim_GHCziTypes_Fzh_static_info","-u","ghczmprim_GHCziTypes_Dzh_static_info","-u","base_GHCziPtr_Ptr_static_info","-u","base_GHCziWord_Wzh_static_info","-u","base_GHCziInt_I8zh_static_info","-u","base_GHCziInt_I16zh_static_info","-u","base_GHCziInt_I32zh_static_info","-u","base_GHCziInt_I64zh_static_info","-u","base_GHCziWord_W8zh_static_info","-u","base_GHCziWord_W16zh_static_info","-u","base_GHCziWord_W32zh_static_info","-u","base_GHCziWord_W64zh_static_info","-u","base_GHCziStable_StablePtr_static_info","-u","ghczmprim_GHCziTypes_Izh_con_info","-u","ghczmprim_GHCziTypes_Czh_con_info","-u","ghczmprim_GHCziTypes_Fzh_con_info","-u","ghczmprim_GHCziTypes_Dzh_con_info","-u","base_GHCziPtr_Ptr_con_info","-u","base_GHCziPtr_FunPtr_con_info","-u","base_GHCziStable_StablePtr_con_info","-u","ghczmprim_GHCziTypes_False_closure","-u","ghczmprim_GHCziTypes_True_closure","-u","base_GHCziPack_unpackCString_closure","-u","base_GHCziIOziException_stackOverflow_closure","-u","base_GHCziIOziException_heapOverflow_closure","-u","base_ControlziExceptionziBase_nonTermination_closure","-u","base_GHCziIOziException_blockedIndefinitelyOnMVar_closure","-u","base_GHCziIOziException_blockedIndefinitelyOnSTM_closure","-u","base_ControlziExceptionziBase_nestedAtomically_closure","-u","base_GHCziWeak_runFinalizzerBatch_closure","-u","base_GHCziTopHandler_runIO_closure","-u","base_GHCziTopHandler_runNonIO_closure","-u","base_GHCziConcziIO_ensureIOManagerIsRunning_closure","-u","base_GHCziConcziSync_runSparks_closure","-u","base_GHCziConcziSignal_runHandlers_closure","-lHSffi"],Nothing,RtsOptsAll,False,[],[]) And GHC itself uses the readelf command to extract it when deciding whether to relink. The reason for the name ".debug-ghc-link-info" is that sections beginning with ".debug" are removed automatically by strip. This currently only works on Linux; Windows and OS X still have the old behaviour.
* Merge in new code generator branch.Simon Marlow2011-01-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove (most of) the FiniteMap wrapperIan Lynagh2010-09-141-6/+7
| | | | | | | | We still have insertList, insertListWith, deleteList which aren't in Data.Map, and foldRightWithKey which works around the fold(r)WithKey addition and deprecation.
* Add Outputable.blankLine and use itsimonpj@microsoft.com2009-10-291-2/+2
|
* remove dead codeSimon Marlow2009-06-201-12/+1
|
* Fix calling maths functions when compiling via CIan Lynagh2009-02-061-1/+2
|