Doubt over lib call generation

Hi,

The lib call (generated through LLVM framework) for 64 bit operation returns 64 bit value. But only the lower 32 bits are consumed. Even the users of higher part are consuming the lower 32 bit value only.

Consider the case in Sparc or ARM

long long lla, llb;

int ia;

void fun() {

lla = llb << ia;

}

For such targets in the DAG after LegalizeTypes the higher 32 bits are ignored. Why are these higher 32 bits ignored?

This is happening for all the lib calls returning integer value of non legal type.

Regards

Sachin

Hi,

Consider the case in Sparc or ARM

can you please provide a testcase in bitcode (or
LLVM assembler) form.

Thanks,

Duncan.

Hi,

> Consider the case in Sparc or ARM

can you please provide a testcase in bitcode (or
LLVM assembler) form.

Please find the bitcode file and C file attached with.

Regards
Sachin

trysparc.bc (476 Bytes)

trysparc.c (67 Bytes)

> > Consider the case in Sparc or ARM
>
> can you please provide a testcase in bitcode (or
> LLVM assembler) form.
>

Please find the bitcode file and C file attached with.

Thanks. It looks to me like the entire 64 bit result
of __ashrdi3 is being used. In the SelectionDAG you
can see this clearly, and in the final assembler the
two 32 bit halves seem to correspond to %o1 and %o0:

        call __ashrdi3
        nop
        add %l0, %lo(lla), %l1
        st %o1, [%l1+4]
        st %o0, [%l0+%lo(lla)]

Ciao,

Duncan.