Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AArch64] Add soft-float ABI #74460

Merged
merged 9 commits into from
Feb 15, 2024
Merged

Commits on Jan 11, 2024

  1. [AArch64] Split feature tests for FP and SIMD

    AArch64TargetInfo defaults to having the FP feature enabled, but this
    function was ignoring that and checking for SIMD instructions instead.
    
    This won't affect most users, because the driver explicitly enables or
    disables fp-armv8, which gets handled by
    AArch64TargetInfo::handleTargetFeatures to turn FP and SIMD on or off.
    However, it will make testing future patches easier, and allow testing
    for the presense of FP registers/instructions in CC1 tests.
    
    Change-Id: I2d2b3569dca5fa1dc40c5c6d1dabf7741b8c480e
    ostannard committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    890f12e View commit details
    Browse the repository at this point in the history
  2. [AArch64] Add a soft-float ABI

    This patch just adds the ABI enum and tests existing behaviour, it
    doesn't make any functional changes yet.
    
    I've not added an option to turn this on, instead it is automatically
    selected if the target does not have FP registers. This is because the
    vast majority of existing AArch64 hardware does have an FPU, so we
    expect this to only be used when abbsoultely necessary, unlike AArch32
    where both ABIs were commonly used.
    
    Change-Id: I6f3a4562ca60c31b49a926cdce1881418677c604
    ostannard committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    0eeb4d3 View commit details
    Browse the repository at this point in the history
  3. [AArch64] Disable HFAs/HVAs for soft-float

    If we can't pass them in FP registers, then homogeneous floating-point
    and vector aggregates should be treated like any other composite type,
    and passed either in registers or on the stack.
    
    Change-Id: Icd56e122ad586462d6059069f923ffca4b32a8d2
    ostannard committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    898484f View commit details
    Browse the repository at this point in the history
  4. [AArch64] Fix va_arg for soft-float

    The AArch64 back-end already avoids saving the FP registers to the
    va_list when the FP registers aren't present, but clang also needs to
    know not to load them from the FP register save area when generating
    code for va_arg.
    
    The layout of va_list remains the same, but the vr_top and vr_offs
    fields are unused.
    
    Change-Id: I5d3dee1ac4a29f189432957910662939b79d9329
    ostannard committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    45a5163 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e48f525 View commit details
    Browse the repository at this point in the history
  6. [AArch64] Invert check for soft-float ABI (NFC)

    If any other AArch64ABIKinds reach here in future they will use
    floating-point registers, which is a better default.
    ostannard committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    a1171c8 View commit details
    Browse the repository at this point in the history
  7. Clang-format

    ostannard committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    06f5701 View commit details
    Browse the repository at this point in the history
  8. [AArch64] Add the -mabi=aapcs-soft option for AArch64

    * The default is unchanged ("aapcs", except for targets where it already
      defaults to "darwinpcs"), independent of whether the target has an FPU
    * If -mabi=aapcs-soft is used and the target has an FPU, the driver
      reports an error, to prevent having two incompatible ABIs for one
      target.
    * If a hard-float ABI is requested for a target without an FPU, this is
      accepted by the driver, but any use of floating-point types is an
      error. This matches GCC's behaviour with -mgeneral-regs-only, and
      allows for writing code which is compatible with both ABIs.
    ostannard committed Jan 11, 2024
    Configuration menu
    Copy the full SHA
    3017b8a View commit details
    Browse the repository at this point in the history

Commits on Feb 15, 2024

  1. Configuration menu
    Copy the full SHA
    8910baa View commit details
    Browse the repository at this point in the history