Skip to content

[proposal] Freeze __ARM_ARCH macro up until Armv8.x-A #304

Open

Description

@vhscampos

LLVM and gcc have an older definition of this macro, thus they don't currently follow the ACLE.

Starting from Armv9-a, numerical comparisons break. For instance, 805 (Armv8-5.a) is greater than 9 (Armv9-a).

Action: freeze the macro definition up until Armv8.x-A. Thus it must not be used from Armv9-A onwards. The ACLE spec must be updated to inform so.

However, the ACLE specification must inform users not to use or rely on this macro to control architecture features usage. They must use specific feature macros instead.

Activity

  1. changed the title [-]Freeze __ARM_ARCH macro up until Armv8.x-A[/-] [+][proposal] Freeze __ARM_ARCH macro up until Armv8.x-A[/+] on Mar 4, 2024
  2. davidben commented on Nov 2, 2026

    @davidben

    Bumping this. We ran into this in BoringSSL. CC @dingxiangfei2009

    We cannot safely write things like __ARM_ARCH >= 9 because that will misfire in compilers that implement the X * 100 + Y convention. But we also cannot rely on X * 100 + Y because no one implements it. (We would rather use __ARM_FEATURE_* anyway, but you all are missing stuff. See #475.)

    I see in llvm/llvm-project#49015 and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99312, both compilers rejected doing this and someone (Arm?) said this was being deprecated. But it has not actually been deprecated.

    Was the X * 100 + Y convention ever implemented anywhere? Can Arm do something about this mess please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions