Skip to content

internal/cpu: ARM feature detection #26630

@smasher164

Description

@smasher164

Similar to #26538, feature detection on ARM is useful for runtime specialization of code.

Knowing if VFPv4 is present on the hardware helps the implementation of intrinsics (like FMA) and other math operations. However, since VFPv4 is detected through the HWCAP bits from auxv, only the runtime has access to the this information. Given that ARM's hardware features don't map easily to GOARM values, more fine-grained detection is needed.

An additional benefit of including ARM feature detection into the package is that because pre-ARMv8 is so variable, having a single source of feature detection makes it easier to debug different codepaths (f045ddc).

Because Go does not support ARMv4 and lower,

  • HWCAP_26BIT is always false, and thus unnecessary.
  • HWCAP_SWP and HWCAP_HALF should always be enabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions