summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/PPC
Commit message (Collapse)AuthorAgeFilesLines
* Add support for byte endian swapping for Word 16/32/64.Austin Seipp2013-07-171-0/+1
| | | | | | | | | | | | | * Exposes bSwap{,16,32,64}# primops * Add a new machop: MO_BSwap * Use a Stg implementation (hs_bswap{16,32,64}) for other implementation in NCG. * Generate bswap in X86 NCG for 32 and 64 bits, and for 16 bits, bswap+shr instead of using xchg. * Generate llvm.bswap intrinsics in llvm codegen. Authored-by: Vincent Hanquez <tab@snarc.org> Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Fix many ASSERT uses under Clang.Austin Seipp2013-06-181-1/+1
| | | | | | Clang doesn't like whitespace between macro and arguments. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Revert "Add support for byte endian swapping for Word 16/32/64."Simon Peyton Jones2013-06-111-1/+0
| | | | This reverts commit 1c5b0511a89488f5280523569d45ee61c0d09ffa.
* Add support for byte endian swapping for Word 16/32/64.Ian Lynagh2013-06-091-0/+1
| | | | | | | | | | | | * Exposes bSwap{,16,32,64}# primops * Add a new machops MO_BSwap * Use a Stg implementation (hs_bswap{16,32,64}) for other implementation in NCG. * Generate bswap in X86 NCG for 32 and 64 bits, and for 16 bits, bswap+shr instead of using xchg. * Generate llvm.bswap intrinsics in llvm codegen. Patch from Vincent Hanquez.
* Refactor cmmMakeDynamicReferenceIan Lynagh2013-05-131-4/+4
| | | | | It now has its own class, and the addImport function is defined in that class, rather than needing to be passed as an argument.
* Fix bugs in PPC.Instr.allocMoreStack (#7498)PHO2013-02-111-39/+85
| | | | This patch is ported from #7510, which fixes the same bug in the x86 nativeGen.
* AsmCodeGen.NcgImpl.ncgMakeFarBranches should take account of info tables (#709)PHO2013-02-021-7/+9
| | | | We have to reduce the maximum number of instructions to jump over depending on the number of info tables in a proc.
* Move AsmCodeGen.makeFarBranches to PPC.Instr (#709)PHO2013-02-021-1/+39
| | | | Its implementation is totally specific to PPC.
* Add prefetch primops.Geoffrey Mainland2013-02-011-0/+1
|
* Fix bugs in allocMoreStack (#7498, #7510)Simon Marlow2013-01-071-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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.)
* PPC: Implement stack resizing for the linear register allocator.Erik de Castro Lopo2012-12-161-14/+58
| | | | Fixes #7498.
* De-tab compiler/nativeGen/PPC/Instr.hs.Erik de Castro Lopo2012-12-161-273/+266
|
* Implement word2Float# and word2Double#Johan Tibell2012-12-131-0/+2
|
* Remove OldCmm, convert backends to consume new CmmSimon Marlow2012-11-125-36/+44
| | | | | | | | | | | | | | | | | | 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.
* Merge branch 'master' of http://darcs.haskell.org/ghcSimon Peyton Jones2012-10-312-3/+3
|\
| * Attach global register liveness info to Cmm procedures.Geoffrey Mainland2012-10-302-3/+3
| | | | | | | | | | | | | | 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.
* | 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.
* Some alpha renamingIan Lynagh2012-10-161-2/+2
| | | | | Mostly d -> g (matching DynFlag -> GeneralFlag). Also renamed if* to when*, matching the Haskell if/when names
* Teach the linear register allocator how to allocate more stack if necessarySimon Marlow2012-09-201-0/+2
| | | | | | | | | 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]).
* Move wORD_SIZE into platformConstantsIan Lynagh2012-09-162-8/+10
|
* Move some more constants into platformConstantsIan Lynagh2012-09-141-13/+16
|
* Pass DynFlags down to wordWidthIan Lynagh2012-09-121-5/+5
|
* Pass DynFlags down to bWordIan Lynagh2012-09-122-18/+22
| | | | | | 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.
* Handle II16 size value in PowerPC code generator.Erik de Castro Lopo2012-09-081-2/+2
|
* Fix the PPC and SPARC NCGs to handle multiple info tables in a procSimon Marlow2012-09-071-16/+21
|
* Remove some CPP from nativeGen/PPC/Regs.hIan Lynagh2012-08-283-27/+16
|
* Move more code into codeGen/CodeGen/Platform.hsIan Lynagh2012-08-283-310/+34
| | | | | | | | HaskellMachRegs.h is no longer included in anything under compiler/ Also, includes/CodeGen.Platform.hs now includes "stg/MachRegs.h" rather than <stg/MachRegs.h> which means that we always get the file from the tree, rather than from the bootstrapping compiler.
* Fix -fPIC with the new code generatorSimon Marlow2012-08-281-2/+0
| | | | The CmmBlocks inside CmmExprs were not getting the PIC treatment
* Fix for optimizer bug on linux-powerpc (#6156).Erik de Castro Lopo2012-08-231-4/+4
|
* Make the PPC globalRegMaybe more similar to the other platforms'Ian Lynagh2012-08-212-27/+27
|
* Whitespace only in compiler/nativeGen/PPC/Regs.hsIan Lynagh2012-08-211-201/+194
|
* Pass platform down to lastxmmIan Lynagh2012-08-211-2/+2
|
* Start separating out the RTS and Haskell imports of MachRegs.hIan Lynagh2012-08-061-1/+1
| | | | No functional differences yet
* New codegen: do not split proc-points when using the NCGSimon Marlow2012-07-301-36/+37
| | | | | | | | | Proc-point splitting is only required by backends that do not support having proc-points within a code block (that is, everything except the native backend, i.e. LLVM and C). Not doing proc-point splitting saves some compilation time, and might produce slightly better code in some cases.
* Remove pprNatCmmDecl's Platform argumentIan Lynagh2012-07-241-5/+6
|
* Remove unnecessary Platform arguments in nativeGen/PPC/Ppr.hsIan Lynagh2012-07-241-207/+214
|
* Make -fPIC a dynamic flagIan Lynagh2012-07-161-9/+10
| | | | | | Hopefully I've kept the logic the same, and we now generate warnings if the user does -fno-PIC but we ignore them (e.g. because they're on OS X amd64).
* Move -fno-warn-orphan flag into individual modulesIan Lynagh2012-07-151-0/+1
|
* Remove some more redundant Platform argumentsIan Lynagh2012-06-201-3/+2
|
* Use 'ppr' rather than 'pprCLabel platform'Ian Lynagh2012-06-131-19/+19
| | | | Means we can stop passing platform around as much.
* Remove lots of commented out 'in' keywordsIan Lynagh2012-06-131-5/+0
|
* Remove PlatformOutputableIan Lynagh2012-06-131-2/+2
| | | | | We can now get the Platform from the DynFlags inside an SDoc, so we no longer need to pass the Platform in.
* Use SDoc rather than Doc in the native gensIan Lynagh2012-06-122-52/+48
| | | | This avoid lots of converting back and forth between the two types.
* 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 quotRemWord2 primopIan Lynagh2012-04-211-6/+7
| | | | | | | | It allows you to do (high, low) `quotRem` d provided high < d. Currently only has an inefficient fallback implementation.
* PPC: Handle right shift of > 31 bits. Fix #5900.Erik de Castro Lopo2012-03-231-3/+11
|
* PPC ppr: tabs -> spaces.Erik de Castro Lopo2012-03-231-232/+225
|
* Fix the unregisterised build; fixes #5901Ian Lynagh2012-02-271-3/+3
|
* minor tweakGabor Greif2012-02-271-1/+1
|
* Add a 2-word-multiply operatorIan Lynagh2012-02-241-0/+1
| | | | Currently no NCGs support it