[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 74/437: add long boolean operations for x86-64
From: |
Andy Wingo |
Subject: |
[Guile-commits] 74/437: add long boolean operations for x86-64 |
Date: |
Mon, 2 Jul 2018 05:13:48 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit f4bf06ad41ee02e14a2afffb9fbc94fb03b1a124
Author: Paolo Bonzini <address@hidden>
Date: Wed Mar 19 09:44:57 2008 +0100
add long boolean operations for x86-64
2008-03-19 Paolo Bonzini <address@hidden>
* lightning/i386/core-64.h: Add boolean operations.
---
ChangeLog | 4 ++++
lightning/i386/core-64.h | 38 +++++++++++++++++++++++++++++++++++++-
2 files changed, 41 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 99880fe..643ac6a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2008-03-19 Paolo Bonzini <address@hidden>
+ * lightning/i386/core-64.h: Add boolean operations.
+
+2008-03-19 Paolo Bonzini <address@hidden>
+
* lightning/i386/asm-64.h: Add LEAQmr.
2008-03-19 Paolo Bonzini <address@hidden>
diff --git a/lightning/i386/core-64.h b/lightning/i386/core-64.h
index 8aa5d4a..075bd0bc 100644
--- a/lightning/i386/core-64.h
+++ b/lightning/i386/core-64.h
@@ -91,7 +91,7 @@ struct jit_local_state {
( (is) == 0 ? (TESTQrr(rs, rs), op0, _jit.x.pc) : jit_bra_l(rs, is, op))
#define jit_reduceQ(op, is, rs)
\
- (_u8P(is) && jit_check8(rs) ? jit_reduce_(op##Bir(is, jit_reg8(rs))) :
\
+ (_u8P(is) ? jit_reduce_(op##Bir(is, jit_reg8(rs))) : \
jit_reduce_(op##Qir(is, rs)) )
#define jit_addi_l(d, rs, is) jit_opi_((d), (rs), ADDQir((is), (d)),
LEAQmr((is), (rs), 0, 0, (d)) )
@@ -277,6 +277,42 @@ static int jit_arg_reg_order[] = { _EDI, _ESI, _EDX, _ECX
};
#define jit_bgtr_ul(label, s1, s2) jit_bra_qr((s1), (s2), JAm(label) )
#define jit_bger_ul(label, s1, s2) jit_bra_qr((s1), (s2), JAEm(label) )
+/* Bool operations. */
+#define jit_bool_qr(d, s1, s2, op) \
+ (jit_replace8(d, CMPQrr(s2, s1), op))
+
+#define jit_bool_qi(d, rs, is, op) \
+ (jit_replace8(d, CMPQir(is, rs), op))
+
+/* When CMP with 0 can be replaced with TEST */
+#define jit_bool_qi0(d, rs, is, op, op0) \
+ ((is) != 0 \
+ ? (jit_replace8(d, CMPQir(is, rs), op)) \
+ : (jit_replace8(d, TESTQrr(rs, rs), op0)))
+
+#define jit_ltr_l(d, s1, s2) jit_bool_qr((d), (s1), (s2), SETLr )
+#define jit_ler_l(d, s1, s2) jit_bool_qr((d), (s1), (s2), SETLEr )
+#define jit_gtr_l(d, s1, s2) jit_bool_qr((d), (s1), (s2), SETGr )
+#define jit_ger_l(d, s1, s2) jit_bool_qr((d), (s1), (s2), SETGEr )
+#define jit_eqr_l(d, s1, s2) jit_bool_qr((d), (s1), (s2), SETEr )
+#define jit_ner_l(d, s1, s2) jit_bool_qr((d), (s1), (s2), SETNEr )
+#define jit_ltr_ul(d, s1, s2) jit_bool_qr((d), (s1), (s2), SETBr )
+#define jit_ler_ul(d, s1, s2) jit_bool_qr((d), (s1), (s2), SETBEr )
+#define jit_gtr_ul(d, s1, s2) jit_bool_qr((d), (s1), (s2), SETAr )
+#define jit_ger_ul(d, s1, s2) jit_bool_qr((d), (s1), (s2), SETAEr )
+
+#define jit_lti_l(d, rs, is) jit_bool_qi0((d), (rs), (is), SETLr, SETSr )
+#define jit_lei_l(d, rs, is) jit_bool_qi ((d), (rs), (is), SETLEr )
+#define jit_gti_l(d, rs, is) jit_bool_qi ((d), (rs), (is), SETGr )
+#define jit_gei_l(d, rs, is) jit_bool_qi0((d), (rs), (is), SETGEr, SETNSr )
+#define jit_eqi_l(d, rs, is) jit_bool_qi0((d), (rs), (is), SETEr, SETEr )
+#define jit_nei_l(d, rs, is) jit_bool_qi0((d), (rs), (is), SETNEr, SETNEr )
+#define jit_lti_ul(d, rs, is) jit_bool_qi ((d), (rs), (is), SETBr )
+#define jit_lei_ul(d, rs, is) jit_bool_qi0((d), (rs), (is), SETBEr, SETEr )
+#define jit_gti_ul(d, rs, is) jit_bool_qi0((d), (rs), (is), SETAr, SETNEr )
+#define jit_gei_ul(d, rs, is) jit_bool_qi0((d), (rs), (is), SETAEr, INCLr )
+
+/* Multiplication/division. */
#define jit_muli_l_(is, rs) \
(MOVQir(is, rs == _RAX ? _RDX : _RAX), \
IMULQr(rs == _RAX ? _RDX : rs))
- [Guile-commits] 75/437: fix uses of jit_qop_ with 4 parameters, (continued)
- [Guile-commits] 75/437: fix uses of jit_qop_ with 4 parameters, Andy Wingo, 2018/07/02
- [Guile-commits] 61/437: avoid redefinition of _r1, Andy Wingo, 2018/07/02
- [Guile-commits] 73/437: add LEAQmr for x86-64, Andy Wingo, 2018/07/02
- [Guile-commits] 82/437: use MOVLir directly to implement i386 32-bit jit_movi_p, Andy Wingo, 2018/07/02
- [Guile-commits] 72/437: misc. x86-64 bugfixes, Andy Wingo, 2018/07/02
- [Guile-commits] 78/437: avoid CRLF issues on mingw, Andy Wingo, 2018/07/02
- [Guile-commits] 62/437: commit source files for separate using/porting manuals, Andy Wingo, 2018/07/02
- [Guile-commits] 80/437: fix C++ incompatibility in i386 back-end, Andy Wingo, 2018/07/02
- [Guile-commits] 45/437: add floating-point for x86-64, Andy Wingo, 2018/07/02
- [Guile-commits] 28/437: first merge of x86-64 backend and related configury changes, Andy Wingo, 2018/07/02
- [Guile-commits] 74/437: add long boolean operations for x86-64,
Andy Wingo <=
- [Guile-commits] 89/437: fix _rN vs. _rR, Andy Wingo, 2018/07/02
- [Guile-commits] 90/437: fix IMULQir and IMULQirr, Andy Wingo, 2018/07/02
- [Guile-commits] 79/437: fix jit_replace8 for case when one of the operands is _EAX., Andy Wingo, 2018/07/02
- [Guile-commits] 87/437: rewrite x86-64 argument passing to support up to 6 arguments, Andy Wingo, 2018/07/02
- [Guile-commits] 92/437: fix installation bug, Andy Wingo, 2018/07/02
- [Guile-commits] 71/437: add missing x86-64 memory operations, Andy Wingo, 2018/07/02
- [Guile-commits] 84/437: move x86-64 JIT_V1/JIT_V2 in R12/R13, Andy Wingo, 2018/07/02
- [Guile-commits] 83/437: detect 32-/64-bit variant of i386 back-end at include time (not configure time), Andy Wingo, 2018/07/02
- [Guile-commits] 86/437: fix x86-64 jit_movi_l (x, 0) and 16-byte stack alignment in the prolog, Andy Wingo, 2018/07/02
- [Guile-commits] 91/437: fix miscellaneous PPC-32 back-end bugs, Andy Wingo, 2018/07/02