[PATCH] D35538: [CodeGen][ARM] ARM runtime helper functions are not always soft-fp
Peter Smith via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 19 07:43:32 PDT 2017
peter.smith added a comment.
In https://reviews.llvm.org/D35538#814008, @compnerd wrote:
> Can you please add a test that shows that the AEABI functions are not given the wrong CC? Also, can you show that if someone also passes `-meabi=gnu` with a VFP target, that we still annotate the functions with the differing CC (since that should prefer the GNU functions over the AEABI functions).
Thanks for the comment. Can I just check my understanding before I proceed? In particular I think I need a bit more information about what -meabi=gnu is supposed to do.
I think tests to make sure the the floating point helper functions always use AAPCS is a good idea and I'll start working on that. At the moment I'm trying to work out the best way of doing this as this is all done in the ARM backend in llvm. My current favorite options are to compile and check the assembly in the clang test suite, or just check that the calls to the floating point helper functions are not emitted by clang and add a test to llvm to make sure that they have the correct calling convention. I'm currently tending towards the second option.
With respect to -meabi=gnu, this was added in clang under r252463 and llvm r252462. From tracing through the flag through ARMTargetMachine.cpp and ARMISelLowering.cpp it seems like all this flag does in llvm is to use memcpy, memmove and memset instead of __aeabi_memcpy, __aeabi_memmove and __aeabi_memset respectively. These functions always use AAPCS calling convention, but as they do not take any floating point parameters it doesn't matter either way. As it stands the option won't have any effect on the use of other library functions for example doing a double precision divide with -meabi=gnu results in a call to __aeabi_ddiv. Does this match your expectation of what -meabi=gnu is supposed to do? If it doesn't can you point me at a description? All that I could find externally was the -meabi option in the GNU assembler (there is no equivalent gcc option), the value of -meabi=gnu maps to EF_ARM_ABI_UNKNOWN which is intended for generation of pre ARM ABI objects.
I'll be on vacation for the next 3 days, I'll pick this back up next week.
More information about the cfe-commits