summaryrefslogtreecommitdiff
path: root/compiler/codeGen/StgCmmPrim.hs
Commit message (Collapse)AuthorAgeFilesLines
...
* Whitespace only in codeGen/StgCmmPrim.hsIan Lynagh2012-11-011-90/+83
|
* Some alpha renamingIan Lynagh2012-10-161-1/+1
| | | | | Mostly d -> g (matching DynFlag -> GeneralFlag). Also renamed if* to when*, matching the Haskell if/when names
* Fix copyArray# bug in new code generatorRoman Leshchinskiy2012-10-081-17/+22
|
* Produce new-style Cmm from the Cmm parserSimon Marlow2012-10-081-2/+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.
* Move wORD_SIZE into platformConstantsIan Lynagh2012-09-161-13/+12
|
* Move wORD_SIZE_IN_BITS to DynFlagsIan Lynagh2012-09-141-2/+2
| | | | This frees wORD_SIZE up to be moved out of HaskellConstants
* Move some more constants fo platformConstantsIan Lynagh2012-09-141-3/+3
|
* Use oFFSET_* from platformConstants rather than ConstantsIan Lynagh2012-09-131-5/+5
|
* Use sIZEOF_* from platformConstants rather than ConstantsIan Lynagh2012-09-131-1/+1
|
* Pass DynFlags down to wordWidthIan Lynagh2012-09-121-249/+253
|
* Pass DynFlags down to gcWordIan Lynagh2012-09-121-2/+2
|
* Pass DynFlags down to bWordIan Lynagh2012-09-121-236/+231
| | | | | | 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.
* Pass Platform down to halfWordMaskIan Lynagh2012-09-101-2/+2
|
* Pass Platform down to halfWordWidthIan Lynagh2012-09-101-20/+24
| | | | We don't actually use it yet
* Narrow the args of the popCnt# primitives (new codegen)Simon Marlow2012-09-041-5/+10
| | | | (this change was previously done in the old codegen only)
* Cleanup: add mkIntExpr and zeroExpr utilsSimon Marlow2012-08-311-26/+25
|
* Fix fencepost and byte/word bugs in cloneArray/copyArray (#7185)Simon Marlow2012-08-311-12/+21
|
* Explicitly share some return continuationsSimon Marlow2012-08-021-1/+1
| | | | | | | Instead of relying on common-block-elimination to share return continuations in the common case (case-alternative heap checks) we do it explicitly. This isn't hard to do, is more robust, and saves some compilation time. Full commentary in Note [sharing continuations].
* Make -fscc-profiling a dynamic flagIan Lynagh2012-07-241-39/+55
| | | | All the flags that 'ways' imply are now dynamic
* Support the 2-result primops in the new code generatorSimon Marlow2012-07-111-3/+170
|
* Merge remote-tracking branch 'origin/master' into newcgSimon Marlow2012-07-041-1/+16
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/master: (756 commits) don't crash if argv[0] == NULL (#7037) -package P was loading all versions of P in GHCi (#7030) Add a Note, copying text from #2437 improve the --help docs a bit (#7008) Copy Data.HashTable's hashString into our Util module Build fix Build fixes Parse error: suggest brackets and indentation. Don't build the ghc DLL on Windows; works around trac #5987 On Windows, detect if DLLs have too many symbols; trac #5987 Add some more Integer rules; fixes #6111 Fix PA dfun construction with silent superclass args Add silent superclass parameters to the vectoriser Add silent superclass parameters (again) Mention Generic1 in the user's guide Make the GHC API a little more powerful. tweak llvm version warning message New version of the patch for #5461. Fix Word64ToInteger conversion rule. Implemented feature request on reconfigurable pretty-printing in GHCi (#5461) ... Conflicts: compiler/basicTypes/UniqSupply.lhs compiler/cmm/CmmBuildInfoTables.hs compiler/cmm/CmmLint.hs compiler/cmm/CmmOpt.hs compiler/cmm/CmmPipeline.hs compiler/cmm/CmmStackLayout.hs compiler/cmm/MkGraph.hs compiler/cmm/OldPprCmm.hs compiler/codeGen/CodeGen.lhs compiler/codeGen/StgCmm.hs compiler/codeGen/StgCmmBind.hs compiler/codeGen/StgCmmLayout.hs compiler/codeGen/StgCmmUtils.hs compiler/main/CodeOutput.lhs compiler/main/HscMain.hs compiler/nativeGen/AsmCodeGen.lhs compiler/simplStg/SimplStg.lhs
| * Change how macros like ASSERT are definedIan Lynagh2012-06-051-0/+1
| | | | | | | | | | By using Haskell's debugIsOn rather than CPP's "#ifdef DEBUG", we don't need to kludge things to keep the warning checker happy etc.
| * Add a setByteArray# primopIan Lynagh2012-05-281-1/+15
| | | | | | | | Essentially, this is a wrapper around memset
* | Lower safe foreign calls in the new CmmLayoutStackSimon Marlow2012-03-061-8/+3
| | | | | | | | | | | | | | | | We also generate much better code for safe foreign calls (and maybe also unsafe foreign calls) than previously. See the two new Notes: Note [lower safe foreign calls] Note [safe foreign call convention]
* | New codegen: fix bad code for comparisons (see Note [case on bool])Simon Marlow2012-02-151-1/+3
| |
* | Merge remote-tracking branch 'origin/master' into newcgSimon Marlow2012-02-131-2/+22
|\ \ | |/ | | | | | | | | | | | | Conflicts: compiler/cmm/CmmLint.hs compiler/cmm/OldCmm.hs compiler/codeGen/CgMonad.lhs compiler/main/CodeOutput.lhs
| * Port "Add new primtypes 'ArrayArray#' and 'MutableArrayArray#'" to new codegen.Edward Z. Yang2012-01-201-2/+22
| | | | | | | | | | | | | | | | 021a0dd265ff34c1e292813c06185eff1d6b5c1c appears to have only partially added the new primops associated with ArrayArray# and MutableArrayArray# Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* | Different implementation of MkGraphSimon Marlow2012-01-251-22/+22
|/
* Add new primtypes 'ArrayArray#' and 'MutableArrayArray#'Manuel M T Chakravarty2011-12-071-2/+7
| | | | | | | | The primitive array types, such as 'ByteArray#', have kind #, but are represented by pointers. They are boxed, but unpointed types (i.e., they cannot be 'undefined'). The two categories of array types —[Mutable]Array# and [Mutable]ByteArray#— are containers for unboxed (and unpointed) as well as for boxed and pointed types. So far, we lacked support for containers for boxed, unpointed types (i.e., containers for the primitive arrays themselves). This is what the new primtypes provide. Containers for boxed, unpointed types are crucial for the efficient implementation of scattered nested arrays, which are central to the new DPH backend library dph-lifted-vseg. Without such containers, we cannot eliminate all unboxing from the inner loops of traversals processing scattered nested arrays.
* Code generation: Always ask for result of newSparkPeter Wortmann2011-12-051-1/+2
| | | | | | | Otherwise the LLVM backend gets confused over whether its type should be "void (i8*, i8*)" or "i64 (i8*, i8*)". Signed-off-by: David Terei <davidterei@gmail.com>
* Further tweaks to the ccs primopsSimon Marlow2011-11-301-1/+8
| | | | | | | | | - add getCCSOf# :: a -> State# s -> (# State# s, Addr# #) (returns the CCS attached to the supplied object) - remove traceCcs# (obsoleted by getCCSOf#) - rename getCCCS# to getCurrentCCS#
* Add a new primop: getCCCS# :: State# s -> (# State# s, Addr# #)Simon Marlow2011-11-291-0/+3
| | | | | Returns a pointer to the current cost-centre stack when profiling, NULL otherwise.
* fix profiling bug in copyArray#/cloneArray# (cgrun068(profasm) segfault)Simon Marlow2011-11-141-1/+1
|
* 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.
* Handle HValues slightly nicerIan Lynagh2011-10-031-1/+1
| | | | | | We now have addrToAny# rather than addrToHValue#, and both addrToAny# and mkApUpd0# return "Any" rather than "a". This makes it a little easier to see what's going on, and fixes a warning in ByteCodeLink.
* Snapshot of codegen refactoring to share with simonpjSimon Marlow2011-08-251-2/+1
|
* Add popCnt# primopJohan Tibell2011-08-161-0/+14
|
* Port 'Add two new primops seq# and spark#' (be54417) to new codegen.Edward Z. Yang2011-07-071-0/+12
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* codeGen: Make emitCopyByteArray less pessimisticJohan Tibell2011-06-171-9/+1
| | | | | | | | Assigning the arguments to temporaries was only needed in the case of emitCopyArray, where the arguments are alive across the call. That is not the case in emitCopyByteArray. Signed-off-by: David Terei <davidterei@gmail.com>
* Port "Add byte array copy primops" to the new code genJohan Tibell2011-06-161-0/+57
| | | | Signed-off-by: David Terei <davidterei@gmail.com>
* Port "6c7d2a9 Use the new memcpy/memmove/memset MachOps" to new codegen.Edward Z. Yang2011-06-151-37/+23
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Port "Make array copy primops inline" and related patches to new codegen.Edward Z. Yang2011-06-131-0/+209
| | | | | | | | | | The following patches were ported: d0faaa6 Fix segfault in array copy primops on 32-bit 18691d4 Make assignTemp_ less pessimistic 9c23f06 Make array copy primops inline Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Fix Array sizeof primops to use the correct offset (which happens to be 0, ↵Daniel Peebles2011-02-011-1/+1
| | | | so it worked before anyway). Makes us more future-proof, at least
* Add sizeof(Mutable)Array# primitivesDaniel Peebles2011-01-261-0/+5
|
* Merge in new code generator branch.Simon Marlow2011-01-241-2/+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.
* FIX #38000 Store StgArrWords payload size in bytesAntoine Latter2010-01-011-6/+3
|
* Copying Simon M's fix for 650 to the new codegendias@cs.tufts.edu2009-12-221-2/+15
|
* Keep Touch'd variables live through the back enddias@cs.tufts.edu2009-09-181-4/+4
| | | | | | | When we used derived pointers into the middle of an object, we need to keep the pointer to the start of the object live. We use a "fat machine instruction" with the primitive MO_Touch to propagate this information through the back end.
* * Refactor CLabel.RtsLabel to CLabel.CmmLabelBen.Lippmeier@anu.edu.au2009-11-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The type of the CmmLabel ctor is now CmmLabel :: PackageId -> FastString -> CmmLabelInfo -> CLabel - When you construct a CmmLabel you have to explicitly say what package it is in. Many of these will just use rtsPackageId, but I've left it this way to remind people not to pretend labels are in the RTS package when they're not. - When parsing a Cmm file, labels that are not defined in the current file are assumed to be in the RTS package. Labels imported like import label are assumed to be in a generic "foreign" package, which is different from the current one. Labels imported like import "package-name" label are marked as coming from the named package. This last one is needed for the integer-gmp library as we want to refer to labels that are not in the same compilation unit, but are in the same non-rts package. This should help remove the nasty #ifdef __PIC__ stuff from integer-gmp/cbits/gmp-wrappers.cmm
* Merge RtsLabelInfo.Rts* with RtsLabelInfo.Rts*FSBen.Lippmeier@anu.edu.au2009-10-181-1/+1
|