summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/SPARC
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "Place static closures in their own section."Edward Z. Yang2014-10-201-1/+0
| | | | | | | | | | This reverts commit b23ba2a7d612c6b466521399b33fe9aacf5c4f75. Conflicts: compiler/cmm/PprCmmDecl.hs compiler/nativeGen/PPC/Ppr.hs compiler/nativeGen/SPARC/Ppr.hs compiler/nativeGen/X86/Ppr.hs
* Indentation and non-semantic changes only.Edward Z. Yang2014-10-191-10/+10
| | | | | | | | | | | | | | | Summary: Get these lines fitting in 80 columns, and replace ptext (sLit ...) with text Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonmar, austin Subscribers: thomie, carter, ezyang, simonmar Differential Revision: https://phabricator.haskell.org/D342
* Place static closures in their own section.Edward Z. Yang2014-10-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Summary: The primary reason for doing this is assisting debuggability: if static closures are all in the same section, they are guaranteed to be adjacent to one another. This will help later when we add some code that takes section start/end and uses this to sanity-check the sections. Part of remove HEAP_ALLOCED patch set (#8199) Signed-off-by: Edward Z. Yang <ezyang@mit.edu> Test Plan: validate Reviewers: simonmar, austin Subscribers: simonmar, ezyang, carter, thomie Differential Revision: https://phabricator.haskell.org/D263 GHC Trac Issues: #8199
* Add MO_AddIntC, MO_SubIntC MachOps and implement in X86 backendReid Barton2014-08-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Summary: These MachOps are used by addIntC# and subIntC#, which in turn are used in integer-gmp when adding or subtracting small Integers. The following benchmark shows a ~6% speedup after this commit on x86_64 (building GHC with BuildFlavour=perf). {-# LANGUAGE MagicHash #-} import GHC.Exts import Criterion.Main count :: Int -> Integer count (I# n#) = go n# 0 where go :: Int# -> Integer -> Integer go 0# acc = acc go n# acc = go (n# -# 1#) $! acc + 1 main = defaultMain [bgroup "count" [bench "100" $ whnf count 100]] Differential Revision: https://phabricator.haskell.org/D140
* Implement new CLZ and CTZ primops (re #9340)Herbert Valerio Riedel2014-08-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | This implements the new primops clz#, clz32#, clz64#, ctz#, ctz32#, ctz64# which provide efficient implementations of the popular count-leading-zero and count-trailing-zero respectively (see testcase for a pure Haskell reference implementation). On x86, NCG as well as LLVM generates code based on the BSF/BSR instructions (which need extra logic to make the 0-case well-defined). Test Plan: validate and succesful tests on i686 and amd64 Reviewers: rwbarton, simonmar, ezyang, austin Subscribers: simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D144 GHC Trac Issues: #9340
* nativeGen: detabify/dewhitespace SPARC/CodeGen/BaseAustin Seipp2014-07-201-53/+41
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* nativeGen: detabify/dewhitespace SPARC/CodeGen/Gen32Austin Seipp2014-07-201-373/+361
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* nativeGen: detabify/dewhitespace SPARC/CodeGen/SanityAustin Seipp2014-07-201-53/+42
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* nativeGen: detabify/dewhitespace SPARC/CodeGen/ExpandAustin Seipp2014-07-201-106/+91
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* nativeGen: detabify/dewhitespace SPARC/CodeGen/AmodeAustin Seipp2014-07-201-23/+15
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* nativeGen: detabify/dewhitespace SPARC/CodeGen/CondCodeAustin Seipp2014-07-201-29/+21
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* nativeGen: detabify/dewhitespace SPARC/CondAustin Seipp2014-07-201-29/+21
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* nativeGen: detabify/dewhitespace SPARC/RegsAustin Seipp2014-07-201-145/+137
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* nativeGen: detabify/dewhitespace SPARC/InstrAustin Seipp2014-07-201-311/+302
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* nativeGen: detabify/dewhitespace SPARC/ShortcutJumpAustin Seipp2014-07-201-21/+10
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* nativeGen: detabify/dewhitespace SPARC/ImmAustin Seipp2014-07-201-42/+32
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* nativeGen: detabify/dewhitespace SPARC/StackAustin Seipp2014-07-201-29/+20
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Re-add more primops for atomic ops on byte arraysJohan Tibell2014-06-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | | This is the second attempt to add this functionality. The first attempt was reverted in 950fcae46a82569e7cd1fba1637a23b419e00ecd, due to register allocator failure on x86. Given how the register allocator currently works, we don't have enough registers on x86 to support cmpxchg using complicated addressing modes. Instead we fall back to a simpler addressing mode on x86. Adds the following primops: * atomicReadIntArray# * atomicWriteIntArray# * fetchSubIntArray# * fetchOrIntArray# * fetchXorIntArray# * fetchAndIntArray# Makes these pre-existing out-of-line primops inline: * fetchAddIntArray# * casIntArray#
* Revert "Add more primops for atomic ops on byte arrays"Johan Tibell2014-06-261-4/+0
| | | | | | | | This commit caused the register allocator to fail on i386. This reverts commit d8abf85f8ca176854e9d5d0b12371c4bc402aac3 and 04dd7cb3423f1940242fdfe2ea2e3b8abd68a177 (the second being a fix to the first).
* Add more primops for atomic ops on byte arraysJohan Tibell2014-06-241-0/+4
| | | | | | | | | | | | | | | | | | | Summary: Add more primops for atomic ops on byte arrays Adds the following primops: * atomicReadIntArray# * atomicWriteIntArray# * fetchSubIntArray# * fetchOrIntArray# * fetchXorIntArray# * fetchAndIntArray# Makes these pre-existing out-of-line primops inline: * fetchAddIntArray# * casIntArray#
* Add LANGUAGE pragmas to compiler/ source filesHerbert Valerio Riedel2014-05-1514-12/+18
| | | | | | | | | | | | | | | | | | In some cases, the layout of the LANGUAGE/OPTIONS_GHC lines has been reorganized, while following the convention, to - place `{-# LANGUAGE #-}` pragmas at the top of the source file, before any `{-# OPTIONS_GHC #-}`-lines. - Moreover, if the list of language extensions fit into a single `{-# LANGUAGE ... -#}`-line (shorter than 80 characters), keep it on one line. Otherwise split into `{-# LANGUAGE ... -#}`-lines for each individual language extension. In both cases, try to keep the enumeration alphabetically ordered. (The latter layout is preferable as it's more diff-friendly) While at it, this also replaces obsolete `{-# OPTIONS ... #-}` pragma occurences by `{-# OPTIONS_GHC ... #-}` pragmas.
* Fix a popular typo in commentsGabor Greif2014-02-011-1/+1
|
* Add support for prefetch with locality levels.Austin Seipp2013-10-011-2/+5
| | | | | | | | | | | | | | | | | This patch adds support for several new primitive operations which support using processor-specific instructions to help guide data and cache locality decisions. We have levels ranging from [0..3] For LLVM, we generate llvm.prefetch intrinsics at the proper locality level (similar to GCC.) For x86 we generate prefetch{NTA, t2, t1, t0} instructions. On SPARC and PowerPC, the locality levels are ignored. This closes #8256. Authored-by: Carter Tazio Schonwald <carter.schonwald@gmail.com> Signed-off-by: Austin Seipp <austin@well-typed.com>
* Globally replace "hackage.haskell.org" with "ghc.haskell.org"Simon Marlow2013-10-0112-12/+12
|
* Remove dead codeJan Stolarek2013-09-101-0/+1
|
* 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>
* 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-1/+1
| | | | | It now has its own class, and the addImport function is defined in that class, rather than needing to be passed as an argument.
* Remove tabs (M-x untabify)Gabor Greif2013-04-071-99/+91
|
* Fix typosGabor Greif2013-04-072-3/+3
|
* Detab modules with tabs on 5 lines or fewerIan Lynagh2013-04-061-13/+6
|
* Add prefetch primops.Geoffrey Mainland2013-02-011-0/+1
|
* Update a panic messageIan Lynagh2013-01-111-1/+1
| | | | | | I don't actually know if suggesting -fllvm as a workaround is useful advice, but -fvia-C certainly won't help as it doesn't do anything any more.
* Whitespace only in nativeGen/SPARC/Base.hsIan Lynagh2013-01-111-31/+24
|
* Implement word2Float# and word2Double#Johan Tibell2012-12-131-0/+2
|
* Remove OldCmm, convert backends to consume new CmmSimon Marlow2012-11-1213-51/+51
| | | | | | | | | | | | | | | | | | 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.
* Attach global register liveness info to Cmm procedures.Geoffrey Mainland2012-10-303-5/+5
| | | | | | | 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.
* 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
* 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 some more constants into platformConstantsIan Lynagh2012-09-143-17/+21
|
* Pass DynFlags down to wordWidthIan Lynagh2012-09-121-5/+5
|
* Pass DynFlags down to bWordIan Lynagh2012-09-126-20/+33
| | | | | | 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.
* Fix the PPC and SPARC NCGs to handle multiple info tables in a procSimon Marlow2012-09-071-16/+21
|
* Remove some old commented-out codeIan Lynagh2012-08-281-128/+0
|
* Move more code into codeGen/CodeGen/Platform.hsIan Lynagh2012-08-286-337/+26
| | | | | | | | 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-3/+1
| | | | The CmmBlocks inside CmmExprs were not getting the PIC treatment
* 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
* Convert prefix uses of (<>) to infix <>Ian Lynagh2012-08-051-1/+1
|