Hi,

Anybody familiar with reading abstractC output?
I was looking at the dump of a .hc file for the prog:

    avitup xs = case xs of
                []     -> (0,0)
                (y:ys) -> let (u,v) = avitup ys in (y+u,1+v)

and I noticed a fragment of the dump contains ...

        static const W_ vtbl_C5GZ[] = {
        (W_) djn_C5Gz_1, (W_) djn_C5GZ_2
        };

/* I guess that the above is the continuation / return vector for the case
stmt? And if so ... I think the first address is the first branch which
is suppose to return (0,0) ? */

        IFN_(djn_C5GZ_1) {
        ED_RO_(Tup2_inregs_info)

        FB_
        R3.p = SpA[2];
        R4.p = SpA[1];
        SpA = SpA + 6;
        SpB = SpB - 1;
        R2.d=Tup2_inregs_info

        JMP_(DIRECT((StgRetAddr (SpB[1])));
        FE_
        }

/* The code in the second djn_C5GZ_2 address is much longer but ends in a
similar fashion */


Question: 

1.  Am I correct to say that the return tuple was never built at all but
returned through registers?  And if so, what is Tup2_inregs_info? 

2.  Does ghc compile all tuples to return in registers?  Or does it do so
for tuples up to a certain length? 

3.  Is there a guide for us to decipher abstractC syntax... or perhaps the
more common stuff like: 

        IFN_(...)
        ED_RO_(...)
        ID_RO_(...)
        FB_,
        FE_,
        SPEC_U_ITBL(...12 items in here...)
        SPEC_N_ITBL(...12 items in here...)
        SET_SPEC_HDR(...5 items in here...)

Thanks in advance,

Aik Hui

Reply via email to