mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-03 13:20:26 +02:00
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.
This commit is contained in:
parent
f48e07b58b
commit
a3063df782
3 changed files with 35 additions and 11 deletions
|
@ -1,3 +1,10 @@
|
|||
2015-06-10 Paulo Andrade <pcpa@gnu.org>
|
||||
|
||||
* 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 <pcpa@gnu.org>
|
||||
|
||||
* lib/jit_ia64.c: Implement inline assembly cache flush,
|
||||
|
|
|
@ -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) \
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue