File 0010-PPC64-Define-13-FPs-regs-as-arguments.patch of Package lua51-luajit

From 1e8532daeae19294df997b2dab70737f8f95e55c Mon Sep 17 00:00:00 2001
From: Gustavo Serra Scalet <gustavo.scalet@eldorado.org.br>
Date: Tue, 6 Sep 2016 13:04:16 -0300
Subject: [PATCH 10/15] PPC64: Define 13 FPs regs as arguments

ABI mandates 13 but only 8 was implemented.
---
 src/lj_ccall.h    | 2 +-
 src/lj_ctype.h    | 2 +-
 src/vm_ppc64.dasc | 5 +++++
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/lj_ccall.h b/src/lj_ccall.h
index 3b26e8f201b1..a222e526279e 100644
--- a/src/lj_ccall.h
+++ b/src/lj_ccall.h
@@ -87,7 +87,7 @@ typedef union FPRArg {
 
 #if LJ_ARCH_PPC64
 #define CCALL_NARG_GPR		8
-#define CCALL_NARG_FPR		8
+#define CCALL_NARG_FPR		13
 #define CCALL_NRET_GPR		4	/* For complex double. */
 #define CCALL_NRET_FPR		1
 #define CCALL_SPS_EXTRA		14
diff --git a/src/lj_ctype.h b/src/lj_ctype.h
index 0c220a888668..ed974bb9bfa3 100644
--- a/src/lj_ctype.h
+++ b/src/lj_ctype.h
@@ -153,7 +153,7 @@ typedef struct CType {
 
 /* Simplify target-specific configuration. Checked in lj_ccall.h. */
 #define CCALL_MAX_GPR		8
-#define CCALL_MAX_FPR		8
+#define CCALL_MAX_FPR		13
 
 typedef LJ_ALIGN(8) union FPRCBArg { double d; float f[2]; } FPRCBArg;
 
diff --git a/src/vm_ppc64.dasc b/src/vm_ppc64.dasc
index b68cf36249a4..215eb2dca592 100644
--- a/src/vm_ppc64.dasc
+++ b/src/vm_ppc64.dasc
@@ -2394,6 +2394,11 @@ static void build_subroutines(BuildCtx *ctx)
   |  lfd f6, CCSTATE->fpr[5]
   |  lfd f7, CCSTATE->fpr[6]
   |  lfd f8, CCSTATE->fpr[7]
+  |  lfd f9, CCSTATE->fpr[8]
+  |  lfd f10, CCSTATE->fpr[9]
+  |  lfd f11, CCSTATE->fpr[10]
+  |  lfd f12, CCSTATE->fpr[11]
+  |  lfd f13, CCSTATE->fpr[12]
   |3:
   |  ld r12, CCSTATE->func
   |  ld CARG2, CCSTATE->gpr[1]
-- 
2.20.1