summaryrefslogtreecommitdiff
path: root/compiler/nativeGen
Commit message (Collapse)AuthorAgeFilesLines
* Add support for byte endian swapping for Word 16/32/64.Austin Seipp2013-07-176-0/+39
| | | | | | | | | | | | | * 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-182-2/+2
| | | | | | 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-116-29/+0
| | | | This reverts commit 1c5b0511a89488f5280523569d45ee61c0d09ffa.
* Add support for byte endian swapping for Word 16/32/64.Ian Lynagh2013-06-096-0/+29
| | | | | | | | | | | | * 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.
* Make the current module available to labelDynamicIan Lynagh2013-05-133-59/+78
| | | | It doesn't actually use it yet
* Use NatM_State record fields, rather than matching/constructing the whole typeIan Lynagh2013-05-131-12/+7
|
* Refactor cmmMakeDynamicReferenceIan Lynagh2013-05-135-20/+27
| | | | | 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 redundant cmmMakeDynamicReference' wrapperIan Lynagh2013-05-131-4/+2
|
* No need to map over all blocks, setting up PIC.Gabor Greif2013-04-131-12/+4
| | | | | Darwin x86 has inconsistent PIC base register, so splitting (which happened before) ensures that each cmm procedure only has one entry point (namely the first block).
* Make explicit that there can be only one entry pointGabor Greif2013-04-121-3/+3
| | | | | | per cmm procedure on Darwin/PPC, because of splitting. x86 should be treated the same way, I'll come back to that later.
* There can be several blocks in a PPC/ELF cmm procGabor Greif2013-04-081-8/+15
| | | | add FETCHPC to all of them (this fixes #7814).
* Remove tabs (M-x untabify)Gabor Greif2013-04-071-99/+91
|
* Fix typosGabor Greif2013-04-073-6/+6
|
* TyposGabor Greif2013-04-071-1/+1
|
* Detab modules with tabs on 5 lines or fewerIan Lynagh2013-04-062-25/+11
|
* Fix typosGabor Greif2013-04-063-3/+3
|
* Simplify away some old -dynamic-too stuff from the previous approachIan Lynagh2013-03-091-48/+33
|
* x86: promote arguments to C functions according to the ABI (#7383)Simon Marlow2013-02-231-6/+14
| | | | | | | | | I don't think the x86-64 version is quite right, but this ought to be enough to pass cgrun071. This code is terrible and needs a complete refactor. There's a lot of duplication, and we ought to be specifying the ABI in a much more abstract way (like LLVM).
* allocMoreStack: we should be retargetting table jumps too.Simon Marlow2013-02-111-3/+3
| | | | Thanks to @PHO on #7498 for pointing this out.
* 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-022-11/+13
| | | | 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-022-39/+40
| | | | Its implementation is totally specific to PPC.
* Add prefetch primops.Geoffrey Mainland2013-02-013-0/+5
|
* Add support for passing SSE vectors in registers.Geoffrey Mainland2013-02-011-41/+47
| | | | | | | This patch adds support for 6 XMM registers on x86-64 which overlap with the F and D registers and may hold 128-bit wide SIMD vectors. Because there is not a good way to attach type information to STG registers, we aggressively bitcast in the LLVM back-end.
* Add the Int32X4# primitive type and associated primops.Paul Monday2013-02-011-0/+18
|
* Add the Float32X4# primitive type and associated primops.Geoffrey Mainland2013-02-011-1/+35
| | | | | | | | | | | | | This patch lays the groundwork needed for primop support for SIMD vectors. In addition to the groundwork, we add support for the FloatX4# primitive type and associated primops. * Add the FloatX4# primitive type and associated primops. * Add CodeGen support for Float vectors. * Compile vector operations to LLVM vector operations in the LLVM code generator. * Make the x86 native backend fail gracefully when encountering vector primops. * Only generate primop wrappers for vector primops when using LLVM.
* typosGabor Greif2013-01-301-1/+1
|
* Merge branch 'master' of https://github.com/ghc/ghcJohan Tibell2013-01-111-31/+24
|\
| * 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
| |
* | Add preprocessor defines when SSE is enabledJohan Tibell2013-01-101-10/+2
|/ | | | | | | | | | | This will add the following preprocessor defines when Haskell source files are compiled: * __SSE__ - If any version of SSE is enabled * __SSE2__ - If SSE2 or greater is enabled * __SSE4_2_ - If SSE4.2 is enabled Note that SSE2 is enabled by default on x86-64.
* 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
|