summaryrefslogtreecommitdiff
path: root/compiler/nativeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix bugs in allocMoreStack (#7498, #7510)Simon Marlow2013-01-073-42/+99
| | | | | | | | | | | | | | | | | | | | | | | | There were four bugs here. Clearly I didn't test this enough to expose the bugs - it appeared to work on x86/Linux, but completely by accident it seems. 1. the delta was wrong by a factor of the slot size (as noted on #7498) 2. we weren't correctly aligning the stack pointer (sp needs to be 16-byte aligned on x86/x86_64) 3. we were doing the adjustment multiple times in the case of a block that was both a return point and a local branch target. To fix this I had to add new shim blocks to adjust the stack pointer, and retarget the original branches. See comment for details. 4. we were doing the adjustment for CALL instructions, which is unnecessary and wrong; only JMPs should be preceded by a stack adjustment. (Someone with a PPC box will need to update the PPC version of allocMoreStack to fix the above bugs, using the x86 version as a guide.)
* Small refactoring: makes it easier to see what nativeCodeGen actually doesIan Lynagh2012-12-162-65/+75
|
* PPC: Implement stack resizing for the linear register allocator.Erik de Castro Lopo2012-12-162-15/+59
| | | | Fixes #7498.
* De-tab compiler/nativeGen/PPC/Instr.hs.Erik de Castro Lopo2012-12-161-273/+266
|
* Implement word2Float# and word2Double#Johan Tibell2012-12-134-1/+28
|
* Small code tidy-upIan Lynagh2012-12-121-8/+7
|
* typoGabor Greif2012-12-121-1/+1
|
* Implement the -dynamic-too optimised path for the NCGIan Lynagh2012-12-111-32/+32
| | | | | | | | We don't yet have the slow path, for when we have to fall back to separate compilation. We also only currently handle the case qhere we're compiling Haskell code with the NCG.
* Add more plumbing to the nativeCodeGenIan Lynagh2012-12-111-30/+56
| | | | | This patch adds more of the plumbing necessary to allow the nativeGen to build multiple ways in a single compilation.
* Tweak how 'count' is handled in the nativeCodeGenIan Lynagh2012-12-111-5/+4
| | | | | We were always passing 0 to cmmNativeGenStream, so now the 0 is just hardcoded there.
* Package the NativeGen state up into a named typeIan Lynagh2012-12-111-35/+26
| | | | | This will make it a little more pleasant to have the nativegen build for multiple ways at once.
* Small refactoring: Use more idiomatic strictness forcing in AsmCodeGenIan Lynagh2012-12-111-7/+5
|
* Make nativeCodeGen return the rest of its UniqSupplyIan Lynagh2012-12-061-7/+9
|
* Haddoc fixBen Lippmeier2012-11-141-9/+9
|
* Comments and formatting to register allocator statsBen Lippmeier2012-11-141-38/+87
|
* Comments and formatting to spill cost codeBen Lippmeier2012-11-141-52/+62
|
* Comments and formatting to spill cleanerBen Lippmeier2012-11-141-147/+166
| | | | No functional changes.
* Comments and formatting to register allocatorsBen Lippmeier2012-11-145-252/+326
| | | | No functional changes.
* De-tabify register allocator codeBen Lippmeier2012-11-1410-961/+889
|
* Tell the compiler about alpha, mipseb and mipsel again; fixes #7339Ian Lynagh2012-11-135-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts the compiler parts of commit 7b594a5d7ac29972db39228e9c8b7f384313f39b Author: David Terei <davidterei@gmail.com> Date: Mon Nov 21 12:05:18 2011 -0800 Remove registerised code for dead architectures: mips, ia64, alpha, hppa1, m68k In particular, we want to know whether bewareLoadStoreAlignment should return True or False for them. It also reverts commit 3fc68b5c356b39b2b52a86d953367d0021c13262 Author: Simon Marlow <marlowsd@gmail.com> Date: Wed Jan 4 11:44:02 2012 +0000 Remove missing archs (mipseb, mipsel, alpha) (#5734) It doesn't hurt to map these to ArchUnknown since we don't need to know anything specific about them, and adding them would be a pain (there are a bunch of places where we have to case-match on all the arches to avoid warnings).
* Fix warningsSimon Marlow2012-11-122-2/+0
|
* Remove OldCmm, convert backends to consume new CmmSimon Marlow2012-11-1235-257/+277
| | | | | | | | | | | | | | | | | | This removes the OldCmm data type and the CmmCvt pass that converts new Cmm to OldCmm. The backends (NCGs, LLVM and C) have all been converted to consume new Cmm. The main difference between the two data types is that conditional branches in new Cmm have both true/false successors, whereas in OldCmm the false case was a fallthrough. To generate slightly better code we occasionally need to invert a conditional to ensure that the branch-not-taken becomes a fallthrough; this was previously done in CmmCvt, and it is now done in CmmContFlowOpt. We could go further and use the Hoopl Block representation for native code, which would mean that we could use Hoopl's postorderDfs and analyses for native code, but for now I've left it as is, using the old ListGraph representation for native code.
* Fix typosIan Lynagh2012-11-011-2/+2
|
* Whitespace only in nativeGen/NCGMonad.hsIan Lynagh2012-11-011-71/+64
|
* Merge branch 'master' of http://darcs.haskell.org/ghcSimon Peyton Jones2012-10-3116-70/+69
|\
| * Attach global register liveness info to Cmm procedures.Geoffrey Mainland2012-10-3016-67/+67
| | | | | | | | | | | | | | All Cmm procedures now include the set of global registers that are live on procedure entry, i.e., the global registers used to pass arguments to the procedure. Only global registers that are use to pass arguments are included in this list.
| * Cmm jumps always have live register information.Geoffrey Mainland2012-10-301-3/+2
| | | | | | | | Jumps now always have live register information attached, so drop Maybes.
* | Do not treat a constructor in a *pattern* as a *use* of that constructorSimon Peyton Jones2012-10-291-6/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | Occurrences in terms are uses, in patterns they are not. In this way we get unused-constructor warnings from modules like this module M( f, g, T ) where data T = T1 | T2 Bool f x = T2 x g T1 = True g (T2 x) = x Here a T1 value cannot be constructed, so we can warn. The use in a pattern doesn't count. See Note [Patterns are not uses] in RnPat. Interestingly this change exposed three module in GHC itself that had unused constructors, which I duly removed: * ghc/Main.hs * compiler/ghci/ByteCodeAsm * compiler/nativeGen/PPC/RegInfo Their changes are in this patch.
* Whitespace only in nativeGen/PIC.hsIan Lynagh2012-10-191-282/+275
|
* Refactor the way dump flags are handledIan Lynagh2012-10-182-7/+7
| | | | | | | | | | | | | We were being inconsistent about how we tested whether dump flags were enabled; in particular, sometimes we also checked the verbosity, and sometimes we didn't. This lead to oddities such as "ghc -v4" printing an "Asm code" section which didn't contain any code, and "-v4" enabled some parts of "-ddump-deriv" but not others. Now all the tests use dopt, which also takes the verbosity into account as appropriate.
* Some alpha renamingIan Lynagh2012-10-166-39/+39
| | | | | Mostly d -> g (matching DynFlag -> GeneralFlag). Also renamed if* to when*, matching the Haskell if/when names
* Produce new-style Cmm from the Cmm parserSimon Marlow2012-10-082-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove some old-codegen cruftSimon Marlow2012-09-251-12/+3
|
* fix panic message typoSimon Marlow2012-09-251-1/+1
|
* whitespace and panic message fixupSimon Marlow2012-09-241-8/+8
|
* whitespace onlySimon Marlow2012-09-241-29/+21
|
* Generate better code for "if (3 <= x) then ..."Simon Marlow2012-09-242-2/+31
|
* Merge branch 'master' of darcs.haskell.org:/srv/darcs//ghcIan Lynagh2012-09-209-85/+194
|\
| * fix warningsSimon Marlow2012-09-201-4/+1
| |
| * fix warningSimon Marlow2012-09-201-0/+5
| |
| * Teach the linear register allocator how to allocate more stack if necessarySimon Marlow2012-09-208-82/+189
| | | | | | | | | | | | | | | | | | This squashes the "out of spill slots" panic that occasionally happens on x86, by adding instructions to bump and retreat the C stack pointer as necessary. The panic has become more common since the new codegen, because we lump code into larger blocks, and the register allocator isn't very good at reusing stack slots for spilling (see Note [extra spill slots]).
* | Remove redundant pragmas from RegAlloc.LivenessIan Lynagh2012-09-201-2/+0
| |
* | Make addSRM to strict additionsIan Lynagh2012-09-201-1/+4
| | | | | | | | I assume that this is what is intended, as it is used with foldl'
* | Fix warnings in RegAlloc.Graph.StatsIan Lynagh2012-09-201-1/+6
| |
* | Whitespace only in nativeGen/RegAlloc/Graph/Stats.hsIan Lynagh2012-09-201-198/+192
|/
* Move wORD_SIZE into platformConstantsIan Lynagh2012-09-165-32/+32
|
* Move some more constants into platformConstantsIan Lynagh2012-09-1414-81/+93
|
* Remove more Platform argumentsIan Lynagh2012-09-142-50/+51
|
* Whitespace only in nativeGen/RegAlloc/Linear/JoinToTargets.hsIan Lynagh2012-09-141-205/+196
|
* Remove more Platform argumentsIan Lynagh2012-09-143-30/+33
|