[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 384/437: ia64: Do not use a dangling pointer for double
From: |
Andy Wingo |
Subject: |
[Guile-commits] 384/437: ia64: Do not use a dangling pointer for double to integer copy |
Date: |
Mon, 2 Jul 2018 05:15:00 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit a3063df782c1958e2fdfd9d88a12d16b45ce1873
Author: Paulo Andrade <address@hidden>
Date: Sun May 10 18:33:05 2015 -0300
ia64: Do not use a dangling pointer for double to integer copy
* lib/jit_ia64-fpu.c, lib/jit_ia64.c: Correct movi_d_w
and movi_f_w implementation to work when not using a
data buffer. This causes the check varargs.tst to
work when passing "-d" to the lightning test tool.
---
ChangeLog | 7 +++++++
lib/jit_ia64-fpu.c | 35 ++++++++++++++++++++++++++---------
lib/jit_ia64.c | 4 ++--
3 files changed, 35 insertions(+), 11 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 2e1d363..90244b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2015-06-10 Paulo Andrade <address@hidden>
+ * lib/jit_ia64-fpu.c, lib/jit_ia64.c: Correct movi_d_w
+ and movi_f_w implementation to work when not using a
+ data buffer. This causes the check varargs.tst to
+ work when passing "-d" to the lightning test tool.
+
+2015-06-10 Paulo Andrade <address@hidden>
+
* lib/jit_ia64.c: Implement inline assembly cache flush,
required on multiprocessor systems.
diff --git a/lib/jit_ia64-fpu.c b/lib/jit_ia64-fpu.c
index 8637c01..20970fb 100644
--- a/lib/jit_ia64-fpu.c
+++ b/lib/jit_ia64-fpu.c
@@ -440,9 +440,9 @@ static void _movr_f_w(jit_state_t*,jit_int32_t,jit_int32_t);
#define movr_d_w(r0,r1) _movr_d_w(_jit,r0,r1)
static void _movr_d_w(jit_state_t*,jit_int32_t,jit_int32_t);
#define movi_f_w(r0,i0) _movi_f_w(_jit,r0,i0)
-static void _movi_f_w(jit_state_t*,jit_int32_t,jit_word_t);
+static void _movi_f_w(jit_state_t*,jit_int32_t,jit_float32_t*);
#define movi_d_w(r0,i0) _movi_d_w(_jit,r0,i0)
-static void _movi_d_w(jit_state_t*,jit_int32_t,jit_word_t);
+static void _movi_d_w(jit_state_t*,jit_int32_t,jit_float64_t*);
#define absr_f(r0,r1) absr_d(r0,r1)
#define absr_d(r0,r1) FABS(r0,r1)
#define negr_f(r0,r1) negr_d(r0,r1)
@@ -1057,30 +1057,47 @@ _movr_f_w(jit_state_t *_jit, jit_int32_t r0,
jit_int32_t r1)
}
static void
-_movi_f_w(jit_state_t *_jit, jit_int32_t r0, jit_word_t i0)
+_movi_f_w(jit_state_t *_jit, jit_int32_t r0, jit_float32_t *i0)
{
- /* Should actually be used only in this case (with out0 == 120) */
+ jit_data_t data;
+
+ /* Should be used only in this case (with out0 == 120) */
if (r0 >= 120)
r0 = _jitc->rout + (r0 - 120);
- ldi_i(r0, i0);
+ if (_jitc->no_data) {
+ data.f = *i0;
+ movi(r0, data.q.l);
+ }
+ else
+ ldi_i(r0, (jit_word_t)i0);
}
static void
_movr_d_w(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
- /* Should actually be used only in this case (with out0 == 120) */
+ /* Should be used only in this case (with out0 == 120) */
if (r0 >= 120)
r0 = _jitc->rout + (r0 - 120);
GETF_D(r0, r1);
}
static void
-_movi_d_w(jit_state_t *_jit, jit_int32_t r0, jit_word_t i0)
+_movi_d_w(jit_state_t *_jit, jit_int32_t r0, jit_float64_t *i0)
{
- /* Should actually be used only in this case (with out0 == 120) */
+ union {
+ jit_word_t w;
+ jit_float64_t d;
+ } data;
+
+ /* Should be used only in this case (with out0 == 120) */
if (r0 >= 120)
r0 = _jitc->rout + (r0 - 120);
- ldi_l(r0, i0);
+ if (_jitc->no_data) {
+ data.d = *i0;
+ movi(r0, data.w);
+ }
+ else
+ ldi_l(r0, (jit_word_t)i0);
}
#define fpr_opi(name, type, size) \
diff --git a/lib/jit_ia64.c b/lib/jit_ia64.c
index 172050b..a9287c4 100644
--- a/lib/jit_ia64.c
+++ b/lib/jit_ia64.c
@@ -1420,10 +1420,10 @@ _emit_code(jit_state_t *_jit)
movr_d_w(rn(node->u.w), rn(node->v.w));
break;
case jit_code_movi_f_w:
- movi_f_w(rn(node->u.w), node->v.n->u.w);
+ movi_f_w(rn(node->u.w), node->v.n->u.p);
break;
case jit_code_movi_d_w:
- movi_d_w(rn(node->u.w), node->v.n->u.w);
+ movi_d_w(rn(node->u.w), node->v.n->u.p);
break;
default:
abort();
- [Guile-commits] 301/437: GNU lightning 2.0.5 release, (continued)
- [Guile-commits] 301/437: GNU lightning 2.0.5 release, Andy Wingo, 2018/07/02
- [Guile-commits] 206/437: Correct jit implementation to pass several test cases., Andy Wingo, 2018/07/02
- [Guile-commits] 297/437: Do not filter -sz.c files in gitignore, Andy Wingo, 2018/07/02
- [Guile-commits] 255/437: IA64: Force sync of instructions in get-jit-size build mode., Andy Wingo, 2018/07/02
- [Guile-commits] 306/437: x86: Build and pass all tests under cygwin64 (Windows x64), Andy Wingo, 2018/07/02
- [Guile-commits] 352/437: Update documentation, Andy Wingo, 2018/07/02
- [Guile-commits] 357/437: Make more readable always true test, Andy Wingo, 2018/07/02
- [Guile-commits] 311/437: Implement jit_frame and jit_tramp interfaces, Andy Wingo, 2018/07/02
- [Guile-commits] 312/437: Use jit_code_last_code as symbolic name of last enum, Andy Wingo, 2018/07/02
- [Guile-commits] 293/437: Do not have assertions with a long type test, Andy Wingo, 2018/07/02
- [Guile-commits] 384/437: ia64: Do not use a dangling pointer for double to integer copy,
Andy Wingo <=
- [Guile-commits] 203/437: Make it simpler to add support for more than 64 registers., Andy Wingo, 2018/07/02
- [Guile-commits] 415/437: Build and pass all test cases on Alpha Linux, Andy Wingo, 2018/07/02
- [Guile-commits] 142/437: Make current test cases pass in armv7l., Andy Wingo, 2018/07/02
- [Guile-commits] 188/437: Add framework for sparc port., Andy Wingo, 2018/07/02
- [Guile-commits] 227/437: Cosmetic removal of unused macros., Andy Wingo, 2018/07/02
- [Guile-commits] 330/437: Resync with new patch to make functions receive a const argument, Andy Wingo, 2018/07/02
- [Guile-commits] 185/437: Store all annotation information in the read only data buffer., Andy Wingo, 2018/07/02
- [Guile-commits] 170/437: Test and correct test cases in all current backends., Andy Wingo, 2018/07/02
- [Guile-commits] 368/437: Implement jit_allocar for dynamic stack allocation, Andy Wingo, 2018/07/02
- [Guile-commits] 355/437: Update documentation on jit_frame and jit_tramp, Andy Wingo, 2018/07/02