From cb51845b7440664eccccf235aeda77dfaf59a87f Mon Sep 17 00:00:00 2001 From: David Carlier Date: Fri, 22 Nov 2019 16:33:35 +0000 Subject: [PATCH] Implementing OS::ArmUsingHardFloat on FreeBSD for ARM. Pretty similar than other oses except we check LLVM/clang usage. Upstreaming local FreeBSD patches. Change-Id: Ife8447a9ff35e30a92134f65a2d8394d5123d9ab Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1910108 Commit-Queue: Ulan Degenbaev Reviewed-by: Ulan Degenbaev Cr-Commit-Position: refs/heads/master@{#65137} --- src/base/platform/platform-linux.cc | 42 --------------------------- src/base/platform/platform-posix.cc | 44 +++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 42 deletions(-) diff --git a/src/base/platform/platform-linux.cc b/src/base/platform/platform-linux.cc index 3c22487058..26efd100df 100644 --- a/src/base/platform/platform-linux.cc +++ b/src/base/platform/platform-linux.cc @@ -39,48 +39,6 @@ namespace v8 { namespace base { -#ifdef __arm__ - -bool OS::ArmUsingHardFloat() { -// GCC versions 4.6 and above define __ARM_PCS or __ARM_PCS_VFP to specify -// the Floating Point ABI used (PCS stands for Procedure Call Standard). -// We use these as well as a couple of other defines to statically determine -// what FP ABI used. -// GCC versions 4.4 and below don't support hard-fp. -// GCC versions 4.5 may support hard-fp without defining __ARM_PCS or -// __ARM_PCS_VFP. - -#define GCC_VERSION \ - (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) -#if GCC_VERSION >= 40600 && !defined(__clang__) -#if defined(__ARM_PCS_VFP) - return true; -#else - return false; -#endif - -#elif GCC_VERSION < 40500 && !defined(__clang__) - return false; - -#else -#if defined(__ARM_PCS_VFP) - return true; -#elif defined(__ARM_PCS) || defined(__SOFTFP__) || defined(__SOFTFP) || \ - !defined(__VFP_FP__) - return false; -#else -#error \ - "Your version of compiler does not report the FP ABI compiled for." \ - "Please report it on this issue" \ - "http://code.google.com/p/v8/issues/detail?id=2140" - -#endif -#endif -#undef GCC_VERSION -} - -#endif // def __arm__ - TimezoneCache* OS::CreateTimezoneCache() { return new PosixDefaultTimezoneCache(); } diff --git a/src/base/platform/platform-posix.cc b/src/base/platform/platform-posix.cc index 99abcd5568..0424d4c135 100644 --- a/src/base/platform/platform-posix.cc +++ b/src/base/platform/platform-posix.cc @@ -150,6 +150,50 @@ void* Allocate(void* hint, size_t size, OS::MemoryPermission access) { } // namespace +#if V8_OS_LINUX || V8_OS_FREEBSD +#ifdef __arm__ + +bool OS::ArmUsingHardFloat() { + // GCC versions 4.6 and above define __ARM_PCS or __ARM_PCS_VFP to specify + // the Floating Point ABI used (PCS stands for Procedure Call Standard). + // We use these as well as a couple of other defines to statically determine + // what FP ABI used. + // GCC versions 4.4 and below don't support hard-fp. + // GCC versions 4.5 may support hard-fp without defining __ARM_PCS or + // __ARM_PCS_VFP. + +#define GCC_VERSION \ + (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) +#if GCC_VERSION >= 40600 && !defined(__clang__) +#if defined(__ARM_PCS_VFP) + return true; +#else + return false; +#endif + +#elif GCC_VERSION < 40500 && !defined(__clang__) + return false; + +#else +#if defined(__ARM_PCS_VFP) + return true; +#elif defined(__ARM_PCS) || defined(__SOFTFP__) || defined(__SOFTFP) || \ + !defined(__VFP_FP__) + return false; +#else +#error \ + "Your version of compiler does not report the FP ABI compiled for." \ + "Please report it on this issue" \ + "http://code.google.com/p/v8/issues/detail?id=2140" + +#endif +#endif +#undef GCC_VERSION +} + +#endif // def __arm__ +#endif + void OS::Initialize(bool hard_abort, const char* const gc_fake_mmap) { g_hard_abort = hard_abort; g_gc_fake_mmap = gc_fake_mmap;