Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does loongarch deal with herb sutter's P0709? It needs an extra register for passing the error. #11

Open
trcrsired opened this issue Aug 10, 2024 · 1 comment

Comments

@trcrsired
Copy link

trcrsired commented Aug 10, 2024

https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2289.pdf

For fails(E) returns, it is proposed for at least AArch64, ARM, x86 and x64, that the
discriminant be returned via the CPU's carry flag. This is because compilers can often fold
the setting or clearing of the CPU's carry flag into the ordering of other operations, thus
making this a zero runtime overhead choice of discriminant1
. On other architectures such as
RISC-V (which has no status register), an extra register would make more sense. It doesn't
matter what an architecture chooses, so long as it is consistent across all compilers.

how do you define this?

@xen0n
Copy link

xen0n commented Aug 11, 2024

I would say that an extra GPR would be appropriate for LoongArch. Because while there is a "flags" register on current Loongson-3-series models, it's part of LBT context, so the base ABI cannot rely on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants