| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
It allows you to do
(high, low) `quotRem` d
provided high < d.
Currently only has an inefficient fallback implementation.
|
| |
|
|
|
|
| |
In particular, fixes for FP arguments
|
| |
|
|
|
|
|
| |
We need to leave stack space for arguments that we are passing in
registers.
|
| |
|
| |
|
| |
|
|
|
|
| |
Currently no NCGs support it
|
| |
|
|
|
|
| |
No special-casing in any NCGs yet
|
|
|
|
|
| |
Currently it does nothing, as x86_64 supports all the callishMachOps
that expandCallishMachOp expands, but it might be needed in the future.
|
|
|
|
| |
Only amd64 has an efficient implementation currently.
|
|
|
|
| |
Moved the default case of genCCall64 out into a separate function
|
|
|
|
|
| |
This means we no longer do a division twice when we are using quotRem
(on platforms on which the op is supported; currently only amd64).
|
|
|
|
|
|
|
|
|
| |
We now carry around with CmmJump statements a list of
the STG registers that are live at that jump site.
This is used by the LLVM backend so it can avoid
unnesecarily passing around dead registers, improving
perfromance. This gives us the framework to finally
fix trac #4308.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This field was doing nothing. I think it originally appeared in a
very old incarnation of the new code generator.
|
| |
|
| |
|
|
|
|
|
|
|
| |
We now manage the stack correctly on both x86 and i386, keeping
the stack align at (16n bytes - word size) on function entry
and at (16n bytes) on function calls. This gives us compatability
with LLVM and GCC.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The stdcall calling convention is not supported on x86_64.
When an ffi import requests stdcall, a warning is issued as
desired by #3336. However, the native codegen was still
generating code that expected the callee to cleanup the
stack arguments when calling a c function that requests
stdcall.
This patch changes the codegen to actually use the ccall
calling convention as intended.
Signed-off-by: David Terei <davidterei@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch changes the STG code so that %rsp to be aligned
to a 16-byte boundary + 8. This is the alignment required by
the x86_64 ABI on entry to a function. Previously we kept
%rsp aligned to a 16-byte boundary, but this was causing
problems for the LLVM backend (see #4211).
We now don't need to invoke llvm stack mangler on
x86_64 targets. Since the stack is now 16+8 byte algined in
STG land on x86_64, we don't need to mangle the stack
manipulations with the llvm mangler.
This patch only modifies the alignement for x86_64 backends.
Signed-off-by: David Terei <davidterei@gmail.com>
|
| |
|
| |
|
| |
|
|
|
|
| |
And some knock-on changes
|
| |
|
| |
|
| |
|
|
|
|
|
| |
CmmTop -> CmmDecl
CmmPgm -> CmmGroup
|
| |
|
|
|
|
|
|
|
| |
in X86.CodeGen.getNonClobberedOperand: two code fragments were the
wrong way around, and we were using the wrong size on an
instruction (32 bits instead of the word size). This bit of the code
generator must have never worked!
|
| |
|
|
|
|
|
|
|
|
| |
were accidentally zeroing out the high 32 bits.
This bug must have been here for ages, it was only just exposed by the
new Typeable code which uses two 64-bit values to store a 128-bit
hash, and so exercises the code generation for 64-bit stuff.
|
|
|
|
| |
Just a small refactoring. Makes it a little less intimidating.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
There's now a variant of the Outputable class that knows what
platform we're targetting:
class PlatformOutputable a where
pprPlatform :: Platform -> a -> SDoc
pprPlatformPrec :: Platform -> Rational -> a -> SDoc
and various instances have had to be converted to use that class,
and we pass Platform around accordingly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I observed that the [CmmStatics] within CmmData uses the list in a very stylised way.
The first item in the list is almost invariably a CmmDataLabel. Many parts of the
compiler pattern match on this list and fail if this is not true.
This patch makes the invariant explicit by introducing a structured type CmmStatics
that holds the label and the list of remaining [CmmStatic].
There is one wrinkle: the x86 backend sometimes wants to output an alignment directive just
before the label. However, this can be easily fixed up by parameterising the native codegen
over the type of CmmStatics (though the GenCmmTop parameterisation) and using a pair
(Alignment, CmmStatics) there instead.
As a result, I think we will be able to remove CmmAlign and CmmDataLabel from the CmmStatic
data type, thus nuking a lot of code and failing pattern matches. This change will come as part
of my next patch.
|
|
|
|
|
|
|
|
|
|
| |
OS X (#5250).
The OS X ABI requires the C stack pointer to be 16-byte aligned at a
function call. As far as I know this is not a requirement on other
x86 ABIs, but it seems that gcc is now generating SSE2 code that
assumes stack alignment (-mincoming-stack-boundary defaults to 4), so
we have to respect 16-byte alignment.
|
| |
|
| |
|
| |
|
| |
|