Martin Storsjö via llvm-dev
2018-May-21 10:53 UTC
[llvm-dev] Showcase of the Windows/ARM64/MinGW target
On Mon, 21 May 2018, Hayden Livingston wrote:> Ok. How much work was it to enable ARM64 codegen? Is it is > significantly more work than for Linux targets? Are there any special > relocations in ARM64 land?It was surprisingly little work, I'd say. Yes, Windows uses COFF, and there's a separate set of relocations for each architecture. Probably not more work than for Linux targets, but just new things to implement. The initial commits for ARM64 in COFF were done by Mandeep Singh Grang, and after that, there were a few details to fill in about how the relocations are supposed to behave. The public documentation only names them, but luckily link.exe supported those relocations since long ago, so I was able to use llvm-mc together with link.exe to figure out how e.g. the IMAGE_REL_ARM64_REL21/IMAGE_REL_ARM64_PAGEOFFSET_12A relocation pairs are supposed to handle overflow/carry. Other than relocations, the main bits were varargs handling, hooking up small flags and bits here and there as you find what's missing, minor windows/coff specific details like linker directives and dllimport handling, and slightly larger things such as stack probing and TLS. // Martin
Reid Kleckner via llvm-dev
2018-May-21 17:16 UTC
[llvm-dev] Showcase of the Windows/ARM64/MinGW target
On Mon, May 21, 2018 at 3:54 AM Martin Storsjö via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Other than relocations, the main bits were varargs handling, hooking up > small flags and bits here and there as you find what's missing, minor > windows/coff specific details like linker directives and dllimport > handling, and slightly larger things such as stack probing and TLS. >Or, you know, just all the things. :) Congrats on the demo! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180521/b6af0086/attachment.html>
Martin Storsjö via llvm-dev
2018-May-21 18:21 UTC
[llvm-dev] Showcase of the Windows/ARM64/MinGW target
On Mon, 21 May 2018, Reid Kleckner wrote:> On Mon, May 21, 2018 at 3:54 AM Martin Storsjö via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > Other than relocations, the main bits were varargs > handling, hooking up > small flags and bits here and there as you find what's > missing, minor > windows/coff specific details like linker directives and > dllimport > handling, and slightly larger things such as stack > probing and TLS. > > > Or, you know, just all the things. :)Hah, well, at least the non-vararg calling convention is (as far as I know this far) the same as on other platforms - unlike on x86_64, where everything differs. Or maybe put another way; the ARM64 related bits wasn't all that much work, compared to everything related to MinGW.> Congrats on the demo!Thanks! // Martin