[PATCH] D52144: use __ARM_FP instead of __VFP_FP__

Frank Schaefer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 15 17:08:41 PDT 2018


kelledin created this revision.
Herald added subscribers: Sanitizers, llvm-commits, chrib, delcypher, kristof.beyls, mgorny.
Herald added a reviewer: javed.absar.

Fix detection of ARM toolchain FPU support


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D52144

Files:
  lib/builtins/CMakeLists.txt


Index: lib/builtins/CMakeLists.txt
===================================================================
--- lib/builtins/CMakeLists.txt
+++ lib/builtins/CMakeLists.txt
@@ -568,9 +568,14 @@
       endif()
 
       # For ARM archs, exclude any VFP builtins if VFP is not supported
+      # NOTE: __VFP_FP__ is unconditionally defined by gcc regardless of build
+      # flags, so it's not a good indicator to rely on.  Use __ARM_FP instead.
+      # TODO: *maybe* detect FPU feature level from __ARM_FP?  I would expect
+      # we need both single and double precision FP support, which means we
+      # need at least bits 2 and 3 set in __ARM_FP.
       if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em)$")
         string(REPLACE ";" " " _TARGET_${arch}_CFLAGS "${TARGET_${arch}_CFLAGS}")
-        check_compile_definition(__VFP_FP__ "${CMAKE_C_FLAGS} ${_TARGET_${arch}_CFLAGS}" COMPILER_RT_HAS_${arch}_VFP)
+        check_compile_definition(__ARM_FP "${CMAKE_C_FLAGS} ${_TARGET_${arch}_CFLAGS}" COMPILER_RT_HAS_${arch}_VFP)
         if(NOT COMPILER_RT_HAS_${arch}_VFP)
           list(REMOVE_ITEM ${arch}_SOURCES ${arm_Thumb1_VFPv2_SOURCES} ${arm_Thumb1_SjLj_EH_SOURCES})
         endif()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52144.165668.patch
Type: text/x-patch
Size: 1210 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180916/5195b4dd/attachment.bin>


More information about the llvm-commits mailing list