changeset 42:ecc9403e214a r0.9-RC3

- final touch for complete armhf callback support, yay - armhf doc updates
author cslag
date Fri, 18 Dec 2015 23:28:18 +0100
parents 00310bf92924
children 709079672998
files ToDo doc/manual/callconvs/callconv_arm32.tex dyncallback/dyncall_callback_arm32_arm_gas.S
diffstat 3 files changed, 13 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ToDo	Fri Dec 18 23:10:37 2015 +0100
+++ b/ToDo	Fri Dec 18 23:28:18 2015 +0100
@@ -15,9 +15,7 @@
       - callf
 - fix Minix/x86 callbacks (see callback_suite)
 - fix Linux/rpi callbacks (call_suite)
-- armhf callback support
 - armhf ellipsis support
-- armhf callconv manual entry
 - add portable "make install"
 - support Solaris11 CFLAGS with -D_FILE_OFFSET_BITS=64
 - make sure selinux works (esp. regarding NX bits, asm might need (or similar): .section .note.GNU-stack,"",@progbits)
--- a/doc/manual/callconvs/callconv_arm32.tex	Fri Dec 18 23:10:37 2015 +0100
+++ b/doc/manual/callconvs/callconv_arm32.tex	Fri Dec 18 23:28:18 2015 +0100
@@ -305,8 +305,8 @@
 \hline
 Name         & Brief description\\
 \hline
-{\bf R0}     & parameter 0, scratch, return value\\
-{\bf R1}     & parameter 1, scratch, return value\\
+{\bf R0}     & parameter 0, scratch, non floating point return value\\
+{\bf R1}     & parameter 1, scratch, non floating point return value\\
 {\bf R2,R3}  & parameters 2 and 3, scratch\\
 {\bf R4,R5}  & permanent\\
 {\bf R6}     & scratch\\
@@ -319,8 +319,10 @@
 {\bf R14}    & link register, permanent\\
 {\bf R15}    & program counter (note: due to pipeline, r15 points to 2 instructions ahead)\\
 {\bf CPSR}   & Program status register\\
-{\bf S0-S15} & floating point arguments, single precision\\
-{\bf D0-D7}  & aliases S0-S15, floating point arguments, double precision\\
+{\bf S0}     & floating point argument, floating point return value, single precision\\
+{\bf D0}     & floating point argument, floating point return value, double precision, aliases S0-S1, \\
+{\bf S1-S15} & floating point arguments, single precision\\
+{\bf D1-D7}  & aliases S2-S15, floating point arguments, double precision\\
 {\bf FPSCR}  & VFP status register.\\
 \hline
 \end{tabular}
@@ -343,8 +345,10 @@
 
 \paragraph{Return values}
 \begin{itemize}
-\item return values \textless=\ 32 bits use r0
-\item 64 bit return values use r0 and r1
+\item non floating point return values \textless=\ 32 bits use r0
+\item non floating point 64-bit return values use r0 and r1
+\item single precision floating point return value uses s0
+\item double precision floating point return value uses d0
 \item if return value is a structure, the caller allocates space for the return value on the stack in its frame and passes a pointer to it in r0
 \end{itemize}
 
--- a/dyncallback/dyncall_callback_arm32_arm_gas.S	Fri Dec 18 23:10:37 2015 +0100
+++ b/dyncallback/dyncall_callback_arm32_arm_gas.S	Fri Dec 18 23:28:18 2015 +0100
@@ -74,6 +74,9 @@
 
 	/* Return value. */
 	ldmia	%r13, {%r0, %r1}				/* Load return value in r0 and r1. */
+#if defined(DC__ABI_ARM_HF)
+	fldmiad	%r13, {%d0}						/* Same for floating point return value (if any). */
+#endif
 
 	/* Epilog. */
 	ldmdb	%r11, {%r4-%r11, %r13, %r15}	/* Restore permanent registers (restore stack ptr and program counter).@@@db not needed since we rewrite r13? */