Live data from Hacker News

Writing Portable ARM64 Assembly

ariadne.space

21–22 of 22 posts

Re: Writing Portable ARM64 Assembly

#21
> The second macro is optional, but it allows you to define the correct ELF symbol types outside of Apple’s toolchain:

If portability is your goal, you should not rely on "defined(__clang__)" to imply that you can't use .type assembly directives. Earlier in the article, the author suggests that .type is an ELF-ism and isn't supported by mach-o. clang will define __ELF__ for targets that use ELF object files.

Re: Writing Portable ARM64 Assembly

#22
One can get the Apple-style NEON assembly output by using the LLVM flag "--aarch64-neon-syntax=apple" with llc, opt or the like (or any tool that uses LLVM as a backend for code generation).

This can also be used with Clang by using the "-mllvm --aarch64-neon-syntax=apple" flag too.

Post reply on HN