File 0004-vm-exec.c-improve-performance-in-ppc64-arch.patch of Package ruby2.1

From cbde7b1b17baede924b8bb51d354e2e814b85374 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcus=20R=C3=BCckert?= <mrueckert@suse.de>
Date: Tue, 7 Mar 2017 13:03:15 +0100
Subject: [PATCH 04/13] vm exec.c improve performance in ppc64 arch

---
 vm_exec.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/vm_exec.c b/vm_exec.c
index a8b14e30de..bcbd6e3461 100644
--- a/vm_exec.c
+++ b/vm_exec.c
@@ -24,6 +24,9 @@ static void vm_analysis_insn(int insn);
 #elif defined(__GNUC__) && defined(__i386__)
 #define DECL_SC_REG(type, r, reg) register type reg_##r __asm__("e" reg)
 
+#elif defined(__GNUC__) && defined(__powerpc64__)
+#define DECL_SC_REG(type, r, reg) register type reg_##r __asm__("r" reg)
+
 #else
 #define DECL_SC_REG(type, r, reg) register type reg_##r
 #endif
@@ -66,6 +69,11 @@ vm_exec_core(rb_thread_t *th, VALUE initial)
     DECL_SC_REG(rb_control_frame_t *, cfp, "15");
 #define USE_MACHINE_REGS 1
 
+#elif defined(__GNUC__) && defined(__powerpc64__)
+    DECL_SC_REG(VALUE *, pc, "14");
+    DECL_SC_REG(rb_control_frame_t *, cfp, "15");
+#define USE_MACHINE_REGS 1
+
 #else
     register rb_control_frame_t *reg_cfp;
     VALUE *reg_pc;
-- 
2.12.0

openSUSE Build Service is sponsored by