lightning
[Top][All Lists]
Advanced

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

Re: [Lightning] About jit_roundr_d_i


From: Paulo César Pereira de Andrade
Subject: Re: [Lightning] About jit_roundr_d_i
Date: Sat, 11 Sep 2010 11:00:03 -0300

Em 11 de setembro de 2010 09:38, Paolo Bonzini <address@hidden> escreveu:
> 2010/9/10 Paulo César Pereira de Andrade
> <address@hidden>:
>>  On x86_64 I need to call jit_extr_d_f(JIT_FPR(x), JIT_FPR(y))
>> to pass it as printf argument, if it is a float, otherwise, nothing
>> is required.
>
> Minimal test case and generated code?

  I only have ssh to a x86_64 right now, but I guess I have to fix
error reporting in several of my test cases; the error reports will
print zeroes or garbage if an error happens :-) Testing this
script:
-%<-
.data   16
fmt:
.c      "%f\n"
.code   1024
        prolog 0
        movi_p %v0 fmt
printf_d_f0:
        movi_d %f0 1.0
        prepare 1
        prepare_d 1
                pusharg_d %f0
                pusharg_p %v0
        finish @printf
extr_d_f__f1_f0:
        movi_f %f0 1.0
        extr_d_f %f1 %f0
        prepare 1
        prepare_d 1
                pusharg_d %f1
                pusharg_p %v0
        finish @printf
extr_f_d__f1_f0:
        movi_f %f0 1.0
        extr_f_d %f1 %f0
        prepare 1
        prepare_d 1
                pusharg_d %f1
                pusharg_p %v0
        finish @printf
extr_d_f__f0_f0:
        movi_f %f0 1.0
        extr_d_f %f0 %f0
        prepare 1
        prepare_d 1
                pusharg_d %f0
                pusharg_p %v0
        finish @printf
extr_f_d__f0_f0:
        movi_f %f0 1.0
        extr_f_d %f0 %f0
        prepare 1
        prepare_d 1
                pusharg_d %f0
                pusharg_p %v0
        finish @printf
        ret
-%<-

it prints:

1.000000
0.000000
1.000000
0.000000
1.000000

so, it is, correctly, extr_f_d to convert a float to a double, and
not the other way around...

>>  I still did not push the change because I am still working on a
>> proper jit_roundr_x_y, and I aliased, at least for now, and only for
>> me, a new jit_rintr_x_y, to the previous jit_roundr_x_y.
>
> I am a bit wary of introducing new opcodes since that would have to be
> done for PowerPC and SPARC too.

  Well, I am still working my way on properly understanding the stack
layout of the x87... I will try to update still today a more complete,
working, prototype of the code, with initial hooks to allow x86_64
to use x87; extra registers, ABI for long double, or just for the fun
of using it instead of SSE.

> The runtime reconfigurability looks nice though!

  Thanks. I am initially working on the x87 logic, mainly to mature
some ideas, but the idea is to work to use SSE* to full extent, and
enable it on ix86.

> Paolo

Thanks,
Paulo



reply via email to

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