From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: <732b1707b783c57f27b9c26d5e9c0900@felloff.net> Date: Tue, 2 Feb 2016 00:36:43 +0000 Message-ID: From: Charles Forsyth To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=089e011768d51d0efe052abeb245 Subject: Re: [9fans] FP register usage in Plan9 assembler Topicbox-Message-UUID: 81061bc6-ead9-11e9-9d60-3106f5b1d025 --089e011768d51d0efe052abeb245 Content-Type: text/plain; charset=UTF-8 On 1 February 2016 at 23:34, Giacomo Tesio wrote: > > Is it correct to say that this means that the Plan9 compiler suite *never* > follows the sysV calling convention documented at section 3.2.3 of AMD64 > ABI http://www.x86-64.org/documentation/abi.pdf and always pushes > parameters to the stack? On amd64, the first parameter, if an integer, is passed in RARG, which is actually BP. The RISC machines generally pass the first parameter, if an integer, in a register. In general, the compiler suite never follows conventions prescribed by apparent maniacs. In particular, varargs/stdargs should (in 2000, let alone 2016) be really easy: lay down the ... parameters on the stack as an array in memory. Done. Instead ABIs give pages of filth that try to work out where things are for the va_x macro calls, because the ABI insists on following the same calling convention for vararg/stdarg functions as might be used for other functions with fixed parameters: parameter passing in registers, special rules for structs, special rules for structs that fit in the parameter registers, special rules for floating-point values. Absurd. --089e011768d51d0efe052abeb245 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= On 1 February 2016 at 23:34, Giacomo Tesio <giacomo@tesio.it>= wrote:

Is it correct to say that thi= s means that the Plan9 compiler suite *never* follows the sysV calling conv= ention documented at section 3.2.3 of AMD64 ABI http://www.x86-64.org/docume= ntation/abi.pdf and always pushes parameters to the stack?
=

On amd64, the first parameter, i= f an integer, is passed in RARG, which is actually BP.
The RISC machines generally pass the first parameter, if an int= eger, in a register.

In general, the co= mpiler suite never follows conventions prescribed by apparent maniacs.
In particular, varargs/stdargs should (in 2000,= let alone 2016) be really easy: lay down the ... parameters on the stack a= s an array in memory.
Done. Instead ABIs gi= ve pages of filth that try to work out where things are for the va_x macro = calls,
because the ABI insists on following= the same calling convention
for vararg/std= arg functions as might be used for other functions with fixed parameters: p= arameter passing in registers, special rules for structs, special rules for= structs that fit in the parameter registers, special rules for floating-po= int values. Absurd.
--089e011768d51d0efe052abeb245--