| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most of the other users of the fptools build system have migrated to
Cabal, and with the move to darcs we can now flatten the source tree
without losing history, so here goes.
The main change is that the ghc/ subdir is gone, and most of what it
contained is now at the top level. The build system now makes no
pretense at being multi-project, it is just the GHC build system.
No doubt this will break many things, and there will be a period of
instability while we fix the dependencies. A straightforward build
should work, but I haven't yet fixed binary/source distributions.
Changes to the Building Guide will follow, too.
|
|
|
|
|
| |
When the volatile regs attached to a CmmCall is Nothing, it means
"save everything", not "save nothing".
|
| |
|
| |
|
|
|
|
|
| |
Fix previous patch "NCG: Handle loops in register allocator"
Of course, I broke it when correcting a style problem just before committing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fill in the missing parts in the register allocator so that it can
handle loops.
*) The register allocator now runs in the UniqSuppy monad, as it needs
to be able to generate unique labels for fixup code blocks.
*) A few functions have been added to RegAllocInfo:
mkRegRegMoveInstr -- generates a good old move instruction
mkBranchInstr -- used to be MachCodeGen.genBranch
patchJump -- Change the destination of a jump
*) The register allocator now makes sure that only one spill slot is used
for each temporary, even if it is spilled and reloaded several times.
This obviates the need for memory-to-memory moves in fixup code.
LIMITATIONS:
*) The case where the fixup code needs to cyclically permute a group of
registers is currently unhandled. This will need more work once we come
accross code where this actually happens.
*) Register allocation for code with loop is probably very inefficient
(both at compile-time and at run-time).
*) We still cannot compile the RTS via NCG, for various other reasons.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
For 32-bit float primtives like sinFloat#, we currently call the
double versions of the C library functions (sin(), cos() etc.). It
seems more correct to call the float versions (sinf(), cosf() etc.).
This makes a difference on x86_64, I'm not entirely sure why, but this
way at least generates more consistent results and avoids extra
promotion/demotion instructions when calling these primitives.
|
| |
|
|
|
|
| |
Remove duplicate imports
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for UTF-8 source files
GHC finally has support for full Unicode in source files. Source
files are now assumed to be UTF-8 encoded, and the full range of
Unicode characters can be used, with classifications recognised using
the implementation from Data.Char. This incedentally means that only
the stage2 compiler will recognise Unicode in source files, because I
was too lazy to port the unicode classifier code into libcompat.
Additionally, the following synonyms for keywords are now recognised:
forall symbol (U+2200) forall
right arrow (U+2192) ->
left arrow (U+2190) <-
horizontal ellipsis (U+22EF) ..
there are probably more things we could add here.
This will break some source files if Latin-1 characters are being used.
In most cases this should result in a UTF-8 decoding error. Later on
if we want to support more encodings (perhaps with a pragma to specify
the encoding), I plan to do it by recoding into UTF-8 before parsing.
Internally, there were some pretty big changes:
- FastStrings are now stored in UTF-8
- Z-encoding has been moved right to the back end. Previously we
used to Z-encode every identifier on the way in for simplicity,
and only decode when we needed to show something to the user.
Instead, we now keep every string in its UTF-8 encoding, and
Z-encode right before printing it out. To avoid Z-encoding the
same string multiple times, the Z-encoding is cached inside the
FastString the first time it is requested.
This speeds up the compiler - I've measured some definite
improvement in parsing at least, and I expect compilations overall
to be faster too. It also cleans up a lot of cruft from the
OccName interface. Z-encoding is nicely hidden inside the
Outputable instance for Names & OccNames now.
- StringBuffers are UTF-8 too, and are now represented as
ForeignPtrs.
- I've put together some test cases, not by any means exhaustive,
but there are some interesting UTF-8 decoding error cases that
aren't obvious. Also, take a look at unicode001.hs for a demo.
|
|
|
|
| |
Missing Show instance for FreeRegs on PowerPC
|
|
|
|
| |
x86 & PIC: make floating point constants on x86 PIC-aware
|
|
|
|
| |
PowerPC: track changes in the rest of the register allocator
|
|
|
|
| |
Make outOfLineFloatOp PIC/dynamic-linking-aware on i386
|
|
|
|
| |
PIC version for genSwitch on i386
|
|
|
|
|
|
| |
Darwin/x86:
Honour the 16-byte stack alignment requirement when ccalling from the NCG.
|
|
|
|
| |
save + restore caller-saves registers around foreign calls
|
|
|
|
| |
Add callerSaveVolatileRegs for saving registers around C calls
|
|
|
|
|
| |
Fix a bad space leak in the native code generator: turn a couple of
lazy tuple matches into strict matches.
|
|
|
|
| |
some small optimisations
|
|
|
|
| |
Sparc updates from Peter A Jonsson <pj at ludd.ltu.se>
|
|
|
|
| |
Undo accidental commit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Re-implement GHCi's :info and :browse commands in terms of TyThings
rather than IfaceSyn.
The GHC API now exposes its internal types for Haskell entities:
TyCons, Classes, DataCons, Ids and Instances (collectively known as
TyThings), so we can inspect these directly to pretty-print
information about an entity. Previously the internal representations
were converted to IfaceSyn for passing to InteractiveUI, but we can
now remove that code.
Some of the new code comes via Visual Haskell, but I've changed it
around a lot to fix various dark corners and properly print things
like GADTs.
The pretty-printing interfaces for TyThings are exposed by a new
module PprTyThing, which is implemented purely in terms of the GHC API
(and is probably a good source of sample code). Visual Haskell should
be able to use the functions exported by this module directly.
Lots of new goodies are exported by the GHC module, mainly for
inspecting TyThings.
|
|
|
|
|
|
|
|
|
| |
Fix a typo: powerpc32_TARGET_OS -> powerpc64_TARGET_OS
This didn't do any actual damage, because powerpc64 is not yet supported
by the NCG and powerpc32 is called just 'powerpc'.
MERGE TO STABLE
|
|
|
|
|
|
|
|
| |
Registerised support for Darwin/x86, both NCG and mangled.
*) -fPIC doesn't work yet with -fvia-C.
*) Apple officially requires the stack to be 16-byte-aligned,
GHC ignores this for now.
|
|
|
|
|
|
|
|
| |
Warning police: Removed overlapped patterns. In general, taking
compiler warnings about unmatched patterns seriously when they come up
later might be better than writing catch-all patterns right from the
start. Otherwise readers are confused and wonder which patterns might
be missing when there are none.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Catch an exception in Template Haskell code
Merge to STABLE
If the code run by a Template Haskell splice fails with, say,
a pattern-match failure, we should not report it as a GHC panic.
It's a bug in the user's program.
This commit fixes up the exception handling to do the right thing.
Fixes SourceForge item #1201666
TH_fail tests it.
|
|
|
|
|
| |
Clean up things by making PicBaseReg a constructor of GlobalReg instead
of CmmExpr.
|
|
|
|
| |
MO_S_Conv folding: fold floating-point literals properly
|
|
|
|
| |
i386 wibble
|
|
|
|
|
| |
x86_64: hang register parameters off the call instruction, like
powerpc does. This gives the register allocator better information.
|
|
|
|
|
| |
showReg(x86_64): fix
callerSaves: fix
|
|
|
|
| |
Fix breakage in i386 floating-pt comparisons
|
|
|
|
|
|
| |
Fix register allocation bug: at a branch destination we weren't
setting the free register set correctly. This may have resulted in
poor code in some cases; worst case it causes a Prelude.head: empty list.
|
|
|
|
| |
Fix i386 breakage
|
|
|
|
| |
A couple of optimisations to float code
|
|
|
|
| |
Add a Todo
|
|
|
|
| |
Fix i386 breakage
|
|
|
|
| |
fix breakage in i386 native codegen
|
|
|
|
|
|
|
|
|
|
|
| |
x86_64 hacking:
- use %rip-relative addressing in a couple of places
- floating-point comparisons handle NaN properly
I believe the x86_64 NCG is now ready for prime time. It is
successfully bootstrapping the compiler, and I think this fixes the
last of the test failures.
|
|
|
|
| |
x86_64: fix brainos in implementation of fl. pt. negation
|
|
|
|
| |
Implement the out-of-line floating-point MachOps
|
|
|
|
|
|
|
|
| |
x86_64: generate 32-bit relative offset plus 32-bit padding instead of
a 64-bit relative offset. This is probably not the best place to do
it, but it'll do for now.
Also reinstate some changes that accidentally got spammed yesterday.
|
|
|
|
|
|
|
| |
Use the imul instruction natively, rather than the braindead wrapper
around it. The register allocator has been able to handle the fixed
register usage of imul for a while now. Also, the wrapper was broken
on x86_64.
|
|
|
|
| |
wibble
|
|
|
|
|
| |
x86_64: some small optimisations to instruction selection, taking
advantage of automatic zero-extension of 32-bit results.
|
|
|
|
|
|
|
|
| |
regUsage(x86_64): tell the register allocator that argument registers are read
by call instructions.
mkSpillInstr/mkLoadInstr(x86_64): implement FP spills/loads, not sure
if this is quite right yet.
|
|
|
|
| |
x86_64: fix reg printing
|