[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 162/437: Correct regressions with --with-float={soft, so
From: |
Andy Wingo |
Subject: |
[Guile-commits] 162/437: Correct regressions with --with-float={soft, softfp} in the arm backend |
Date: |
Mon, 2 Jul 2018 05:14:09 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit adc854f1a7fa688f4cb3882a32f087cc89b116f6
Author: pcpa <address@hidden>
Date: Sat Dec 22 16:28:02 2012 -0200
Correct regressions with --with-float={soft,softfp} in the arm backend
* lib/jit_arm.c: Correct use of wrong argument offset
variable in armv7l or float/double argument for varargs
function in armv7hl.
Correct jit_getarg* logic in software float mode to
match expected behavior in other backends, that is, if
a function is not called, it is safe to use a few lightning
calls before a next jit_getarg* call, as done in the test
case check/stack.tst. The proper solution should be to
extend the parser in lib/lightning.c to check if there is
some float operation that will call some (libgcc?) function,
but software float arm should be a very uncommon backend for
lightning, so, just load the already in place arguments
saved to stack, assuming the register argument was clobbered
(what should not be the case most times...).
---
ChangeLog | 17 +++++++++++++++++
lib/jit_arm.c | 49 ++++++++++++++++++++++++++++++++++++++++++-------
2 files changed, 59 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 8e23479..299bc0f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,22 @@
2012-12-22 Paulo Andrade <address@hidden>
+ * lib/jit_arm.c: Correct use of wrong argument offset
+ variable in armv7l or float/double argument for varargs
+ function in armv7hl.
+ Correct jit_getarg* logic in software float mode to
+ match expected behavior in other backends, that is, if
+ a function is not called, it is safe to use a few lightning
+ calls before a next jit_getarg* call, as done in the test
+ case check/stack.tst. The proper solution should be to
+ extend the parser in lib/lightning.c to check if there is
+ some float operation that will call some (libgcc?) function,
+ but software float arm should be a very uncommon backend for
+ lightning, so, just load the already in place arguments
+ saved to stack, assuming the register argument was clobbered
+ (what should not be the case most times...).
+
+2012-12-22 Paulo Andrade <address@hidden>
+
* check/clobber.ok, check/clobber.tst: New test case doing
extensive validation tests to ensure registers not used in
a operation are not clobbered.
diff --git a/lib/jit_arm.c b/lib/jit_arm.c
index fab42aa..0a11070 100644
--- a/lib/jit_arm.c
+++ b/lib/jit_arm.c
@@ -388,8 +388,8 @@ _jit_arg_d(jit_state_t *_jit)
if (_jit->function->self.argi < 3) {
if (_jit->function->self.argi & 1)
++_jit->function->self.argi;
- offset = _jit->function->self.argf;
- _jit->function->self.argf += 2;
+ offset = _jit->function->self.argi;
+ _jit->function->self.argi += 2;
return (offset);
}
}
@@ -409,7 +409,12 @@ _jit_arg_d_reg_p(jit_state_t *_jit, jit_int32_t offset)
void
_jit_getarg_c(jit_state_t *_jit, jit_int32_t u, jit_int32_t v)
{
- if (v < 4)
+ if (jit_swf_p()) {
+ if (v < 4)
+ v <<= 2;
+ jit_ldxi_c(u, JIT_FP, v);
+ }
+ else if (v < 4)
jit_extr_c(u, JIT_RA0 - v);
else
jit_ldxi_c(u, JIT_FP, v);
@@ -418,7 +423,12 @@ _jit_getarg_c(jit_state_t *_jit, jit_int32_t u,
jit_int32_t v)
void
_jit_getarg_uc(jit_state_t *_jit, jit_int32_t u, jit_int32_t v)
{
- if (v < 4)
+ if (jit_swf_p()) {
+ if (v < 4)
+ v <<= 2;
+ jit_ldxi_uc(u, JIT_FP, v);
+ }
+ else if (v < 4)
jit_extr_uc(u, JIT_RA0 - v);
else
jit_ldxi_uc(u, JIT_FP, v);
@@ -427,7 +437,12 @@ _jit_getarg_uc(jit_state_t *_jit, jit_int32_t u,
jit_int32_t v)
void
_jit_getarg_s(jit_state_t *_jit, jit_int32_t u, jit_int32_t v)
{
- if (v < 4)
+ if (jit_swf_p()) {
+ if (v < 4)
+ v <<= 2;
+ jit_ldxi_s(u, JIT_FP, v);
+ }
+ else if (v < 4)
jit_extr_s(u, JIT_RA0 - v);
else
jit_ldxi_s(u, JIT_FP, v);
@@ -436,7 +451,12 @@ _jit_getarg_s(jit_state_t *_jit, jit_int32_t u,
jit_int32_t v)
void
_jit_getarg_us(jit_state_t *_jit, jit_int32_t u, jit_int32_t v)
{
- if (v < 4)
+ if (jit_swf_p()) {
+ if (v < 4)
+ v <<= 2;
+ jit_ldxi_us(u, JIT_FP, v);
+ }
+ else if (v < 4)
jit_extr_us(u, JIT_RA0 - v);
else
jit_ldxi_us(u, JIT_FP, v);
@@ -445,7 +465,12 @@ _jit_getarg_us(jit_state_t *_jit, jit_int32_t u,
jit_int32_t v)
void
_jit_getarg_i(jit_state_t *_jit, jit_int32_t u, jit_int32_t v)
{
- if (v < 4)
+ if (jit_swf_p()) {
+ if (v < 4)
+ v <<= 2;
+ jit_ldxi_i(u, JIT_FP, v);
+ }
+ else if (v < 4)
jit_movr(u, JIT_RA0 - v);
else
jit_ldxi_i(u, JIT_FP, v);
@@ -460,6 +485,11 @@ _jit_getarg_f(jit_state_t *_jit, jit_int32_t u,
jit_int32_t v)
else
jit_ldxi_f(u, JIT_FP, v);
}
+ else if (jit_swf_p()) {
+ if (v < 4)
+ v <<= 2;
+ jit_ldxi_f(u, JIT_FP, v);
+ }
else {
if (v < 4)
jit_movr_f(u, JIT_RA0 - v);
@@ -477,6 +507,11 @@ _jit_getarg_d(jit_state_t *_jit, jit_int32_t u,
jit_int32_t v)
else
jit_ldxi_d(u, JIT_FP, v);
}
+ else if (jit_swf_p()) {
+ if (v < 4)
+ v <<= 2;
+ jit_ldxi_d(u, JIT_FP, v);
+ }
else {
if (v < 4)
jit_movr_d(u, JIT_RA0 - v);
- [Guile-commits] 406/437: Adapt for binutils 2.29, (continued)
- [Guile-commits] 406/437: Adapt for binutils 2.29, Andy Wingo, 2018/07/02
- [Guile-commits] 395/437: Use an actual, invalid code, as last jit code., Andy Wingo, 2018/07/02
- [Guile-commits] 344/437: ARM: Better check for constants offset overflow, Andy Wingo, 2018/07/02
- [Guile-commits] 351/437: PPC: Only call binutils function if it is available, Andy Wingo, 2018/07/02
- [Guile-commits] 278/437: x86_64: Change x86_64 to also save/restore %rbx in inline asm., Andy Wingo, 2018/07/02
- [Guile-commits] 427/437: Remove some more of the lightning build machinery, Andy Wingo, 2018/07/02
- [Guile-commits] 328/437: Update THANKS file, Andy Wingo, 2018/07/02
- [Guile-commits] 129/437: Remove previous macro files as they are no longer used., Andy Wingo, 2018/07/02
- [Guile-commits] 09/437: add autotools-generated files, Andy Wingo, 2018/07/02
- [Guile-commits] 69/437: implement long mul/div/mod for x86-64, Andy Wingo, 2018/07/02
- [Guile-commits] 162/437: Correct regressions with --with-float={soft, softfp} in the arm backend,
Andy Wingo <=
- [Guile-commits] 377/437: aarch64: Add initial jit_va_ calls to aarch64, Andy Wingo, 2018/07/02
- [Guile-commits] 298/437: ARM: Correct wrong table of instruction sizes in software float, Andy Wingo, 2018/07/02
- [Guile-commits] 99/437: always set and replace lightning_frag, Andy Wingo, 2018/07/02
- [Guile-commits] 336/437: Correct bogus git entry, Andy Wingo, 2018/07/02
- [Guile-commits] 282/437: Document the lightning customization functions., Andy Wingo, 2018/07/02
- [Guile-commits] 290/437: Do not pass null for free, memcpy and memmove, Andy Wingo, 2018/07/02
- [Guile-commits] 249/437: Make jit_get_note a public interface., Andy Wingo, 2018/07/02
- [Guile-commits] 299/437: ALPHA: Correct class of argument float registers, Andy Wingo, 2018/07/02
- [Guile-commits] 426/437: Remove empty lightning m4 directory, Andy Wingo, 2018/07/02
- [Guile-commits] 379/437: s390: Add initial jit_va_ calls to s390, Andy Wingo, 2018/07/02