Skip to content

Cranelift: Support tls_value on aarch64 Mach-O #5433

Closed

Description

@nathanwhit

Feature

Support the tls_value instruction on aarch64 Mach-O (darwin)

Benefit

Needed for cg_clif to support TLS on Apple silicon

Implementation

The instruction sequence emitted for this is https://github.com/llvm/llvm-project/blob/ad68586a37e8e23eeb269d03bd28eb46e16bf48c/llvm/test/CodeGen/AArch64/GlobalISel/darwin-tls-call-clobber.ll#L33-L36 (That link is a little confusing because it's a test, but couldn't immediately find a better example).

The x86_64 implementation and aarch64 ELF implementation should provide some guidance as well.

Alternatives

None

Activity

  1. cfallin commented on Dec 14, 2022

    @cfallin
    Member

    This would be great to have; would you be willing to try putting together a PR? The existing implementation for TLS on ELF aarch64 platforms (see this file and this file, grep for ElfTlsGetAddr in both; and see this lowering rule) should be a reasonable guide. Happy to answer further questions if you (or anyone) wants to attempt this!

  2. nathanwhit commented on Dec 14, 2022

    @nathanwhit
    ContributorAuthor

    @cfallin Not sure if you saw, but I actually just posted a PR (#5434)!

    (I was preparing the PR when I realized there wasn't an issue for it yet)

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions