summaryrefslogtreecommitdiff
path: root/compiler/cmm
Commit message (Collapse)AuthorAgeFilesLines
* Add rebindable syntax for if-then-elsesimonpj@microsoft.com2010-10-221-2/+2
| | | | | | | | | | | There are two main changes * New LANGUAGE option RebindableSyntax, which implies NoImplicitPrelude * if-the-else becomes rebindable, with function name "ifThenElse" (but case expressions are unaffected) Thanks to Sam Anklesaria for doing most of the work here
* Interruptible FFI calls with pthread_kill and CancelSynchronousIO. v4Edward Z. Yang2010-09-198-15/+31
| | | | | | | | | | | | | | | | | | | | | | | This is patch that adds support for interruptible FFI calls in the form of a new foreign import keyword 'interruptible', which can be used instead of 'safe' or 'unsafe'. Interruptible FFI calls act like safe FFI calls, except that the worker thread they run on may be interrupted. Internally, it replaces BlockedOnCCall_NoUnblockEx with BlockedOnCCall_Interruptible, and changes the behavior of the RTS to not modify the TSO_ flags on the event of an FFI call from a thread that was interruptible. It also modifies the bytecode format for foreign call, adding an extra Word16 to indicate interruptibility. The semantics of interruption vary from platform to platform, but the intent is that any blocking system calls are aborted with an error code. This is most useful for making function calls to system library functions that support interrupting. There is no support for pre-Vista Windows. There is a partner testsuite patch which adds several tests for this functionality.
* Fix build following haskell98 and -fglasgow-exts changesIan Lynagh2010-10-061-3/+2
|
* Some refactoring and simplification in TcInteract.occurChecksimonpj@microsoft.com2010-10-071-1/+1
|
* Remove (most of) the FiniteMap wrapperIan Lynagh2010-09-146-91/+102
| | | | | | | | We still have insertList, insertListWith, deleteList which aren't in Data.Map, and foldRightWithKey which works around the fold(r)WithKey addition and deprecation.
* Fix build with 6.10Ian Lynagh2010-09-135-0/+10
|
* Super-monster patch implementing the new typechecker -- at lastsimonpj@microsoft.com2010-09-138-9/+53
| | | | | | | | | This major patch implements the new OutsideIn constraint solving algorithm in the typecheker, following our JFP paper "Modular type inference with local assumptions". Done with major help from Dimitrios Vytiniotis and Brent Yorgey.
* Work around missing type signature in Happysimonpj@microsoft.com2010-07-301-1/+9
| | | | | | | | | | | | | Happy generates notHappyAtAll = error "Blah" without a type signature, and currently the new typechecker doesn't generalise it. This patch says "no monomorphism restriction" which makes it generalise again. Better would be to add a type sig to Happy's template
* Add two local type signaturessimonpj@microsoft.com2010-07-292-12/+18
|
* Don't restrict filenames in line pragmas to printable characters; fixes #4207Ian Lynagh2010-08-051-1/+1
| | | | | "printable" is ASCII-only, whereas in other locales we can get things like # 1 "<lĂ­nea-de-orden>"
* Remove an unnecessary #includeIan Lynagh2010-07-151-2/+0
|
* typo in commentSimon Marlow2010-06-161-1/+1
|
* Make mkPState and pragState take their arguments in the same orderIan Lynagh2010-07-061-1/+1
|
* Add new LLVM code generator to GHC. (Version 2)David Terei2010-06-152-1/+2
| | | | | | | | | | | | | | | | | | This was done as part of an honours thesis at UNSW, the paper describing the work and results can be found at: http://www.cse.unsw.edu.au/~pls/thesis/davidt-thesis.pdf A Homepage for the backend can be found at: http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/Backends/LLVM Quick summary of performance is that for the 'nofib' benchmark suite, runtimes are within 5% slower than the NCG and generally better than the C code generator. For some code though, such as the DPH projects benchmark, the LLVM code generator outperforms the NCG and C code generator by about a 25% reduction in run times.
* Add missing constant folding and optimisation for unsigned divisionSimon Marlow2010-04-221-0/+5
| | | | Noticed by Denys Rtveliashvili <rtvd@mac.com>, see #4004
* New implementation of BLACKHOLEsSimon Marlow2010-03-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the global blackhole_queue with a clever scheme that enables us to queue up blocked threads on the closure that they are blocked on, while still avoiding atomic instructions in the common case. Advantages: - gets rid of a locked global data structure and some tricky GC code (replacing it with some per-thread data structures and different tricky GC code :) - wakeups are more prompt: parallel/concurrent performance should benefit. I haven't seen anything dramatic in the parallel benchmarks so far, but a couple of threading benchmarks do improve a bit. - waking up a thread blocked on a blackhole is now O(1) (e.g. if it is the target of throwTo). - less sharing and better separation of Capabilities: communication is done with messages, the data structures are strictly owned by a Capability and cannot be modified except by sending messages. - this change will utlimately enable us to do more intelligent scheduling when threads block on each other. This is what started off the whole thing, but it isn't done yet (#3838). I'll be documenting all this on the wiki in due course.
* Comments and type signatures onlysimonpj@microsoft.com2010-03-091-0/+23
|
* add a noteSimon Marlow2010-03-091-0/+3
|
* Beef up cmmMiniInline a tiny bitSimon Marlow2010-02-162-20/+32
| | | | | | | | | Allow a temporary assignment to be pushed past an assignment to a global if the global is not mentioned in the rhs of the assignment we are inlining. This fixes up some bad code. We should make sure we're doing something equivalent in the new backend in due course.
* Patch for shared libraries support on FreeBSDIan Lynagh2010-01-061-3/+3
| | | | From Maxime Henrion <mhenrion@gmail.com>
* Assume CmmLabels have dynamic linkage on non-WindowsBen.Lippmeier.anu.edu.au2010-01-021-3/+5
|
* When compiling viac, don't need to emit prototypes for symbols in the RTSBen.Lippmeier@anu.edu.au2010-01-021-1/+9
|
* Tag ForeignCalls with the package they correspond toBen.Lippmeier@anu.edu.au2010-01-024-35/+141
|
* Typo in commentBen.Lippmeier@anu.edu.au2009-12-291-1/+1
|
* Fix #3741, simplifying things in the processSimon Marlow2009-12-101-2/+2
| | | | | | | | | The problem in #3741 was that we had confused column numbers with byte offsets, which fails in the case of UTF-8 (amongst other things). Fortunately we're tracking correct column offsets now, so we didn't have to make a calculation based on a byte offset. I got rid of two fields from the PState (last_line_len and last_offs).and one field from the AI (alex input) constructor.
* Add a new to-do to cmm-notessimonpj@microsoft.com2009-12-071-0/+4
|
* Columns now start at 1, as lines already didIan Lynagh2009-11-272-2/+2
| | | | Also corrected a couple of line 0's to line 1
* Comments onlysimonpj@microsoft.com2009-11-122-14/+35
|
* Morguing dead codedias@cs.tufts.edu2009-09-181-85/+8
|
* More sensible use of -fnew-codegen and less debugging outputdias@cs.tufts.edu2009-09-184-19/+19
|
* Minor refactoring and formattingdias@cs.tufts.edu2009-09-183-11/+34
| | | | | Wrote a generic function to extend dataflow results for safe foreign calls. Should be able to throw it away when we change the representation of safe foreign calls.
* Keep Touch'd variables live through the back enddias@cs.tufts.edu2009-09-183-7/+9
| | | | | | | 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.
* Fixed calling convention for unboxed tuplesdias@cs.tufts.edu2009-09-181-4/+50
| | | | | | Apparently, the arguments should be sorted by pointerhood. While we're at it, I rewrote the code that assigns registers and stack space to function call and return parameters.
* validate fixesBen.Lippmeier@anu.edu.au2009-11-061-0/+1
|
* * Refactor CLabel.RtsLabel to CLabel.CmmLabelBen.Lippmeier@anu.edu.au2009-11-064-181/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add missing case to externallyVisibleCLabelBen.Lippmeier@anu.edu.au2009-10-221-0/+1
|
* Add CLabel.CmmLabel and start refactoringBen.Lippmeier@anu.edu.au2009-10-181-143/+203
|
* Haddockify and clean up commentingBen.Lippmeier@anu.edu.au2009-10-181-61/+70
|
* Merge RtsLabelInfo.Rts* with RtsLabelInfo.Rts*FSBen.Lippmeier@anu.edu.au2009-10-184-110/+65
|
* Add notes to cmm-notes, following conversation with John Diassimonpj@microsoft.com2009-11-051-0/+15
|
* Add Outputable.blankLine and use itsimonpj@microsoft.com2009-10-293-10/+8
|
* Comments onlysimonpj@microsoft.com2009-10-291-1/+1
|
* emitRetUT: cope with arguments overlapping with results (#3546)Simon Marlow2009-09-281-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | In decodeFloat_Int# we have the C-- code: mp_tmp1 = Sp - WDS(1); mp_tmp_w = Sp - WDS(2); /* arguments: F1 = Float# */ arg = F1; /* Perform the operation */ foreign "C" __decodeFloat_Int(mp_tmp1 "ptr", mp_tmp_w "ptr", arg) []; /* returns: (Int# (mantissa), Int# (exponent)) */ RET_NN(W_[mp_tmp1], W_[mp_tmp_w]); Which all looks quite reasonable. The problem is that RET_NN() might assign the results to the stack (with an unregisterised back end), and in this case the arguments to RET_NN() refer to the same stack slots that will be assigned to. The code generator should do the right thing here, but it wasn't - it was assuming that it could assign the results sequentially. A 1-line fix to use emitSimultaneously rather than emitStmts (plus comments).
* Comments and Cmm notessimonpj@microsoft.com2009-09-112-39/+166
|
* Add cmm-notes, describing Simon and John's work on Cmm pipelinesimonpj@microsoft.com2009-09-111-0/+345
|
* Comments in Cmmsimonpj@microsoft.com2009-09-105-14/+67
|
* Comments only, on Cmm data typessimonpj@microsoft.com2009-09-103-9/+40
|
* Minor documentation fixes.Thomas Schilling2009-07-221-0/+6
|
* Rename primops from foozh_fast to stg_foozhSimon Marlow2009-08-031-1/+1
| | | | For consistency with other RTS exported symbols
* RTS tidyup sweep, first phaseSimon Marlow2009-08-022-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first phase of this tidyup is focussed on the header files, and in particular making sure we are exposinng publicly exactly what we need to, and no more. - Rts.h now includes everything that the RTS exposes publicly, rather than a random subset of it. - Most of the public header files have moved into subdirectories, and many of them have been renamed. But clients should not need to include any of the other headers directly, just #include the main public headers: Rts.h, HsFFI.h, RtsAPI.h. - All the headers needed for via-C compilation have moved into the stg subdirectory, which is self-contained. Most of the headers for the rest of the RTS APIs have moved into the rts subdirectory. - I left MachDeps.h where it is, because it is so widely used in Haskell code. - I left a deprecated stub for RtsFlags.h in place. The flag structures are now exposed by Rts.h. - Various internal APIs are no longer exposed by public header files. - Various bits of dead code and declarations have been removed - More gcc warnings are turned on, and the RTS code is more warning-clean. - More source files #include "PosixSource.h", and hence only use standard POSIX (1003.1c-1995) interfaces. There is a lot more tidying up still to do, this is just the first pass. I also intend to standardise the names for external RTS APIs (e.g use the rts_ prefix consistently), and declare the internal APIs as hidden for shared libraries.