[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 12/34: Remove jit_nop
From: |
Andy Wingo |
Subject: |
[Guile-commits] 12/34: Remove jit_nop |
Date: |
Mon, 20 May 2019 09:55:52 -0400 (EDT) |
wingo pushed a commit to branch master
in repository guile.
commit 9d4185af2be47f1ef8069f0ad2683e98957fb11e
Author: Andy Wingo <address@hidden>
Date: Thu May 16 11:40:24 2019 +0200
Remove jit_nop
Instead, jit_align will call nop() internally. You can't nop 3 bytes on
most architectures.
---
lightening.h | 2 --
lightening/lightening.c | 20 ++++++++++----------
tests/nop.c | 26 --------------------------
3 files changed, 10 insertions(+), 38 deletions(-)
diff --git a/lightening.h b/lightening.h
index 6fe49ce..23635a0 100644
--- a/lightening.h
+++ b/lightening.h
@@ -574,8 +574,6 @@ jit_load_args_3(jit_state_t *_jit, jit_operand_t a,
jit_operand_t b,
M(RGG__, bxsubr_u) \
M(RGu__, bxsubi_u) \
\
- M(_i___, nop) \
- \
M(_G___, jmpr) \
M(_p___, jmpi) \
M(R____, jmp) \
diff --git a/lightening/lightening.c b/lightening/lightening.c
index e073103..2838891 100644
--- a/lightening/lightening.c
+++ b/lightening/lightening.c
@@ -248,16 +248,6 @@ is_power_of_two (unsigned x)
return x && !(x & (x-1));
}
-void
-jit_align(jit_state_t *_jit, unsigned align)
-{
- ASSERT (is_power_of_two (align));
- uintptr_t here = _jit->pc.w;
- uintptr_t there = (here + align - 1) & ~(align - 1);
- if (there - here)
- jit_nop(_jit, there - here);
-}
-
static jit_gpr_t
get_temp_gpr(jit_state_t *_jit)
{
@@ -547,6 +537,16 @@ jit_patch_there(jit_state_t* _jit, jit_reloc_t reloc,
jit_pointer_t addr)
FOR_EACH_INSTRUCTION(IMPL_INSTRUCTION)
#undef IMPL_INSTRUCTION
+void
+jit_align(jit_state_t *_jit, unsigned align)
+{
+ ASSERT (is_power_of_two (align));
+ uintptr_t here = _jit->pc.w;
+ uintptr_t there = (here + align - 1) & ~(align - 1);
+ if (there - here)
+ nop(_jit, there - here);
+}
+
static jit_bool_t
is_fpr_arg(enum jit_operand_abi arg)
{
diff --git a/tests/nop.c b/tests/nop.c
deleted file mode 100644
index c029954..0000000
--- a/tests/nop.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "test.h"
-
-static void
-run_test(jit_state_t *j, uint8_t *arena_base, size_t arena_size)
-{
- jit_begin(j, arena_base, arena_size);
- size_t align = jit_enter_jit_abi(j, 0, 0, 0);
-
- size_t total = 0;
- char *start = jit_address(j);
- for (size_t i = 1; i < 10; total += i, i++)
- jit_nop(j, i);
- char *end = jit_address(j);
- ASSERT(end - start == total);
- jit_leave_jit_abi(j, 0, 0, align);
- jit_reti(j, 42);
-
- jit_word_t (*f)(void) = jit_end(j, NULL);
- ASSERT(f() == 42);
-}
-
-int
-main (int argc, char *argv[])
-{
- return main_helper(argc, argv, run_test);
-}
- [Guile-commits] 10/34: Fix a couple bugs related to aarch64 literal pools, (continued)
- [Guile-commits] 10/34: Fix a couple bugs related to aarch64 literal pools, Andy Wingo, 2019/05/20
- [Guile-commits] 06/34: Allow a backend to have multiple temporary registers, Andy Wingo, 2019/05/20
- [Guile-commits] 09/34: Fix enter/leave JIT ABI, Andy Wingo, 2019/05/20
- [Guile-commits] 14/34: Fix dpkg --add-architecture invocation, Andy Wingo, 2019/05/20
- [Guile-commits] 16/34: Attempt to fix CI on Debian, Andy Wingo, 2019/05/20
- [Guile-commits] 19/34: Attempt to fix CI on Debian, Andy Wingo, 2019/05/20
- [Guile-commits] 24/34: Remove unused jit_{gpr,fpr}_is_callee_save, Andy Wingo, 2019/05/20
- [Guile-commits] 11/34: Aarch64 backend avoids needless temporary register allocation, Andy Wingo, 2019/05/20
- [Guile-commits] 04/34: Refactor to add support for constant tables, shifted relocs, Andy Wingo, 2019/05/20
- [Guile-commits] 34/34: Merge remote-tracking branch 'lightening/master', Andy Wingo, 2019/05/20
- [Guile-commits] 12/34: Remove jit_nop,
Andy Wingo <=
- [Guile-commits] 15/34: Fix YAML for CI, Andy Wingo, 2019/05/20
- [Guile-commits] 18/34: Attempt to fix CI on Debian, Andy Wingo, 2019/05/20
- [Guile-commits] 17/34: Attempt to fix CI on Debian, Andy Wingo, 2019/05/20
- [Guile-commits] 13/34: Add support for aarch64 in CI, Andy Wingo, 2019/05/20
- [Guile-commits] 20/34: Attempt to fix CI on Debian, Andy Wingo, 2019/05/20
- [Guile-commits] 21/34: Attempt to fix CI on Debian for AArch64, Andy Wingo, 2019/05/20
- [Guile-commits] 08/34: Fix compilation on aarch64, Andy Wingo, 2019/05/20
- [Guile-commits] 30/34: Add ARMv7 testing to CI, Andy Wingo, 2019/05/20
- [Guile-commits] 31/34: Attempt to get CI working on ARMv7, Andy Wingo, 2019/05/20
- [Guile-commits] 33/34: Update README, Andy Wingo, 2019/05/20