The Wayback Machine - https://web.archive.org/web/20211102223725/https://github.com/JuliaLang/julia/pull/36592
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

WIP: Some minimal support for Apple Silicon #36592

Merged
merged 1 commit into from Jul 11, 2020
Merged

WIP: Some minimal support for Apple Silicon #36592

merged 1 commit into from Jul 11, 2020

Conversation

Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
@Keno
Copy link
Member

@Keno Keno commented Jul 9, 2020

With this and some hacks to various dependencies, Julia builds for
Darwin ARM64. We don't get very far though, and quickly end up
jumping into a bit of uninitialized JIT memory, so there's clearly
more work to be done here. That said, let's take this one step at
a time, so here's the few pieces that at least make it build.

@Keno Keno requested review from staticfloat and yuyichao Jul 9, 2020
@Keno Keno changed the title Some minimal support for Apple Silicon WIP: Some minimal support for Apple Silicon Jul 9, 2020
#elif defined(_CPU_AARCH64_)
typedef arm_thread_state64_t host_thread_state_t;
typedef arm_exception_state64_t host_exception_state_t;
#define HOST_EXCEPTION_STATE ARM_EXCEPTION_STATE
Copy link
Member Author

@Keno Keno Jul 9, 2020

Note to self: This should be ARM_EXCEPTION_STATE64

Copy link
Contributor

@yuyichao yuyichao Jul 9, 2020

Is that a change from Apple that you are expecting? Or are you going to push a new version?

Copy link
Member Author

@Keno Keno Jul 9, 2020

I'll push a new version, there's still some other issues with it also.

Copy link
Contributor

@yuyichao yuyichao left a comment

The change makes sense, though I’m just assuming the signal handling is correct....

A few questions,

  1. Is it A64 only?
  2. What’s the actual chip and features? What’s apple’s way of detecting the features?
    I’ve heard that it can boot Linux so checking it from there should be interesting (to see if #36485 detects it correctly).i assume it doesn’t have hwcap or at least not in the same way Linux does it. Does it at least support what Linux have with HWCAP_CPUID? Or is it like iOS where, as I read, you jus need to hard code the known hardware features of various Apple devices.

#elif defined(_CPU_AARCH64_)
typedef arm_thread_state64_t host_thread_state_t;
typedef arm_exception_state64_t host_exception_state_t;
#define HOST_EXCEPTION_STATE ARM_EXCEPTION_STATE
Copy link
Contributor

@yuyichao yuyichao Jul 9, 2020

Is that a change from Apple that you are expecting? Or are you going to push a new version?

@Keno
Copy link
Member Author

@Keno Keno commented Jul 9, 2020

  • Is it A64 only?

I believe so yes. Darwin has support for A32, but all recent iDevices are A64 and I believe there will never be an A32 mac.

What’s the actual chip and features? What’s apple’s way of detecting the features?

The chip in the DTK is an Apple A12Z. I haven't figured out if there's any way to do feature detection. I need to look into that.

With this and some hacks to various dependencies, Julia builds for
Darwin ARM64. We don't get very far though, and quickly end up
jumping into a bit of uninitialized JIT memory, so there's clearly
more work to be done here. That said, let's take this one step at
a time, so here's the few pieces that at least make it build.
@Keno Keno force-pushed the kf/applesilicon branch from 140781c to 8ec7ce8 Jul 10, 2020
@Keno Keno mentioned this pull request Jul 11, 2020
30 tasks
@Keno
Copy link
Member Author

@Keno Keno commented Jul 11, 2020

Looks like we can feature detect via sysctl:

$ sysctl hw.optional
hw.optional.floatingpoint: 1
hw.optional.watchpoint: 4
hw.optional.breakpoint: 6
hw.optional.neon: 1
hw.optional.neon_hpfp: 1
hw.optional.neon_fp16: 1
hw.optional.armv8_1_atomics: 1
hw.optional.armv8_crc32: 1
hw.optional.armv8_2_fhm: 0
hw.optional.amx_version: 0
hw.optional.ucnormal_mem: 0
hw.optional.arm64: 1

@Keno Keno merged commit a23a4ff into master Jul 11, 2020
15 of 16 checks passed
@Keno Keno deleted the kf/applesilicon branch Jul 11, 2020
simeonschaub added a commit to simeonschaub/julia that referenced this issue Aug 11, 2020
With this and some hacks to various dependencies, Julia builds for
Darwin ARM64. We don't get very far though, and quickly end up
jumping into a bit of uninitialized JIT memory, so there's clearly
more work to be done here. That said, let's take this one step at
a time, so here's the few pieces that at least make it build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment