Fix detection of ARM toolchain FPU support
BTW, I also see a bunch of __VFP_FP__ checks in compiler-rt/test/builtins/Unit/*_test.c . Somehow tests have still passed in my changeset with this change added, but with the *_test.c files still using __VFP_FP__. Should we still tweak those to use __ARM_FP instead?
My feeling is that if we're going to put that kind of check in the source code, we might as well put in the correct check.
I've checked with the gcc sources and it is VFP_FP is unconditionally set by gcc. This might be a relatively recent change so I suspect that clang will have been following early behaviour of gcc. It will be worth updating the tests to use __ARM_FP as well. It will also be worth working out why the tests didn't fail for you as well. I'd only expect to see a difference in behaviour if you were using gcc without floating point support though.
I suggest rewording the comment a bit. Once VFP_FP has been removed then I don't think it is worth commenting about not using it. I think the review summary/source code commit message is the best place to mention that.
I think that your #TODO is correct. As it stands we can't compile compiler-rt if a cpu with a single precision only floating point unit is used. I note that the cmake recipe in clang/cmake/caches/BaremetalARM.cmake cheats and uses -mfpu=fp-armv8 which will allow the double precision files to compile. This is not ideal but the uses of double precision in assembly language seem to be restricted to Darwin, which I don't think are ever called from a single precision only target. It is possible in the future that architecturally illegal combinations are forbidden so this is something we should fix.
My suggestion for the comment is: