lightning
[Top][All Lists]
Advanced

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

Re: [Lightning] Retrieve the register corresponding to a register argume


From: Paulo César Pereira de Andrade
Subject: Re: [Lightning] Retrieve the register corresponding to a register argument
Date: Fri, 4 Jan 2019 13:59:24 +0000

Em sáb, 29 de dez de 2018 às 11:51, Marc Nieper-Wißkirchen
<address@hidden> escreveu:
>
> Hi Paulo,

  Hi Marc,

> let's assume that `jit_arg_register_p` returns true for a specific
> argument IN. How can I retrieve the corresponding register (of type
> `jit_gpr_t`)?
>
> For an example, consider the following code:
>
> in1 = arg
> in2 = arg
> movr R0, in1
> addr R0, in2
> retr R0
>
> Something like the following should be possible (assuming that
> `arg_register_p` returns true for `in1` and `in2`:
>
> in1 = arg
> in2 = arg
> addr REGISTER_OF(in1), REGISTER_OF(in2)
> retr REGISTER_OF(in1)

  'arg_register_p' was added as a way to spill/reload register arguments. See
example usage in check/carg.c

  The functionality you suggest could be done automatically by an optimization
pass. But I am uncertain if it would even be added, just that the infrastructure
is there.

  It would not be supported, but the easiest approach would be to just know
the ABI and use the matching argument register. On x86_64 it defines the
symbols _RDI, _RSI, _RDX, _RCX, _R8, _R9. Otherwise it would be required
to know too much the internals, but for all ports it would be "JIT_RA0
- in1->u.w".

  The best approach should be to extend lightning to define some symbols, for
example JIT_RA0 ... JIT_RAN and JIT_FA0 ... JIT_FAN, then, code could check if
the preprocessor symbols are defined, and generate jit accordingly.  This should
be considered for a new lightning release. For the moment it just
attempts to keep
a simple method for all ports, but really such functionality would
basically only
generate slightly smaller code

> Thanks,
>
> Marc

Thanks,
Paulo



reply via email to

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