[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 7/8] htm: add powerpc64 intrinsics
From: |
Emilio G. Cota |
Subject: |
[Qemu-devel] [PATCH 7/8] htm: add powerpc64 intrinsics |
Date: |
Wed, 24 Aug 2016 18:18:02 -0400 |
Signed-off-by: Emilio G. Cota <address@hidden>
---
include/qemu/htm.h | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/include/qemu/htm.h b/include/qemu/htm.h
index dc84bc1..f367ee4 100644
--- a/include/qemu/htm.h
+++ b/include/qemu/htm.h
@@ -39,5 +39,44 @@ static inline void htm_abort(void)
{
_xabort(0);
}
+
+#elif defined(__powerpc64__)
+/* compile with -mhtm */
+#include <htmintrin.h>
+
+static inline int htm_begin(void)
+{
+ unsigned int status;
+
+ status = __builtin_tbegin(0);
+ if (likely(status)) {
+ return HTM_OK;
+ }
+ if (_TEXASRU_FAILURE_PERSISTENT(__builtin_get_texasru())) {
+ return HTM_ABORT_NORETRY;
+ }
+ return HTM_ABORT_RETRY;
+}
+
+static inline void htm_end(void)
+{
+ __builtin_tend(0);
+}
+
+static inline int htm_test(void)
+{
+ unsigned char state = _HTM_STATE(__builtin_ttest());
+
+ if (likely(state == _HTM_TRANSACTIONAL)) {
+ return 1;
+ }
+ return 0;
+}
+
+static inline void htm_abort(void)
+{
+ __builtin_tabort(0);
+}
+
#endif /* ISA */
#endif /* HTM_H */
--
2.5.0
- Re: [Qemu-devel] MTTCG status updates, benchmark results and KVM forum plans, (continued)
- Re: [Qemu-devel] MTTCG status updates, benchmark results and KVM forum plans, Emilio G. Cota, 2016/08/15
- [Qemu-devel] [PATCH] aarch64: use TSX for ldrex/strex, Emilio G. Cota, 2016/08/15
- Re: [Qemu-devel] [PATCH] aarch64: use TSX for ldrex/strex, Richard Henderson, 2016/08/17
- Re: [Qemu-devel] [PATCH] aarch64: use TSX for ldrex/strex, Emilio G. Cota, 2016/08/17
- Re: [Qemu-devel] [PATCH] aarch64: use TSX for ldrex/strex, Emilio G. Cota, 2016/08/17
- Re: [Qemu-devel] [PATCH] aarch64: use TSX for ldrex/strex, Richard Henderson, 2016/08/17
- Re: [Qemu-devel] [PATCH] aarch64: use TSX for ldrex/strex, Richard Henderson, 2016/08/18
- Re: [Qemu-devel] [PATCH] aarch64: use TSX for ldrex/strex, Emilio G. Cota, 2016/08/24
- [Qemu-devel] [PATCH 1/8] cpu list: convert to RCU QLIST, Emilio G. Cota, 2016/08/24
- [Qemu-devel] [PATCH 3/8] rcu: add rcu_read_lock_held(), Emilio G. Cota, 2016/08/24
- [Qemu-devel] [PATCH 7/8] htm: add powerpc64 intrinsics,
Emilio G. Cota <=
- [Qemu-devel] [PATCH 6/8] htm: add header to abstract Hardware Transactional Memory intrinsics, Emilio G. Cota, 2016/08/24
- [Qemu-devel] [PATCH 8/8] target-arm/a64: use HTM with stop-the-world fall-back path, Emilio G. Cota, 2016/08/24
- [Qemu-devel] [PATCH 2/8] cpu-exec: remove tb_lock from hot path, Emilio G. Cota, 2016/08/24
- [Qemu-devel] [PATCH 4/8] target-arm: helper fixup for paired atomics, Emilio G. Cota, 2016/08/24
- [Qemu-devel] [PATCH 5/8] linux-user: add stop-the-world to be called from CPU loop, Emilio G. Cota, 2016/08/24
Re: [Qemu-devel] MTTCG status updates, benchmark results and KVM forum plans, Alex Bennée, 2016/08/16