Commit a9626b9d authored by Frank Barchard's avatar Frank Barchard

Disable AVX512 for iOS simulator xcode 9 builds.

iOS simulator has the option to build with xcode instead of clang.
GN use_xcode_clang=true enables the xcode build.
As of version Xcode 9.2, the clang version used does not support
AVX512.  The version reported is version 9, but for normal clang,
version 7 is sufficient to AVX512.
When a version of XCode does support AVX512, the version check can
be updated to allow AVX512 for newer versions of XCode.
with XCode 9.2 the following macro is set.
__APPLE_CC__ 6000

Bug: libyuv:789
Test: gn gen out/Release "--args=is_debug=false target_os=\"ios\" ios_enable_code_signing=false target_cpu=\"x86\" use_xcode_clang=true"
Change-Id: I5a9a0b4a2760c7d09a4bcb464b3668979113b07e
Reviewed-on: https://chromium-review.googlesource.com/991595Reviewed-by: 's avatarrichard winterton <rrwinterton@gmail.com>
parent a694e339
Name: libyuv Name: libyuv
URL: http://code.google.com/p/libyuv/ URL: http://code.google.com/p/libyuv/
Version: 1707 Version: 1708
License: BSD License: BSD
License File: LICENSE License File: LICENSE
......
...@@ -98,8 +98,8 @@ arm64 ...@@ -98,8 +98,8 @@ arm64
ios simulator ios simulator
gn gen out/Release "--args=is_debug=false target_os=\"ios\" ios_enable_code_signing=false target_cpu=\"x86\"" gn gen out/Release "--args=is_debug=false target_os=\"ios\" ios_enable_code_signing=false use_xcode_clang=true target_cpu=\"x86\""
gn gen out/Debug "--args=is_debug=true target_os=\"ios\" ios_enable_code_signing=false target_cpu=\"x86\"" gn gen out/Debug "--args=is_debug=true target_os=\"ios\" ios_enable_code_signing=false use_xcode_clang=true target_cpu=\"x86\""
ninja -v -C out/Debug libyuv_unittest ninja -v -C out/Debug libyuv_unittest
ninja -v -C out/Release libyuv_unittest ninja -v -C out/Release libyuv_unittest
......
...@@ -55,11 +55,12 @@ extern "C" { ...@@ -55,11 +55,12 @@ extern "C" {
#endif // clang >= 3.4 #endif // clang >= 3.4
#endif // __clang__ #endif // __clang__
// clang >= 7.0.0 required for AVX512. // clang >= 6.0.0 required for AVX512.
// TODO(fbarchard): fix xcode 9 ios b/789.
#if defined(__clang__) && (defined(__x86_64__) || defined(__i386__)) #if defined(__clang__) && (defined(__x86_64__) || defined(__i386__))
#if (__clang_major__ >= 7) #if (__clang_major__ >= 7) && !defined(__APPLE_EMBEDDED_SIMULATOR__)
#define CLANG_HAS_AVX512 1 #define CLANG_HAS_AVX512 1
#endif // clang >= 6 #endif // clang >= 7
#endif // __clang__ #endif // __clang__
// Visual C 2012 required for AVX2. // Visual C 2012 required for AVX2.
...@@ -297,6 +298,7 @@ extern "C" { ...@@ -297,6 +298,7 @@ extern "C" {
// The following are available for AVX512 clang x86 platforms: // The following are available for AVX512 clang x86 platforms:
// TODO(fbarchard): Port to GCC and Visual C // TODO(fbarchard): Port to GCC and Visual C
// TODO(fbarchard): re-enable HAS_ARGBTORGB24ROW_AVX512VBMI. Issue libyuv:789
#if !defined(LIBYUV_DISABLE_X86) && \ #if !defined(LIBYUV_DISABLE_X86) && \
(defined(__x86_64__) || (defined(__i386__) && !defined(_MSC_VER))) && \ (defined(__x86_64__) || (defined(__i386__) && !defined(_MSC_VER))) && \
(defined(CLANG_HAS_AVX512)) (defined(CLANG_HAS_AVX512))
......
...@@ -11,6 +11,6 @@ ...@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ #ifndef INCLUDE_LIBYUV_VERSION_H_
#define INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 1707 #define LIBYUV_VERSION 1708
#endif // INCLUDE_LIBYUV_VERSION_H_ #endif // INCLUDE_LIBYUV_VERSION_H_
...@@ -569,8 +569,7 @@ static const ulvec8 kPermARGBToRGB24_2 = { ...@@ -569,8 +569,7 @@ static const ulvec8 kPermARGBToRGB24_2 = {
36u, 37u, 38u, 40u, 41u, 42u, 44u, 45u, 46u, 48u, 49u, 36u, 37u, 38u, 40u, 41u, 42u, 44u, 45u, 46u, 48u, 49u,
50u, 52u, 53u, 54u, 56u, 57u, 58u, 60u, 61u, 62u}; 50u, 52u, 53u, 54u, 56u, 57u, 58u, 60u, 61u, 62u};
void __attribute__ ((__target__ ("avx512vbmi"))) void ARGBToRGB24Row_AVX512VBMI(const uint8_t* src, uint8_t* dst, int width) {
ARGBToRGB24Row_AVX512VBMI(const uint8_t* src, uint8_t* dst, int width) {
asm volatile( asm volatile(
"vmovdqa %3,%%ymm5 \n" "vmovdqa %3,%%ymm5 \n"
"vmovdqa %4,%%ymm6 \n" "vmovdqa %4,%%ymm6 \n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment