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: Mon, 26 Jul 2010 04:49:32 -0300
User-agent: SquirrelMail/1.4.19

Paolo Bonzini wrote:
> On 07/26/2010 08:45 AM, Paulo César Pereira de Andrade wrote:
>>    Hi,
>>
>>    I did some more extra work in the lightning jit code generation
>> in my language
>> http://code.google.com/p/exl/source/browse/trunk/lib/elightning.c
>>
>>    It is still basically using lightning only to glue calls to C
>> functions, but I added some extra code for statically typed objects
>> yesterday and today...
>>
>>    But about @subject:
>> elightning.c:1664: warning: left-hand operand of comma expression has no
>> effect
>> elightning.c:1664: warning: value computed is not used
>>
>> any code using the float registers shows those.
>
> These are harmless and kind of inevitable.
>
>   There are some others
>> on x86_64 that cannot be masked, due to mixing int32 and void*.
>
> Do you have a small testcase for this?

  I will check as soon as I have access to a x86_64 (then I will
also correct any problems I may have added in the recent code, and
remove the #if JIT_TESTING and #if JIT_BRANCH_TESTING, as it was
only tested in i686).

>> A strange one is:
>> elightning.c:1616: warning: implicit declaration of function
>> ‘jit_replace’
>> elightning.c:1616: warning: nested extern declaration of ‘jit_replace’
>>
>> that probably is harmless, as it links and works.
>
> It links only because the particular combination involving jit_replace
> was optimized out by the compiler.  I committed a fix, too bad I don't
> really have the time to write a test case too. :(

  This started happening when I added calls to jit_str_c, jit_str_uc,
etc, and apparently doesn't happen if there are only calls to
jit_stxi_s, jit_stxi_us, etc, but I am not 100% sure now.

>>    Also about @subject, I needed to add a global function to check
>> if a double is zero, because apparently the i387 goes nonsense if
>> a function using vector instructions was called.
>
> Argument passing in i387 was buggy, it is kind of impossible to get it
> right due to the stack-like registers. :(
>
> I think I'm going to change it to use SSE always except for argument
> passing.  Would this be a problem?

  I think x86 non sse processors are not manufactured for several
years, but probably better to require SSE2 or lower. As long as it
works, I don't have any objections :-) One thing I noticed is that
on x86_64, -0.0 literal looses sign when loaded/stored using
lightning, but works correctly in C where the sign bit is preserved,
but it is not much of an issue for me, as at least for now I gave up
on providing correct double zero sign in my language.

> Paolo

Thanks,
Paulo




reply via email to

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