Skip to content

Request: mark all integer platform intrinsics as const #66061

Open
@Lokathor

Description

@Lokathor

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-langRelevant to the language team, which will review and decide on the PR/issue.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions