Allow clang for ThunderX2 config#492
Conversation
Needed for compiling on e.g. Mac M1. AFAIK clang supports the same -mcpu flag for ThunderX2 as gcc.
|
I'm told homebrew isn't production-ready on M1. What is the recommended way to install gcc? |
In reviewing the clang gnu assembly issue, are you saying there is no way for clang assembly to access half the registers? Or does clang just have a different syntax that we could use and thereby convert the kernel to a format that would work? (Porting kernels to M1) Thanks. |
|
test post |
|
Figual, is your experience that there is no way clang inline assembly can access half the registers on ARM? Or could we port to clang just by rewriting the assembly in a different syntax? Thanks. |
|
@jdiamondGitHub I don't think it's that clang can only access half the registers, just that for some reason the compiler keeps one of the registers for itself (like %rbp is sometimes reserved in x86). |
|
Thanks, Devin. That's the other point I wanted to raise: We know that
the x86 kernels had to be modified for Mac due to the difference in ABI
(e.g., which register was used for the stack, etc.) Does anyone know
how Apple's use of ARM registers differs from Linux? I'm thinking
that's another reason we might have to modify the ARM kernels for Macs.
…On 4/14/21 4:08 PM, Devin Matthews wrote:
@jdiamondGitHub <https://github.com/jdiamondGitHub> I don't think it's
that clang can only access half the registers, just that for some
reason the compiler keeps one of the registers for itself (like %rbp
is sometimes reserved in x86).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#492 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHGHJKZA5GM7XQWUKCWJ6CLTIX73NANCNFSM4254B5EA>.
|
|
The main point here being that even if we set up gcc on Mac, the kernel
might not work. It might crash the machine, similar to what happened
before we modified the x86 kernels for Mac.
…On 4/16/21 10:08 AM, Jeff Diamond wrote:
Thanks, Devin. That's the other point I wanted to raise: We know
that the x86 kernels had to be modified for Mac due to the difference
in ABI (e.g., which register was used for the stack, etc.) Does
anyone know how Apple's use of ARM registers differs from Linux? I'm
thinking that's another reason we might have to modify the ARM kernels
for Macs.
On 4/14/21 4:08 PM, Devin Matthews wrote:
>
> @jdiamondGitHub <https://github.com/jdiamondGitHub> I don't think
> it's that clang can only access half the registers, just that for
> some reason the compiler keeps one of the registers for itself (like
> %rbp is sometimes reserved in x86).
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#492 (comment)>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AHGHJKZA5GM7XQWUKCWJ6CLTIX73NANCNFSM4254B5EA>.
>
|
|
Looks like maybe X18 is the issue?
https://developer.apple.com/documentation/xcode/writing_arm64_code_for_apple_platforms
…On 4/14/21 4:08 PM, Devin Matthews wrote:
@jdiamondGitHub <https://github.com/jdiamondGitHub> I don't think it's
that clang can only access half the registers, just that for some
reason the compiler keeps one of the registers for itself (like %rbp
is sometimes reserved in x86).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#492 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHGHJKZA5GM7XQWUKCWJ6CLTIX73NANCNFSM4254B5EA>.
|
|
Folks, I don't think the gcc approach will work. I was just Googling
it, and gcc has not yet created an M1 back end, implying that anything
gcc produces will also not respect the Apple specific registers. So the
issue with using gcc is not just about the kernel, but with blis itself.
Seems like we have to focus on making the ARM kernels compatible with
Clang and the M1 reserved registers.
…On 4/16/21 10:26 AM, Jeff Diamond wrote:
Looks like maybe X18 is the issue?
https://developer.apple.com/documentation/xcode/writing_arm64_code_for_apple_platforms
On 4/14/21 4:08 PM, Devin Matthews wrote:
>
> @jdiamondGitHub <https://github.com/jdiamondGitHub> I don't think
> it's that clang can only access half the registers, just that for
> some reason the compiler keeps one of the registers for itself (like
> %rbp is sometimes reserved in x86).
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#492 (comment)>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AHGHJKZA5GM7XQWUKCWJ6CLTIX73NANCNFSM4254B5EA>.
>
|

Needed for compiling on e.g. Mac M1. AFAIK clang supports the same -mcpu flag for ThunderX2 as gcc.