logo       

Re: trying to get a registerised alpha build: msg#00002

lang.haskell.glasgow.bugs

Subject: Re: trying to get a registerised alpha build


Just to follow up on this:

I have some patches to the mangler for Linux/Alpha that we are currently
testing. I have pushed these to the gentoo-haskell darcs repository for the
Gentoo Haskell herd to try out. The patches (hopefully) fix the following
problems I have discovered with enabling registerised ghc-6.4.1 on the
Alpha:

1. Current binutils for Linux/Alpha no longer supports deprecated ECOFF
directives inherited from OSF/1; namely .rdata. I have created a separate
section of definitions for Linux/Alpha which substitute .text for .rdata in
this case.

2. The Alpha-specific pattern-matching for __DISCARD__ sections did not
catch any of the current output from the current gcc code generator for
Alpha. I modified these to detect (and eliminate) the __DISCARD__ lines
produced by recent gcc versions for Linux/Alpha.

3. The mangler appears to emit .end directives for coalesced infotbl/entry
chunks too early. The GNU assembler complains that .prologue directives are
not enclosed within a .ent/.end pair, and refuses to assemble the file. I
have fixed this, so that the proper .end directive is emitted at the end of
the assembly code near the end of the chunk, as expected by the assembler.

It is not entirely clear that these changes do not break the mangler for
OSF/1 / DigitalUNIX / Tru64, but as I do not have this OS for my Alpha at
this time, I have no way of testing this. It is possible that these changes
might break the mangler for OSF/1 and later.

It is also possible that some of my changes might be rewritten in a more
concise Perl style. I was simply going for something that works, as an
initial proof-of-concept.

I am currently testing these changes along with Fernando J. Pereda's patch
to TailCalls.h, which hopefully fixes a register spill problem for Alpha.
My build is currently in the phase of building the stage2 compiler. With my
changes to the mangler, correct Linux/Alpha assembly code appears to be
generated, and I have not seen any assembler errors yet. It is still
possible that further debugging may be necessary, however.

Assuming a successful outcome, I am sure Duncan will share our patches with
you. Ideally, we would also like to get the splitter and ghci working on
Linux/Alpha as well, but we figured that fixing the registerised build would
be the proper first step in that direction.

I will keep you posted as to my progress.

Cheers,

+chris


On 3/30/06 3:51 PM, "Duncan Coutts" <duncan.coutts@xxxxxxxxxxxxx> wrote:

> On Thu, 2006-03-30 at 20:23 +0100, Duncan Coutts wrote:
>
> Things are very slowly becoming clearer...
>
>> We compiled a little module with the stage1 compiler. So we get
>> registerised output assembly. It is using machine registers and making
>> tail calls. We've looked through the assembly but we can't see anything
>> obviously wrong yet.
>
> Well as I said, we were not using the mangler because it wasn't working.
> But of course that means that we can't use tail calls! Doh.
>
> So the code was trying to make tail calls, and we couldn't see anything
> obviously wrong with the calling sequence. But if we're not using the
> mangler then
>
>> I assume it's possible to enable the various aspects of the registerised
>> built one by one and have something (mostly) working in between?
>
> So no. :-) There are dependencies between them which we didn't fully
> understand at the beginning.
>
> What would you recommend is the bat way for us to verify that each bit
> of the registerised build is working? If we turn everything on including
> the mangler and it breaks where do we start debugging?
>
> Is it possible to build without tailcalls (ie using the
> mini-interpreter) but using the stg->machine register mappings? Or how
> about the other way around - using tail calls (& that aspect of the
> mangler) but not using any machine regs. And similarly, can we not turn
> on the tables next to code bits?
>
> What's the best way of building stage1/stage2 ghc and all the C code it
> generates with debugging info?
>
> We're using this mk/build.mk:
>
> SRC_HC_OPTS = -H32m -O0
> GhcStage1HcOpts = -O0 -DDEBUG
> GhcStage2HcOpts = -O0 -DDEBUG -optc-g
> GhcLibHcOpts =
> GhcLibWays = debug
> SplitObjs = NO
>
>
> Sorry, lots of questions. :-)
>
> But if we can get registerised alpha working, we'll try hppa & mips
> next... ;-)
>
> Duncan
>
>


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise