summaryrefslogtreecommitdiff
path: root/compiler/codeGen/CgPrimOp.hs
Commit message (Collapse)AuthorAgeFilesLines
* Remove the old codegenSimon Marlow2012-10-191-1177/+0
| | | | | Except for CgUtils.fixStgRegisters that is used in the NCG and LLVM backends, and should probably be moved somewhere else.
* 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 old code generatorRoman Leshchinskiy2012-10-081-16/+19
|
* 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-2/+2
|
* 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-245/+251
|
* Pass DynFlags down to gcWordIan Lynagh2012-09-121-2/+2
|
* Pass DynFlags down to bWordIan Lynagh2012-09-121-236/+229
| | | | | | 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-4/+8
| | | | We don't actually use it yet
* Narrow the arg of popCnt# to the correct widthSimon Marlow2012-08-311-6/+15
| | | | | | | Fixes cgrun071 on recent Mac OS X versions. This is the right fix at least until we have proper types for Word8#, Word16# etc.
* Cleanup: add mkIntExpr and zeroExpr utilsSimon Marlow2012-08-311-2/+2
|
* Fix fencepost and byte/word bugs in cloneArray/copyArray (#7185)Simon Marlow2012-08-311-14/+22
|
* Make -fscc-profiling a dynamic flagIan Lynagh2012-07-241-40/+58
| | | | All the flags that 'ways' imply are now dynamic
* Add a setByteArray# primopIan Lynagh2012-05-281-1/+15
| | | | Essentially, this is a wrapper around memset
* Add a quotRemWord2 primopIan Lynagh2012-04-211-0/+53
| | | | | | | | It allows you to do (high, low) `quotRem` d provided high < d. Currently only has an inefficient fallback implementation.
* Fix the unregisterised build; fixes #5901Ian Lynagh2012-02-271-12/+4
|
* Fix generic 2-word-multiplyIan Lynagh2012-02-241-3/+3
|
* Add a 2-word-multiply operatorIan Lynagh2012-02-241-0/+48
| | | | Currently no NCGs support it
* Add a Word add-with-carry primopIan Lynagh2012-02-231-7/+57
| | | | No special-casing in any NCGs yet
* Add a primop for unsigned quotRem; part of #5598Ian Lynagh2012-02-171-0/+8
| | | | Only amd64 has an efficient implementation currently.
* Define a quotRem CallishMachOp; fixes #5598Ian Lynagh2012-02-141-0/+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).
* Formatting fixesDavid Terei2012-01-051-108/+101
|
* Add new primtypes 'ArrayArray#' and 'MutableArrayArray#'Manuel M T Chakravarty2011-12-071-2/+27
| | | | | | | | 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/+3
| | | | | | | 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/+2
| | | | | 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.
* Add popCnt# primopJohan Tibell2011-08-161-0/+17
|
* Add two new primops:Simon Marlow2011-06-281-0/+20
| | | | | | | | | | | | | seq# :: a -> State# s -> (# State# s, a #) spark# :: a -> State# s -> (# State# s, a #) seq# is a version of seq that can be used in a State#-passing context. We will use it to implement Control.Exception.evaluate and thus fix #5129. Also we have plans to use it to fix #5262. spark# is to seq# as par is to pseq. That is, it creates a spark in a State#-passing context. We will use spark# and seq# to implement rpar and rseq respectively in an improved implementation of the Eval monad.
* codeGen: Make emitCopyByteArray less pessimisticJohan Tibell2011-06-171-10/+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>
* Add byte array copy primopsJohan Tibell2011-06-161-0/+59
| | | | Signed-off-by: David Terei <davidterei@gmail.com>
* Use the new memcpy/memmove/memset MachOpsJohan Tibell2011-06-141-24/+25
| | | | Signed-off-by: David Terei <davidterei@gmail.com>
* 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>
* Port "Make array copy primops inline" and related patches to new codegen.Edward Z. Yang2011-06-131-0/+7
| | | | | | | | | | 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 segfault in array copy primops on 32-bitJohan Tibell2011-06-071-4/+4
| | | | | | | The second argument to C's memset was passed as a W8 while memset expects an int. Signed-off-by: David Terei <davidterei@gmail.com>
* Make array copy primops inlineJohan Tibell2011-05-191-0/+212
|
* 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/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
|
* Fix #650: use a card table to mark dirty sections of mutable arraysSimon Marlow2009-12-171-3/+15
| | | | | | | | | | | | The card table is an array of bytes, placed directly following the actual array data. This means that array reading is unaffected, but array writing needs to read the array size from the header in order to find the card table. We use a bytemap rather than a bitmap, because updating the card table must be multi-thread safe. Each byte refers to 128 entries of the array, but this is tunable by changing the constant MUT_ARR_PTRS_CARD_BITS in includes/Constants.h.
* * 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
|
* Fix warnings in CgPrimOpIan Lynagh2008-12-171-120/+116
|