[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 187/437: Correct regression with float arguments in arm
From: |
Andy Wingo |
Subject: |
[Guile-commits] 187/437: Correct regression with float arguments in arm hardp |
Date: |
Mon, 2 Jul 2018 05:14:14 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit 12c35b7e83899b852c34971bfe2de027937f1d73
Author: pcpa <address@hidden>
Date: Mon Feb 11 17:39:06 2013 -0200
Correct regression with float arguments in arm hardp
* lib/jit_arm.c: Correct jit_pushargi_f in the arm hardfp abi.
Most of the logic uses even numbered register numbers, so that
a float and a double can be used in the same register, but
the abi requires packing the float arguments, so jit_pushargi_f
needs to allocate a temporary register to modify only the
proper register argument (or be very smart to push two
immediate arguments if applicable).
---
ChangeLog | 10 ++++++++++
lib/jit_arm.c | 24 +++++++++++++++---------
2 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 5d8ac84..e0d1532 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2013-02-11 Paulo Andrade <address@hidden>
+ * lib/jit_arm.c: Correct jit_pushargi_f in the arm hardfp abi.
+ Most of the logic uses even numbered register numbers, so that
+ a float and a double can be used in the same register, but
+ the abi requires packing the float arguments, so jit_pushargi_f
+ needs to allocate a temporary register to modify only the
+ proper register argument (or be very smart to push two
+ immediate arguments if applicable).
+
+2013-02-11 Paulo Andrade <address@hidden>
+
* include/lightning.h, lib/lightning.c: Implement the new
jit_clear_state and jit_destroy_state calls. jit_clear_state
releases all memory not required during jit_execution; that
diff --git a/lib/jit_arm.c b/lib/jit_arm.c
index 4c760f8..2302286 100644
--- a/lib/jit_arm.c
+++ b/lib/jit_arm.c
@@ -386,21 +386,20 @@ _jit_arg_f(jit_state_t *_jit)
assert(_jit->function);
if (jit_cpu.abi && !(_jit->function->self.call & jit_call_varargs)) {
- if (_jit->function->self.argf < 16)
+ if (_jit->function->self.argf < 16) {
offset = _jit->function->self.argf++;
- else {
- offset = _jit->function->self.size;
- _jit->function->self.size += sizeof(jit_word_t);
+ goto done;
}
}
else {
- if (_jit->function->self.argi < 4)
+ if (_jit->function->self.argi < 4) {
offset = _jit->function->self.argi++;
- else {
- offset = _jit->function->self.size;
- _jit->function->self.size += sizeof(jit_float32_t);
+ goto done;
}
}
+ offset = _jit->function->self.size;
+ _jit->function->self.size += sizeof(jit_float32_t);
+done:
return (jit_new_node_w(jit_code_arg_f, offset));
}
@@ -604,7 +603,14 @@ _jit_pushargi_f(jit_state_t *_jit, jit_float32_t u)
assert(_jit->function);
if (jit_cpu.abi && !(_jit->function->call.call & jit_call_varargs)) {
if (_jit->function->call.argf < 16) {
- jit_movi_f(JIT_FA0 - _jit->function->call.argf, u);
+ /* cannot jit_movi_f in the argument register because
+ * float arguments are packed, and that would cause
+ * either an assertion in debug mode, or overwritting
+ * two registers */
+ regno = jit_get_reg(jit_class_fpr);
+ jit_movi_f(regno, u);
+ jit_movr_f(JIT_FA0 - _jit->function->call.argf, regno);
+ jit_unget_reg(regno);
++_jit->function->call.argf;
return;
}
- [Guile-commits] 202/437: Ensure the end argument of __clear_cache is page aligned., (continued)
- [Guile-commits] 202/437: Ensure the end argument of __clear_cache is page aligned., Andy Wingo, 2018/07/02
- [Guile-commits] 197/437: Adapt PowerPC port to work in Darwin 32 bit and Linux 64 bit., Andy Wingo, 2018/07/02
- [Guile-commits] 184/437: Implement the "live" code to explicitly tell a register is live., Andy Wingo, 2018/07/02
- [Guile-commits] 149/437: Make all current test cases pass in Darwin PowerPC., Andy Wingo, 2018/07/02
- [Guile-commits] 113/437: Change JIT_REXTMP, JIT_R, JIT_V to use 64-bit registers, Andy Wingo, 2018/07/02
- [Guile-commits] 173/437: Add filename and line number annotation abstraction., Andy Wingo, 2018/07/02
- [Guile-commits] 201/437: Do not start over jit generation if can safely grow buffer size., Andy Wingo, 2018/07/02
- [Guile-commits] 152/437: Remove most type casts and compile test tool silently with -Wall, Andy Wingo, 2018/07/02
- [Guile-commits] 208/437: Implement fpr register arguments and minor extra fixes., Andy Wingo, 2018/07/02
- [Guile-commits] 211/437: Correct the cvt.tst test case on Itanium., Andy Wingo, 2018/07/02
- [Guile-commits] 187/437: Correct regression with float arguments in arm hardp,
Andy Wingo <=
- [Guile-commits] 200/437: Add a simple memory management wrapper., Andy Wingo, 2018/07/02
- [Guile-commits] 196/437: Add missing __ppc__ definition., Andy Wingo, 2018/07/02
- [Guile-commits] 159/437: Correct stack.tst test case on ppc. Now all tests pass in all backends., Andy Wingo, 2018/07/02
- [Guile-commits] 172/437: Rework {get, push}arg{, i, r}_{f, d} to a more descriptive name and usage., Andy Wingo, 2018/07/02
- [Guile-commits] 221/437: Correct build and pass all tests on Solaris Sparc., Andy Wingo, 2018/07/02
- [Guile-commits] 228/437: Properly check tests output., Andy Wingo, 2018/07/02
- [Guile-commits] 186/437: Add code to release all memory used by the jit state., Andy Wingo, 2018/07/02
- [Guile-commits] 137/437: Make mips backend compile on a qemu image., Andy Wingo, 2018/07/02
- [Guile-commits] 222/437: Correct build and pass all tests on Solaris x86., Andy Wingo, 2018/07/02
- [Guile-commits] 219/437: Remove redundancy in the hppa cache synchronization code., Andy Wingo, 2018/07/02