[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 125/437: fix multiplication on x86_64
From: |
Andy Wingo |
Subject: |
[Guile-commits] 125/437: fix multiplication on x86_64 |
Date: |
Mon, 2 Jul 2018 05:13:59 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit 0469f165c2c02faf12f6d7b000f837a12ee8a34e
Author: Paolo Bonzini <address@hidden>
Date: Mon Feb 28 11:23:33 2011 +0100
fix multiplication on x86_64
2011-02-28 Paolo Bonzini <address@hidden>
* lightning/i386/core-64.h: Add jit_add{c,x}{i,r}_l, jit_mulr_{l,ul}_,
fix jit_mul{i,r}_{l,ul}.
---
ChangeLog | 5 +++++
lightning/i386/core-64.h | 18 ++++++++++++++----
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3b79a3f..4653d9d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-02-28 Paolo Bonzini <address@hidden>
+
+ * lightning/i386/core-64.h: Add jit_add{c,x}{i,r}_l, jit_mulr_{l,ul}_,
+ fix jit_mul{i,r}_{l,ul}.
+
2010-08-20 Paolo Bonzini <address@hidden>
* lightning/i386/fp-64.h: Return patch address from jit_bXYr_{f,d}.
diff --git a/lightning/i386/core-64.h b/lightning/i386/core-64.h
index 41b6576..fadeff5 100644
--- a/lightning/i386/core-64.h
+++ b/lightning/i386/core-64.h
@@ -125,6 +125,10 @@ struct jit_local_state {
/* No. Do nothing. */ \
: 0)
#define jit_addr_l(d, s1, s2) jit_opo_((d), (s1), (s2), ADDQrr((s2), (d)),
ADDQrr((s1), (d)), LEAQmr(0, (s1), (s2), 1, (d)) )
+#define jit_addci_l(d, rs, is) jit_qop_ ((d), (rs), (is), ADCQir((is), (d)),
ADCQrr(JIT_REXTMP, (d)))
+#define jit_addcr_l(d, s1, s2) jit_qopr_((d), (s1), (s2), ADCQrr((s1), (d)),
ADCQrr((s2), (d)) )
+#define jit_addxi_l(d, rs, is) jit_qop_ ((d), (rs), (is), ADDQir((is), (d)),
ADDQrr(JIT_REXTMP, (d)))
+#define jit_addxr_l(d, s1, s2) jit_qopr_((d), (s1), (s2), ADDQrr((s1), (d)),
ADDQrr((s2), (d)) )
#define jit_andi_l(d, rs, is) jit_qop_ ((d), (rs), (is), ANDQir((is), (d)),
ANDQrr(JIT_REXTMP, (d)))
#define jit_andr_l(d, s1, s2) jit_qopr_((d), (s1), (s2), ANDQrr((s1), (d)),
ANDQrr((s2), (d)) )
#define jit_orr_l(d, s1, s2) jit_qopr_((d), (s1), (s2), ORQrr((s1), (d)),
ORQrr((s2), (d)) )
@@ -380,6 +384,12 @@ static int jit_arg_reg_order[] = { _EDI, _ESI, _EDX, _ECX,
_R8D, _R9D };
#define jit_gei_ul(d, rs, is) jit_bool_qi0((d), (rs), (is), SETAEr, INCLr )
/* Multiplication/division. */
+#define jit_mulr_ul_(s1, s2) \
+ jit_qopr_(_RAX, s1, s2, MULQr(s1), MULQr(s2))
+
+#define jit_mulr_l_(s1, s2) \
+ jit_qopr_(_RAX, s1, s2, IMULQr(s1), IMULQr(s2))
+
#define jit_muli_l_(is, rs) \
(MOVQir(is, rs == _RAX ? _RDX : _RAX), \
IMULQr(rs == _RAX ? _RDX : rs))
@@ -446,13 +456,13 @@ static int jit_arg_reg_order[] = { _EDI, _ESI, _EDX,
_ECX, _R8D, _R9D };
jit_might(d, _RCX, jit_popr_l(_RCX)), \
jit_might(d, _RAX, jit_popr_l(_RAX)))
-#define jit_muli_l(d, rs, is) jit_op_ ((d), (rs), IMULQir((is), (d))
)
-#define jit_mulr_l(d, s1, s2) jit_opr_((d), (s1), (s2), IMULQrr((s1), (d)),
IMULQrr((s2), (d)) )
+#define jit_muli_l(d, rs, is) jit_qop_ ((d), (rs), (is), IMULQir((is), (d)),
IMULQrr(JIT_REXTMP, (d)) )
+#define jit_mulr_l(d, s1, s2) jit_qopr_((d), (s1), (s2), IMULQrr((s1), (d)),
IMULQrr((s2), (d)) )
/* As far as low bits are concerned, signed and unsigned multiplies are
exactly the same. */
-#define jit_muli_ul(d, rs, is) jit_op_ ((d), (rs), IMULQir((is), (d))
)
-#define jit_mulr_ul(d, s1, s2) jit_opr_((d), (s1), (s2), IMULQrr((s1), (d)),
IMULQrr((s2), (d)) )
+#define jit_muli_ul(d, rs, is) jit_qop_ ((d), (rs), (is), IMULQir((is), (d)),
IMULQrr(JIT_REXTMP, (d)) )
+#define jit_mulr_ul(d, s1, s2) jit_qopr_((d), (s1), (s2), IMULQrr((s1), (d)),
IMULQrr((s2), (d)) )
#define jit_hmuli_l(d, rs, is)
\
((d) == _RDX ? ( jit_pushr_l(_RAX), jit_muli_l_((is),
(rs)), jit_popr_l(_RAX) ) : \
- [Guile-commits] 77/437: add .gitattributes file, (continued)
- [Guile-commits] 77/437: add .gitattributes file, Andy Wingo, 2018/07/02
- [Guile-commits] 44/437: merge some bugfixes, give right meaning to jit_retval_[fd], Andy Wingo, 2018/07/02
- [Guile-commits] 106/437: ldst test update, Andy Wingo, 2018/07/02
- [Guile-commits] 114/437: Change JIT_REXTMP to not clobber 6th argument., Andy Wingo, 2018/07/02
- [Guile-commits] 88/437: move JIT_R1/JIT_R2 to R10/R11 for the x86_64 backend, Andy Wingo, 2018/07/02
- [Guile-commits] 133/437: Correct integer multiplication and add extra test case., Andy Wingo, 2018/07/02
- [Guile-commits] 116/437: Change jit_finish to work with varargs functions in x86_64., Andy Wingo, 2018/07/02
- [Guile-commits] 85/437: add (void) casts for C++ compatibility, Andy Wingo, 2018/07/02
- [Guile-commits] 127/437: Extra cleanup before update to new codebase., Andy Wingo, 2018/07/02
- [Guile-commits] 130/437: Add make rule to build test case dependencies., Andy Wingo, 2018/07/02
- [Guile-commits] 125/437: fix multiplication on x86_64,
Andy Wingo <=
- [Guile-commits] 102/437: add ldst test, Andy Wingo, 2018/07/02
- [Guile-commits] 131/437: Add proper make clean rule to the check subdir., Andy Wingo, 2018/07/02
- [Guile-commits] 109/437: more fixes to fp branches, Andy Wingo, 2018/07/02
- [Guile-commits] 136/437: Update code to build and pass test cases in the arm port., Andy Wingo, 2018/07/02
- [Guile-commits] 124/437: Also reset alloca_slack after jit_prolog in i386., Andy Wingo, 2018/07/02
- [Guile-commits] 154/437: Correct test cases to work with x87 in ix86., Andy Wingo, 2018/07/02
- [Guile-commits] 148/437: Add better ppc support code, but still not functional., Andy Wingo, 2018/07/02
- [Guile-commits] 153/437: Make it clear stdarg like abstraction is not supported., Andy Wingo, 2018/07/02
- [Guile-commits] 76/437: fix several load/store patterns for x86-64., Andy Wingo, 2018/07/02
- [Guile-commits] 81/437: fix stack alignment for Apple 32-bit ABI, Andy Wingo, 2018/07/02