Request: mark all integer platform intrinsics as const
#66061
Labels
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
The platform intrinsics for floating point suffer the standard floating point problems of not being fully deterministic at all times, which is a requirement for const.
However, the platform intrinsics for integer data do not suffer these problems at all. They are plain integer math operations and you can deterministically know exactly what bit pattern you'll get out for any bit pattern you send in. This means that they are eligible for becoming
const
. At compile time we could even emulate the operations if necessary.So, we should make all of these
const
.The text was updated successfully, but these errors were encountered: