lightning
[Top][All Lists]
Advanced

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

Re: Atomic operations


From: Marc Nieper-Wißkirchen
Subject: Re: Atomic operations
Date: Sat, 13 Aug 2022 22:15:20 +0200

Hi Paulo!

Am Fr., 12. Aug. 2022 um 19:01 Uhr schrieb Paulo César Pereira de Andrade <paulo.cesar.pereira.de.andrade@gmail.com>:

[...]

> However, an instruction that can be used to embed data is of higher priority for me.  Would this be implemented with the various is, ic, ... macros in each jit-XXX-cpu.c?  After such an instruction, would the alignment have to be adjusted, or is it done by lightning automatically on those ports where instructions have to be aligned?

  A good name for it could be jit_embed(void *data, jit_int32_t length);
And just memcpy the data verbatim. It would be required to keep a
copy of the argument until code is finally emitted.
  Should not embed more than jit_get_max_instr() bytes, that is basically
JIT_MAX_INSTR. Otherwise, it might end up writing code out of bounds.
  Alignment is not automatically done before emitting code, so, it should
keep code aligned.
  There is a, far more complicated than needed, example in jit_arm.c,
basically in _flush_consts() it does:
    jit_memcpy(_jitc->consts.data, _jitc->consts.values, _jitc->consts.size);
    _jit->pc.w += _jitc->consts.size;

Thank you for this information.  Where do I find/how do I determine the alignment that is needed?  In _flush_consts () in jit_arm.c, an alignment of 32-bit seems to be maintained.


reply via email to

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