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 01:58:00 +0100 Message-ID: From: Giacomo Tesio To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=047d7b5d272239e0f7052abefedb Subject: Re: [9fans] FP register usage in Plan9 assembler Topicbox-Message-UUID: 816cf562-ead9-11e9-9d60-3106f5b1d025 --047d7b5d272239e0f7052abefedb Content-Type: text/plain; charset=UTF-8 I kinda agree, but I'm too incompetent in the matter. :-) However, I was simply asking if, on amd64, kencc uses the 6 registers that the abi deserves to the parameters. As far as I've understood only BP is used (for the first argument, if integer). Can you confirm? Giacomo 2016-02-02 1:36 GMT+01:00 Charles Forsyth : > > 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. > --047d7b5d272239e0f7052abefedb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I kinda agree, but I'm too incompe= tent in the matter. :-)

However, I was simply asking if, on am= d64, kencc uses the 6 registers that the abi deserves to the parameters.
As far as I've understood only BP is used (for the first argumen= t, if integer).

Can you confirm?



Giacomo<= /div>

2016-02-02 1= :36 GMT+01:00 Charles Forsyth <charles.forsyth@gmail.com>:

On 1 February 201= 6 at 23:34, Giacomo Tesio <giacomo@tesio.it> 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 inte= ger, is passed in RARG, which is actually BP.

--047d7b5d272239e0f7052abefedb--