wingo pushed a commit to branch lightning
in repository guile.
commit 479c2eda3c70d0573541b71e6180adecdaec9f60
Author: pcpa <[email protected]>
Date: Mon Dec 2 17:58:00 2013 -0200
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.
---
ChangeLog | 5 +++++
lib/jit_x86-x87.c | 5 -----
lib/jit_x86.c | 24 +++++++++++-------------
3 files changed, 16 insertions(+), 18 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 82a0c09..462b7f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-12-02 Paulo Andrade <[email protected]>
+
+ * 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 <[email protected]>
* configure.ac, lib/jit_arm-swf.c, lib/jit_arm.c: Add
diff --git a/lib/jit_x86-x87.c b/lib/jit_x86-x87.c
index 63043c8..ef63392 100644
--- a/lib/jit_x86-x87.c
+++ b/lib/jit_x86-x87.c
@@ -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
diff --git a/lib/jit_x86.c b/lib/jit_x86.c
index 28b6166..69df289 100644
--- a/lib/jit_x86.c
+++ b/lib/jit_x86.c
@@ -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);
}