summaryrefslogtreecommitdiff
path: root/compiler/cmm
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* remove dead codeSimon Marlow2009-06-201-12/+1
|
* Remove GHC's haskell98 dependencyIan Lynagh2009-07-2417-23/+23
|
* Remove unused importsIan Lynagh2009-07-0711-19/+0
|
* Trim unused imports detected by new unused-import codesimonpj@microsoft.com2009-07-067-10/+1
|
* Support for -fwarn-unused-do-bind and -fwarn-wrong-do-bind, as per #3263Max Bolingbroke2009-07-014-15/+14
|
* Add PrimCall to the STG layer and update Core -> STG translationDuncan Coutts2009-06-091-0/+7
| | | | | | | | | | It adds a third case to StgOp which already hold StgPrimOp and StgFCallOp. The code generation for the new StgPrimCallOp case is almost exactly the same as for out-of-line primops. They now share the tailCallPrim function. In the Core -> STG translation we map foreign calls using the "prim" calling convention to the StgPrimCallOp case. This is because in Core we represent prim calls using the ForeignCall stuff. At the STG level however the prim calls are really much more like primops than foreign calls.
* Put "%expect 0" directives in the .y filesIan Lynagh2009-06-081-0/+2
| | | | | With the exception of GHC's main Parser.y(.pp), which has 2 reduce/reduce conflicts
* fix pprDynamicLinkerAsmLabel for Mac OS X x86_64Austin Seipp2009-05-231-0/+4
|
* Hide warnings from alex/happy sourcesIan Lynagh2009-05-142-2/+2
|
* Require a bang pattern when unlifted types are where/let bound; #3182Ian Lynagh2009-04-242-2/+2
| | | | | For now we only get a warning, rather than an error, because the alex and happy templates don't follow the new rules yet.
* eliminate warningsdias@eecs.tufts.edu2009-04-032-2/+1
|
* Buggy optimizations caused function-call return to share the function's ↵dias@eecs.tufts.edu2009-03-311-25/+50
| | | | | | | | | entry point - Block concat and branch-chain elimination were allowing a function call to return to the caller's entry point. But that doesn't leave anywhere for the infotable on the stack, since the SP on return must be the same as the SP on entry to the procedure.
* Better handling of node parameter in calling conventionsdias@eecs.tufts.edu2009-03-253-9/+13
| | | | | | - Previously, the node was taken as a parameter, then ignored, for static closures. Goofy. Now, the vestigial node parameters are gone.
* Code simplifications due to call/return separation; some improvements to how ↵dias@eecs.tufts.edu2009-03-233-46/+13
| | | | node argument is managed
* Code simplification due to separate call/return conventionsdias@eecs.tufts.edu2009-03-233-30/+41
|
* Calls with and without passing node arguments more clearly separateddias@eecs.tufts.edu2009-03-234-16/+30
|
* Another small step: call and return conventions specified separately when ↵dias@eecs.tufts.edu2009-03-234-13/+13
| | | | making calls
* Small step toward call-conv improvement: separate out calls and returnsdias@eecs.tufts.edu2009-03-234-21/+29
|
* use a UniqSet for is MathFun, this list is getting quite largeSimon Marlow2009-03-301-4/+5
|
* update list of C math functionsBertram Felgenhauer2009-03-231-17/+77
| | | | | | | Fix via C compilation of modules that import, say, log1p from math.h (#3117) The list is based on preprocessing Stg.h with glibc 2.6.1 headers, and cross-checked with the ISO C 99 standard (draft).
* Comment explaining use of seq in DFMonaddias@eecs.tufts.edu2009-03-181-0/+4
|
* Calling convention bug and cleanupdias@eecs.tufts.edu2009-03-172-39/+60
| | | | | - yet another wrong calling convention; this one was a special case for returning one value.
* stack overflows and out of memory'sdias@eecs.tufts.edu2009-03-167-82/+84
| | | | | | | 1. Stack overflow fixed by making dataflow monad strict in the state. 2. Out of memory fixed by "forgetting" lastoutfacts in the dataflow monad where we should. We were creating an unnecessarily long list that grew exponentially...
* A few bug fixes; some improvements spurred by paper writingdias@eecs.harvard.edu2009-03-0324-646/+602
| | | | | | | | | | | | Among others: - Fixed Stg->C-- translation of let-no-escapes -- it's important to use the right continuation... - Fixed infinite recursion in X86 backend (shortcutJump mishandled infinite loops) - Fixed yet another wrong calling convention -- primops take args only in vanilla regs, but they may return results on the stack! - Removed StackInfo from LGraph and Block -- now in LastCall and CmmZ - Updated avail-variable and liveness code
* Correct an IsFunction that should be IsDataIan Lynagh2009-02-071-1/+1
|
* Fix calling maths functions when compiling via CIan Lynagh2009-02-061-1/+2
|
* When generating C, don't pretend functions are dataIan Lynagh2009-02-065-34/+47
| | | | | | | | | | | | | | | We used to generated things like: extern StgWordArray (newCAF) __attribute__((aligned (8))); ((void (*)(void *))(W_)&newCAF)((void *)R1.w); (which is to say, pretend that newCAF is some data, then cast it to a function and call it). This goes wrong on at least IA64, where: A function pointer on the ia64 does not point to the first byte of code. Intsead, it points to a structure that describes the function. The first quadword in the structure is the address of the first byte of code so we end up dereferencing function pointers one time too many, and segfaulting.
* Fix warnings in CmmInfoIan Lynagh2008-12-291-11/+3
|
* Fix warnings in CmmCPSGenIan Lynagh2008-12-291-13/+23
|
* Fix warnings in CmmProcPointIan Lynagh2008-12-291-10/+1
|