# HG changeset patch # User Tassilo Philipp # Date 1489945419 -3600 # Node ID 53c42b1d9f8be2c141aadbf1d833274bf2f14973 # Parent 95cf20c0d1de0ac8595bde103e758b790ec88ec5 - sparc doc improvements for both, 32 and 64 - changelog, mentioning sparc64 callback support diff -r 95cf20c0d1de -r 53c42b1d9f8b ChangeLog --- a/ChangeLog Sun Mar 19 19:34:34 2017 +0100 +++ b/ChangeLog Sun Mar 19 18:43:39 2017 +0100 @@ -13,7 +13,8 @@ dyncallback: o PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!) o MIPS o32 (big- and little-endian), EABI (32 bit, little-endian) and n64 (big-endian) support - o SPARC (32-bit) support + o SPARC32 (v7/v8) support + o SPARC64 (v9) support o POSIX compliance: fallback for wx alloc on systems that don't have mmap()'s MAP_ANON general: o marked assembly code as not needing an execstack, for safer/easier integration into other @@ -21,7 +22,8 @@ toolchains (thanks Thorsten Behrens for report and analysis) doc: o working html doc generation from TEX sources - o SPARC (32-bit) calling convention description + o SPARC32 (v7/v8) calling convention description + o SPARC64 (v9) calling convention description bindings: o better documentation, removed relative path dependencies, general cleanup o python: updated to latest signature format (was still on 0.1) diff -r 95cf20c0d1de -r 53c42b1d9f8b doc/manual/callconvs/callconv_sparc.tex --- a/doc/manual/callconvs/callconv_sparc.tex Sun Mar 19 19:34:34 2017 +0100 +++ b/doc/manual/callconvs/callconv_sparc.tex Sun Mar 19 18:43:39 2017 +0100 @@ -80,9 +80,7 @@ \hhline{~-~~} & \vdots & & \\ \hhline{~=~~} -local data & \hspace{4cm} & & \mrrbrace{10}{caller's frame} \\ -\hhline{~-~~} -padding & & & \\ +local data (and padding) & \hspace{4cm} & & \mrrbrace{9}{caller's frame} \\ \hhline{~-~~} \mrlbrace{7}{parameter area} & argument x & \mrrbrace{3}{stack parameters} & \\ & \ldots & & \\ @@ -94,7 +92,7 @@ \hhline{~-~~} register save area (\%i* and \%l*) & & & \\ \hhline{~=~~} -local data and padding & & & \mrrbrace{3}{current frame} \\ +local data (and padding) & & & \mrrbrace{3}{current frame} \\ \hhline{~-~~} parameter area & & & \\ \hhline{~-~~} diff -r 95cf20c0d1de -r 53c42b1d9f8b doc/manual/callconvs/callconv_sparc64.tex --- a/doc/manual/callconvs/callconv_sparc64.tex Sun Mar 19 19:34:34 2017 +0100 +++ b/doc/manual/callconvs/callconv_sparc64.tex Sun Mar 19 18:43:39 2017 +0100 @@ -63,15 +63,18 @@ \item stack grows down \item stack parameter order: right-to-left \item caller cleans up the stack -\item stack always aligned to 8 bytes +\item stack frame is always aligned to 16 bytes \item first 6 integers are passed in registers using \%o0-\%o5 \item first 8 quad precision floating point args (or 16 double precision, or 32 single precision) are passed in floating point registers (\%q0,\%q4,...,\%q28 or \%d0,\%d2,...,\%d30 or \%f0-\%f32, respectively) \item for every other argument the stack is used -\item for every floating point argument passed in a register, corresponding \%o* registers or stack space is skipped (e.g. if \%d0 is used for 3rd call argument, \%o2 is skipped and not used for subsequent integer arguments) +\item single precision floating point args are passed in odd \%f* registers, and are "right aligned" in their 8-byte space on the stack +\item for every argument passed, corresponding \%o*, \%f* register or stack space is skipped (e.g. passing a doube as 3rd call argument, \%d4 is used and \%o2 is skipped) \item all arguments \textless=\ 64 bit are passed as 64 bit values \item minimum stack size is 128 bytes, b/c stack pointer must always point at enough space to store all \%i* and \%l* registers, used when running out of register windows \item if needed, register spill area (for integer arguments passed via \%o0-\%o5) is adjacent to parameters -\item results are expected by caller to be returned in \%o0-\%o3 (after reg window restore, meaning callee writes to \%i0-\%i3) for integers, \%d0,\%d2,\%d4,\%d6 for floats, and for structs/unions a pointer to them is used as a hidden stack parameter (see below) +\item results are expected by caller to be returned in \%o0-\%o3 (after reg window restore, meaning callee writes to \%i0-\%i3) for integers, \%d0,\%d2,\%d4,\%d6 for floats +\item structs/unions up to 32b, the fields are returned via the respective registers mentioned in the previous bullet point +\item for structs/unions \textgreater= 32b, the caller allocates the space and a pointer to it is passed as hidden first parameter to the function called (meaning in \%o0) \end{itemize} \paragraph{Stack layout} @@ -83,7 +86,7 @@ \hhline{~-~~} & \vdots & & \\ \hhline{~=~~} -local data & \hspace{4cm} & & \mrrbrace{10}{caller's frame} \\ +local data (and padding) & \hspace{4cm} & & \mrrbrace{8}{caller's frame} \\ \hhline{~-~~} \mrlbrace{7}{parameter area} & argument x & \mrrbrace{3}{stack parameters} & \\ & \ldots & & \\ @@ -91,11 +94,10 @@ & input argument 5 spill & \mrrbrace{3}{spill area} & \\ & \ldots & & \\ & input argument 0 spill & & \\ - & struct/union return pointer & & \\ \hhline{~-~~} register save area (\%i* and \%l*) & & & \\ \hhline{~=~~} -local data & & & \mrrbrace{3}{current frame} \\ +local data (and padding) & & & \mrrbrace{3}{current frame} \\ \hhline{~-~~} parameter area & & & \\ \hhline{~-~~}