Correct regressions with --with-float={soft,softfp} in the arm backend - lightning.git - Portable just-in-time compiler library

index : lightning.git
Portable just-in-time compiler library
summary refs log tree commit diff
diff options
context:
space:
mode:
authorpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2012年12月22日 16:28:02 -0200
committerpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2012年12月22日 16:28:02 -0200
commitadc854f1a7fa688f4cb3882a32f087cc89b116f6 (patch)
tree21ac7ddd9b99355bb14ba42e3f4693411e318fd0
parent59255a493c517c18de633d8aa860c75d4936bb70 (diff)
downloadlightning-adc854f1a7fa688f4cb3882a32f087cc89b116f6.tar.gz
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...).
Diffstat
-rw-r--r--ChangeLog 17
-rw-r--r--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 <pcpa@gnu.org>
+ * 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 <pcpa@gnu.org>
+
* 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);
generated by cgit v1.2.3 (git 2.46.0) at 2025年09月29日 18:58:42 +0000

AltStyle によって変換されたページ (->オリジナル) /