[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 11/14: Convert BLI to BLXI for jumps to ARM code
From: |
Andy Wingo |
Subject: |
[Guile-commits] 11/14: Convert BLI to BLXI for jumps to ARM code |
Date: |
Fri, 12 Jun 2020 10:18:45 -0400 (EDT) |
wingo pushed a commit to branch master
in repository guile.
commit 0ff3b3163c3bf7bc9b498403428999deb771d2cd
Author: Icecream95 <ixn@keemail.me>
AuthorDate: Thu Apr 9 21:32:55 2020 +1200
Convert BLI to BLXI for jumps to ARM code
With this, Guile builds and runs in both ARM and Thumb mode.
Closes: #12
---
lightening/arm-cpu.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/lightening/arm-cpu.c b/lightening/arm-cpu.c
index 1bb7394..0e38883 100644
--- a/lightening/arm-cpu.c
+++ b/lightening/arm-cpu.c
@@ -316,7 +316,13 @@ encode_thumb_jump(int32_t v)
static uint32_t
patch_thumb_jump(uint32_t inst, int32_t v)
{
- return (inst & thumb_jump_mask) | encode_thumb_jump(v);
+ inst &= thumb_jump_mask;
+ if (!(v & 1)) {
+ ASSERT(inst == THUMB2_BLI || inst == THUMB2_BLXI);
+ v = (v + 2) & ~2;
+ inst = THUMB2_BLXI;
+ }
+ return inst | encode_thumb_jump(v);
}
static int32_t
- [Guile-commits] 01/14: Switch CI to use Debian stable, (continued)
- [Guile-commits] 01/14: Switch CI to use Debian stable, Andy Wingo, 2020/06/12
- [Guile-commits] 02/14: Add flag bits to the jit_reloc_kind enum, Andy Wingo, 2020/06/12
- [Guile-commits] 05/14: Use an rsh of 0 for jumps on ARM, Andy Wingo, 2020/06/12
- [Guile-commits] 06/14: Return a function pointer from jit_address, Andy Wingo, 2020/06/12
- [Guile-commits] 08/14: Use bx instead of mov for jumps on ARM, Andy Wingo, 2020/06/12
- [Guile-commits] 09/14: Remove T2_BLXI, Andy Wingo, 2020/06/12
- [Guile-commits] 03/14: Add separate functions for veneer patching, Andy Wingo, 2020/06/12
- [Guile-commits] 04/14: Add a test for local forward and backward jumps, Andy Wingo, 2020/06/12
- [Guile-commits] 07/14: Stop setting the thumb bit except on jumps to veneers, Andy Wingo, 2020/06/12
- [Guile-commits] 12/14: Add CI jobs for ARM in both instruction sets, Andy Wingo, 2020/06/12
- [Guile-commits] 11/14: Convert BLI to BLXI for jumps to ARM code,
Andy Wingo <=
- [Guile-commits] 14/14: Update lightening, Andy Wingo, 2020/06/12
- [Guile-commits] 10/14: Always emit veneers for non-bl jumps to ARM code, Andy Wingo, 2020/06/12
- [Guile-commits] 13/14: Merge branch 'arm-fix' into 'master', Andy Wingo, 2020/06/12