mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-20 18:50:21 +02:00
Implement the jit_align interface
* lib/jit_aarch64-cpu.c, lib/jit_alpha-cpu.c, lib/jit_arm-cpu.c, lib/jit_hppa-cpu.c, lib/jit_mips-cpu.c, lib/jit_ppc-cpu.c, lib/jit_sparc-cpu.c: Implement or correct the internal nop(count) call that receives an argument that tells the modulo bytes to align the code for the next instruction. * include/lightning.h, lib/lightning.c, lib/jit_aarch64.c, lib/jit_alpha.c, lib/jit_arm.c, lib/jit_hppa.c, lib/jit_ia64.c, lib/jit_mips.c, lib/jit_ppc.c, lib/jit_s390x.c, lib/jit_sparc.c, lib/jit_x86.c: Implement the new jit_align() call that receive an argument, that tells the modulo, in bytes, to align the next instruction. In most backends the only value that makes a difference is a value that matches sizeof(void*), as all other values usually are already automatically aligned in labels, but not guaranteed to be aligned at word size bytes. * check/align.ok, check/align.tst: New files, implementing a simple test for the new jit_align() interface. * check/Makefile.am, check/lightning.c, lib/jit_aarch64-sz.c, lib/jit_alpha-sz.c, lib/jit_arm-sz.c, lib/jit_hppa-sz.c, lib/jit_ia64-sz.c, lib/jit_mips-sz.c, lib/jit_ppc-sz.c, lib/jit_print.c, lib/jit_s390x-sz.c, lib/jit_sparc-sz.c, lib/jit_x86-sz.c: Update for the new jit_code_align code and the jit_align() interface.
This commit is contained in:
parent
dbb1bb2409
commit
afae5407f6
33 changed files with 180 additions and 20 deletions
|
@ -640,6 +640,8 @@ static void _f38(jit_state_t*,jit_int32_t,
|
|||
#define UADDCM(r1,r2,t) f8(0x2,r2,r1,ADD_CF_NV,2,0,1,2,0,t)
|
||||
#define UXOR(r1,r2,t) f8(0x2,r2,r1,LOG_CC_NV,0,1,1,2,0,t)
|
||||
#define XOR(r1,r2,t) f8(0x2,r2,r1,LOG_CC_NV,0,1,0,2,0,t)
|
||||
# define nop(c) _nop(_jit,c)
|
||||
static void _nop(jit_state_t*,jit_int32_t);
|
||||
#define movr(r0,r1) _movr(_jit,r0,r1)
|
||||
static void _movr(jit_state_t*,jit_int32_t,jit_int32_t);
|
||||
#define movi(r0,i0) _movi(_jit,r0,i0)
|
||||
|
@ -1585,6 +1587,14 @@ _f38(jit_state_t *_jit, jit_int32_t o,
|
|||
ii((o<<26)|((s>>5)<<9)|(u<<6)|(n<<1)|(s&0x1f));
|
||||
}
|
||||
|
||||
static void
|
||||
_nop(jit_state_t *_jit, jit_int32_t i0)
|
||||
{
|
||||
for (; i0 > 0; i0 -= 4)
|
||||
NOP();
|
||||
assert(i0 == 0);
|
||||
}
|
||||
|
||||
static void
|
||||
_movr(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue