This is the mail archive of the
`gcc@gcc.gnu.org`
mailing list for the GCC project.

Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|

Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |

Other format: | [Raw text] |

*From*: David Brown <david at westcontrol dot com>*To*: Mischa Baars <mjbaars1977 at gmail dot com>*Cc*: gcc at gcc dot gnu dot org, Ian Lance Taylor <iant at google dot com>, n8tm at aol dot com*Date*: Mon, 05 Nov 2012 12:26:22 +0100*Subject*: Re: calculation of pi*References*: <5093E32C.6070505@cyberfiber.org> <CAKOQZ8yS2vuS8kTvcKnb56+jBe6Prne0tQAeJKd9b1aBrc6s4w@mail.gmail.com> <5094CDDE.3080809@cyberfiber.org> <CAKOQZ8wzkq3Bcck2_MgC495Py=JPmi3-ZyxoFkYw7dfOeiJjsw@mail.gmail.com> <509636AB.2000200@cyberfiber.org> <CAKOQZ8xuSkNyj-__NoE3g7kV-ADz+QttDWUOeqf9-0mYCcDzjQ@mail.gmail.com> <50979602.20609@gmail.com>

On 11/05/2012 05:55 AM, Ian Lance Taylor wrote:On Sun, Nov 4, 2012 at 1:34 AM, Mischa Baars <mjbaars1977@gmail.com> wrote:On 11/04/2012 02:45 AM, Ian Lance Taylor wrote:There is no "original." The 32-bit and 64-bit ABIs are different. The 64-bit ABI has always passed arguments in registers. There is no option to force the 64-bit compiler to pass arguments on the stack.

Sounds more logical to me, that a least all types of numbers are treated in the same manner. I suppose the ABI should be modified then if you ask me.An ABI is by definition processor specific. The placement of argument values is chosen based on runtime efficiency, not on any other sort of logic. On x86_64, 32-bit and 64-bit float values can be passed directly in registers, as the x86_64 has efficient 32-bit and 64-bit floating point registers. The x86_64 does not have floating point registers that can efficiently store floating point values with more than 64 bits, so those values are not passed in floating point registers. To make any other choice would cost runtime efficiency, which is the only logic that matters.

Ian

Hi Ian,

Here I have attached the code that proves that you are wrong, the 64-bit code gets slower and not faster while passing arguments in 'xmm0' when loading arguments in the floating point core for processing, i.e. transcendental functions like 'fsin' which can't be done using 'sse' instructions. For the extended real numerical type, the argument cannot even be passed in 'xmm0' since there are no 'sse' instructions for extended real numbers, which makes the passing of arguments in 64-bit mode very inconsistent as you can see.

Regards, Mischa.

Hi,

In the particular case of passing floating point arguments, of course, the extra step needed to move data from an xmm register onto the stack for the "fsin" code is totally negligible. The great majority of floating point operations /are/ handled by SSE instructions, since operations such as load, store, register move, and basic arithmetic outweigh the use of transcendental functions by many orders of magnitude. You do not change the ABI used by an entire operating system to shave a few clock cycles off an unusual piece of test code to calculate pi.

**Follow-Ups**:**Re: calculation of pi***From:*Mischa Baars

**References**:**calculation of pi***From:*Mischa Baars

**Re: calculation of pi***From:*Ian Lance Taylor

**Re: calculation of pi***From:*Mischa Baars

**Re: calculation of pi***From:*Ian Lance Taylor

**Re: calculation of pi***From:*Mischa Baars

**Re: calculation of pi***From:*Ian Lance Taylor

**Re: calculation of pi***From:*Mischa Baars

Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|

Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |