Liste des Groupes | Revenir à c arch |
On 1/7/2025 3:35 PM, Scott Lurndal wrote:For some reason, when I think of doubleword, I instantaneously think of something like this wrt DWCAS:mitchalsup@aol.com (MitchAlsup1) writes:If I had to guess, a word would be sizeof(void*)?On Tue, 7 Jan 2025 9:09:20 +0000, David Brown wrote:>
>On 06/01/2025 21:19, MitchAlsup1 wrote:>------------------------Both C and C++ provide perfectly good ways to pass data around by
address when that's what you want to do. My problem is that the calling
convention won't let me pass around data in registers when I want to do
that.
>
I don't care what the compiler does when not optimising heavily - or for
compilers that can't optimise heavily. When I am looking for efficient
code, I use optimisation - caring about inefficiencies in the calling
convention without heavy optimisation is like caring about how fast your
car goes when you keep it in first gear.
>>>Struct returns were (and AFAIK still are, many decades after>
they were added to C) a relatively rarely used feature, so Johnson
(PCC's author) probably did not want to waste a lot of effort on
making it more efficient.
In addition, the programmer has the choice of changing into pointer
form (&struct) from value form (struct) which is what we learned
was better style way back then.
>
I already know when it is best to pass a struct via a pointer, and when
it is best to pass it as a struct value. (The 32-bit ARM calling
convention happily uses registers to pass structs by value, using up to
4 registers. It's the return via registers that is missing.) I also
know when it is best for a struct return to be via an address or in
registers - but C has no way to let me choose that.
My 66000 ABI passes structs up to 8 doublewords in size as
arguments and as results.
What is a doubleword in your architecture? In intel vernacular
it's 32-bits, but that's not universal.
Both x86_64 and ARM64 support passing eight 64-bit quantities
as arguments and as results architecturally without using
the SIMD registers.
>
Now, ABI conventions may be otherwise, but they're important
for interoperability, not basic functionality.
Les messages affichés proviennent d'usenet.