lightning
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Lightning] sse instructions and gcc warnings


From: Paulo César Pereira de Andrade
Subject: Re: [Lightning] sse instructions and gcc warnings
Date: Wed, 28 Jul 2010 23:29:36 -0300
User-agent: SquirrelMail/1.4.19

Paolo Bonzini wrote:

>>    I tried to build a simple test case to prevent/detect other problems
>> as I may again delay a bit more work in the jit backend, to work on
>> other optimizations/features in the language (I don't want to specialize
>> it too much for now as there several things that may still change).

  Updated version attached, to check load and store. Tested in i686
and latest git, pass all tests, no output (no news is good news :-)

>>    The x86_64 output, with CHECK_FLOAT defined to 1 is:
>> -%<-
>> $ gcc -O0 -g3 lightning-test.c
>> $ ./a.out
>> check0:58: 0.000000
>
> This is the movi_f issue, which I fixed in the git repo.

  Thanks!

>> check1:37: 0x40571f 0x4007d7
>> check1:38: 0x40572c 0x1
>> check1:39: 0x405737 0x1
>> check1:40: 0x405744 0x1
>> check1:43: 0x405767 0x1
>
> These are a bug in your program:
>
> -    jit_stxi_d (offsetof(types_t, uc),       V1, F0);
> +    jit_stxi_d (offsetof(types_t, d),        V1, F0);
>
> It now passes for both 32-bit and 64-bit.

  Oops, cut&paste fail :-)

  The attached patch should also "exercise" what I believe is a
problem (but no x86_64 shell right now...), that is
"ldr_c(JIT_R0, JIT_V0); ... str_l(JIT_V0, JIT_R0);"
where it will not sign extend the stored value in x86_64. This
probably would mean that all loads must use a 64 bits register,
and I don't know really how lightning logic is here, but I know that
in gcc (at least when I checked it some month ago), if I write:
    int i; short s; ... long l = i * s;
I must cast 'i' or 's' to long, or it will truncate the result to 32
bits.

> Paolo

Thanks,
Paulo

Attachment: lightning-test.c
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]