1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-04 11:10:27 +02:00

x86: Use aligned offset for x87 to/from sse move.

* lib/jit_x86-x87.c, lib/jit_x86.c: Use 8 bytes aligned
	stack offset for float/double x87 to/from sse move.
This commit is contained in:
pcpa 2013-12-02 17:58:00 -02:00
parent 6fa5123855
commit 479c2eda3c
3 changed files with 16 additions and 18 deletions

View file

@ -1,3 +1,8 @@
2013-12-02 Paulo Andrade <pcpa@gnu.org>
* lib/jit_x86-x87.c, lib/jit_x86.c: Use 8 bytes aligned
stack offset for float/double x87 to/from sse move.
2013-11-27 Paulo Andrade <pcpa@gnu.org>
* configure.ac, lib/jit_arm-swf.c, lib/jit_arm.c: Add

View file

@ -18,11 +18,6 @@
*/
#if PROTO
# if __WORDSIZE == 32
# define CVT_OFFSET -12
# else
# define CVT_OFFSET -8
# endif
# define _ST0_REGNO 0
# define _ST1_REGNO 1
# define _ST2_REGNO 2

View file

@ -26,9 +26,11 @@
#if __WORDSIZE == 32
# define stack_alignment 4
# define stack_framesize 20
# define CVT_OFFSET -12
#else
# define stack_alignment 8
# define stack_framesize 56
# define CVT_OFFSET -8
#endif
/*
@ -310,11 +312,7 @@ _jit_prolog(jit_state_t *_jit)
_jitc->function->self.argi = _jitc->function->self.argf =
_jitc->function->self.aoff = _jitc->function->self.alen = 0;
/* sse/x87 conversion */
#if __WORDSIZE == 32
_jitc->function->self.aoff = -12;
#else
_jitc->function->self.aoff = -8;
#endif
_jitc->function->self.aoff = CVT_OFFSET;
_jitc->function->self.call = jit_call_default;
jit_alloc((jit_pointer_t *)&_jitc->function->regoff,
_jitc->reglen * sizeof(jit_int32_t));
@ -1713,27 +1711,27 @@ _patch(jit_state_t *_jit, jit_word_t instr, jit_node_t *node)
static void
_sse_from_x87_f(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
x87_stxi_f(-8, _RBP_REGNO, r1);
sse_ldxi_f(r0, _RBP_REGNO, -8);
x87_stxi_f(CVT_OFFSET, _RBP_REGNO, r1);
sse_ldxi_f(r0, _RBP_REGNO, CVT_OFFSET);
}
static void
_sse_from_x87_d(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
x87_stxi_d(-8, _RBP_REGNO, r1);
sse_ldxi_d(r0, _RBP_REGNO, -8);
x87_stxi_d(CVT_OFFSET, _RBP_REGNO, r1);
sse_ldxi_d(r0, _RBP_REGNO, CVT_OFFSET);
}
static void
_x87_from_sse_f(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
sse_stxi_f(-8, _RBP_REGNO, r1);
x87_ldxi_f(r0, _RBP_REGNO, -8);
sse_stxi_f(CVT_OFFSET, _RBP_REGNO, r1);
x87_ldxi_f(r0, _RBP_REGNO, CVT_OFFSET);
}
static void
_x87_from_sse_d(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1)
{
sse_stxi_d(-8, _RBP_REGNO, r1);
x87_ldxi_d(r0, _RBP_REGNO, -8);
sse_stxi_d(CVT_OFFSET, _RBP_REGNO, r1);
x87_ldxi_d(r0, _RBP_REGNO, CVT_OFFSET);
}