halide / Halide

a language for fast, portable data-parallel computation
https://halide-lang.org
Other
5.78k stars 1.07k forks source link

Add support for arm64e (Fixes #4490) #8330

Open steven-johnson opened 6 days ago

abadams commented 6 days ago

Does it pass the checks it injects though? Last time we talked about this I thought there was going to be a problem around our use of function pointers because indirect branches need special treatment. It looks almost impossible to test on macos: (https://stackoverflow.com/questions/75186888/how-to-enable-the-arm-pointer-authentication-code-pac-on-macos)

Edit: simd_op_check would at least let us test that the instructions are being emitted.

steven-johnson commented 5 days ago

Does it pass the checks it injects though?

No idea. Still testing. Converting back to draft for now.

steven-johnson commented 5 days ago

Last time we talked about this I thought there was going to be a problem around our use of function pointers because indirect branches need special treatment.

Did we talk about this before? I've apparently flushed those memories.

It looks almost impossible to test on macos: (https://stackoverflow.com/questions/75186888/how-to-enable-the-arm-pointer-authentication-code-pac-on-macos)

That's likely gonna rule me out for testing anything, then (at least in the short term) because I don't possess any iDevices, nor can I get any in the next couple of days.

Is this something that anyone at Adobe has the bandwidth or expertise to look into in the short term? I hate to punt something after seeing that it's hard to do, but I'm about to take two weeks vacation, and if this is something that might be resolvable by someone who won't be starting from ground zero on iOS it would be a big favor (I haven't even attempted to build/debug/etc for an iDevice pre-pandemic, at least)

steven-johnson commented 5 days ago

This appears to be a good overview of arm64e: https://github.com/lelegard/arm-cpusysregs/blob/main/docs/arm64e-on-macos.md