Skip to content

__ARM_ARCH incorrect for armv8.1-a and above #49015

@llvmbot

Description

@llvmbot
Bugzilla Link 49671
Version trunk
OS All
Reporter LLVM Bugzilla Contributor
CC @DavidSpickett

Extended Description

According to the ACLE Q3 2020 documentation
(https://developer.arm.com/documentation/101028/0012), section 5.4.1 ("A32/T32 instruction set architecture"), for 8.1+ __ARM_ARCH is supposed to be 801 for armv8.1-a, 802 for armv8.2-a, 803 for armv8.3-a, etc.

Clang currently just uses 8 for all versions of armv8. Testing is pretty straightforward: clang --target=aarch64-linux-gnu -march=armv8.6-a -dM -E - </dev/null | grep __ARM_ARCH.

This makes it difficult to determine support for features which are only available in later revisions but don't have an _ARM_FEATURE* macro, such as complex MLA (8.3).

Similar GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99312

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