summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/X86
Commit message (Collapse)AuthorAgeFilesLines
...
* Add support for byte endian swapping for Word 16/32/64.Ian Lynagh2013-06-093-0/+18
| | | | | | | | | | | | * 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-5/+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.
* 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.
* Add prefetch primops.Geoffrey Mainland2013-02-011-0/+3
|
* 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
|
* 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-071-34/+90
| | | | | | | | | | | | | | | | | | | | | | | | 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-161-1/+1
|
* Implement word2Float# and word2Double#Johan Tibell2012-12-131-0/+13
|
* Remove OldCmm, convert backends to consume new CmmSimon Marlow2012-11-124-110/+116
| | | | | | | | | | | | | | | | | | 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
|
* 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.
* Cmm jumps always have live register information.Geoffrey Mainland2012-10-301-3/+2
| | | | Jumps now always have live register information attached, so drop Maybes.
* Some alpha renamingIan Lynagh2012-10-161-4/+4
| | | | | Mostly d -> g (matching DynFlag -> GeneralFlag). Also renamed if* to when*, matching the Haskell if/when names
* 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
|
* Teach the linear register allocator how to allocate more stack if necessarySimon Marlow2012-09-202-33/+90
| | | | | | | | | 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-163-24/+22
|
* Move some more constants into platformConstantsIan Lynagh2012-09-141-19/+22
|
* Move more constants into platformConstantsIan Lynagh2012-09-142-7/+9
|
* Pass DynFlags down to wordWidthIan Lynagh2012-09-121-10/+10
|
* Pass DynFlags down to bWordIan Lynagh2012-09-122-70/+78
| | | | | | 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.
* Remove some CPP from nativeGen/X86/Instr.hsIan Lynagh2012-08-281-5/+4
|
* Move more code into codeGen/CodeGen/Platform.hsIan Lynagh2012-08-283-285/+101
| | | | | | | | 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
* More CPP removal in nativeGen/X86/Regs.hsIan Lynagh2012-08-222-12/+10
|
* More CPP removal in nativeGen/X86/Regs.hsIan Lynagh2012-08-221-15/+10
|
* Remove some CPP in nativeGen/X86/Regs.hsIan Lynagh2012-08-222-30/+24
|
* Pass platform down to lastintIan Lynagh2012-08-211-15/+15
|
* Pass platform down to lastxmmIan Lynagh2012-08-212-23/+27
|
* Reduce the likelihood of x64/x86-64 changes breaking the build on other ↵Erik de Castro Lopo2012-08-211-36/+20
| | | | | | | | | | | | | | arches (#7083). Code that needs to differentiate between i386 and x86-64 should now be written as if x86-64 is the default and i386 is the special case. Eg: # if i386_TARGET_ARCH someFuncion = ..... # else someFuncion = ..... # endif
* Fix build failure on OS X (#7119)Simon Marlow2012-08-091-1/+2
| | | | | When refactoring this recently I accidentally put the dead-strip-preventer symbol (only used on OS X) in the wrong section.
* 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-4/+4
|
* fix warningsSimon Marlow2012-07-301-1/+1
|
* fix merge bugsSimon Marlow2012-07-301-4/+4
|
* New codegen: do not split proc-points when using the NCGSimon Marlow2012-07-301-42/+47
| | | | | | | | | 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-37/+45
|
* Remove most of the redundant Platform argument passing in nativeGen/X86/Ppr.hsIan Lynagh2012-07-181-327/+334
|
* Make -fPIC a dynamic flagIan Lynagh2012-07-161-11/+13
| | | | | | 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
|
* Fix build for non x86/x86_64 (#7065)Paolo Capriotti2012-07-111-1/+3
|
* Fix overlapping patterns warning (#7065)Paolo Capriotti2012-07-111-8/+10
|
* Don't re-allocate %esi on x86.Simon Marlow2012-07-091-0/+17
| | | | | | | | | | | | | Recent changes have freed up %esi for general use on x86 when it is not being used for R1. However, x86 has a non-uniform register architecture where there is no 8-bit equivalent of %esi. The register allocators aren't sophisticated enough to cope with this, so we have to back off and treat %esi as non-allocatable for now. (of course, LLVM doesn't suffer from this problem) One workaround would be to change the calling convention to use %rbx for R1, however we can't change the calling convention now without patching LLVM too.