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: Fri, 30 Jul 2010 21:43:40 -0300
User-agent: SquirrelMail/1.4.19

Paolo Bonzini wrote:
>> But I would really prefer to have it properly sign extending
>
> That's a bug.

  Thanks. That was my understanding, and my workaround was code like:

    jit_ldr_c(JIT_R0, JIT_R1);
    jit_stxi_l(offsetof(ethread_t, r0) + offsetof(evalue_t, v.i),
               JIT_V1, JIT_R0);
    /* sign extend by "hand" */
    jit_rshi_i(JIT_R0, JIT_R0, 7);
    jit_stxi_i(offsetof(ethread_t, r0) +
               offsetof(evalue_t, v.i) +
               offsetof(edata_t, s.h),
               JIT_V1, JIT_R0);

  I confess I did not yet test jit_extr for "in register" sign extension,
but could also have been an alternative. (I just did a cut&paste of the
32 bits logic, as at least for now, in the language, non mpz_t integers
are 64 bit ones, long long on ix86).

  Also sorry for the misunderstanding on how to push float/double
arguments on x86_64. I made a test with jit_prepare_d() and I think
I understood it, but the testcase dereferencing a pointer on x86_64
should be ok for testing load/stores. I was also a bit confused
because earlier I did not bother to attempt to figure how to call
a varargs function from jit in x86_64 (the function would call
vfprint), and just preferred to convert it to non vararg (I feel
that may be a regression, but unsure if lightning should handle it,
or just have a ffi in C, but it is a todo for the future...).

> Paolo

Thanks,
Paulo




reply via email to

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