changeset 47:c4de113dc1e9

- some armhf comments, doc clarification, cleanup
author cslag
date Sun, 20 Dec 2015 00:09:47 +0100
parents 49bf9f6731e7
children 4388e27eadd7
files doc/manual/callconvs/callconv_arm32.tex dyncall/dyncall_callvm_arm32_arm_armhf.c dyncallback/dyncall_args_arm32_arm.c
diffstat 3 files changed, 9 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/doc/manual/callconvs/callconv_arm32.tex	Sat Dec 19 23:40:15 2015 +0100
+++ b/doc/manual/callconvs/callconv_arm32.tex	Sun Dec 20 00:09:47 2015 +0100
@@ -337,7 +337,7 @@
 \item first four non-floating-point words are passed using r0-r3
 \item first 16 single-precision, or 8 double-precision arguments are passed via s0-s15 or d0-d7, respectively (note that since s and d registers are aliased, already used ones are skipped)
 \item subsequent parameters are pushed onto the stack (in right to left order, such that the stack pointer points to the first of the remaining parameters)
-\item note that as soon as d7 is used, subsequent single precision floating point parameters are also pushed onto the stack, even if there are still free S* registers
+\item note that as soon one floating point parameter is passed via the stack, subsequent single precision floating point parameters are also pushed onto the stack even if there are still free S* registers
 \item if the callee takes the address of one of the parameters and uses it to address other parameters (e.g. varargs) it has to copy - in its prolog - the first four words to a reserved stack area adjacent to the other parameters on the stack @@@?check spilling of float args, also
 \item parameters \textless=\ 32 bits are passed as 32 bit words
 \item structures and unions are passed by value, with the first four words of the parameters in r0-r3 @@@?check doc
--- a/dyncall/dyncall_callvm_arm32_arm_armhf.c	Sat Dec 19 23:40:15 2015 +0100
+++ b/dyncall/dyncall_callvm_arm32_arm_armhf.c	Sun Dec 20 00:09:47 2015 +0100
@@ -105,6 +105,11 @@
 
 static void a_double(DCCallVM* in_p, DCdouble x)
 {
+  union {
+    DCdouble d;
+    DCchar   b[8];
+  } v;
+
   DCCallVM_arm32_armhf* p = (DCCallVM_arm32_armhf*)in_p;
   if (p->d < 16) {
     * (double*) &p->S[p->d] = x;
@@ -116,22 +121,9 @@
       p->s = p->d;
     }
   } else {
-    p->s = 16;
-    union {  /*@@@decl at top, compat*/
-      DCdouble d;
-      DCchar   b[8];
-    } v; // ,w;
+    p->s = 16; /* fp registers all full - need to use stack now: stop filling gaps for single precision, also */
     v.d = x;
-#if 0
-    w.b[0] = v.b[7];
-    w.b[1] = v.b[6];
-    w.b[2] = v.b[5];
-    w.b[3] = v.b[4];
-    w.b[4] = v.b[3];
-    w.b[5] = v.b[2];
-    w.b[6] = v.b[1];
-    w.b[7] = v.b[0];
-#endif
+
     /* 64 bit values need to be aligned on 8 byte boundaries */
     dcVecSkip(&p->mVecHead, dcVecSize(&p->mVecHead) & 4);
     dcVecAppend(&p->mVecHead, &v.b[0], sizeof(DCdouble));
--- a/dyncallback/dyncall_args_arm32_arm.c	Sat Dec 19 23:40:15 2015 +0100
+++ b/dyncallback/dyncall_args_arm32_arm.c	Sun Dec 20 00:09:47 2015 +0100
@@ -94,7 +94,7 @@
       args->freg_count = args->dreg_count;
     return d.d;
   }
-  args->freg_count = 16; /* float registers all filled up - stop filling gaps for single precision, also */
+  args->freg_count = 16; /* fp registers all full - need to use stack now: stop filling gaps for single precision, also */
 #endif
   arm_align_64(args);
   d.l[0] = *(DClong*)arm_word(args);