> Simon Marlow wrote:
> > [...] Just out of interest, do you know whether doubles 
> *must* be aligned
> > on an 8-byte boundary on HP, or is it just a performance thing?
> 
> Well, it depends on your definition of "performance": Failing to align
> doubles on 8-byte-boundaries on HPs results in highly efficient
> core-dump-producers:     :-)

This is a particularly annoying thing.  Every machine has a different policy
on misaligned doubles:

        - x86:    reduced performance
        - sparcs: older (sun4c?) core dump
                    newer (sun4m, sun4u) reduced performance
        - HP:     core dump
        - alpha:  no core dump, but warning message on console :-)

GHC has to deal with misaligned doubles, because otherwise we'd have to
align every stack/heap object on an 8-byte boundary which would waste a load
of memory.  We just need to know whether we can do it directly, or the
slightly slower way of casting back/forth using a union (actually, the C
compiler *ought* to generate the same code, but it doesn't always).

Cheers,
        Simon

-- 
Simon Marlow 
Microsoft Research Ltd., Cambridge, U.K.

Reply via email to