mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2026-01-01 03:12:16 +08:00
Require clang 6 for AVX512 support
row.h adds CLANG_HAS_AVX512 function ifdefs in row.h for avx512 source code ifdefed function by function for avx512 and avx2. Bug: libyuv:778 Test: LibYUVConvertTest.NV21ToRGB24_Opt Change-Id: If32b51459685d0d5785c5c1e94c8f668f8e74b55 Reviewed-on: https://chromium-review.googlesource.com/982402 Commit-Queue: Frank Barchard <fbarchard@chromium.org> Reviewed-by: richard winterton <rrwinterton@gmail.com>
This commit is contained in:
parent
c21af29ab7
commit
548ec65656
@ -1,6 +1,6 @@
|
||||
Name: libyuv
|
||||
URL: http://code.google.com/p/libyuv/
|
||||
Version: 1705
|
||||
Version: 1706
|
||||
License: BSD
|
||||
License File: LICENSE
|
||||
|
||||
|
||||
@ -55,6 +55,13 @@ extern "C" {
|
||||
#endif // clang >= 3.4
|
||||
#endif // __clang__
|
||||
|
||||
// clang >= 6.0.0 required for AVX512.
|
||||
#if defined(__clang__) && (defined(__x86_64__) || defined(__i386__))
|
||||
#if (__clang_major__ >= 6)
|
||||
#define CLANG_HAS_AVX512 1
|
||||
#endif // clang >= 6
|
||||
#endif // __clang__
|
||||
|
||||
// Visual C 2012 required for AVX2.
|
||||
#if defined(_M_IX86) && !defined(__clang__) && defined(_MSC_VER) && \
|
||||
_MSC_VER >= 1700
|
||||
@ -277,7 +284,6 @@ extern "C" {
|
||||
#define HAS_ARGBTOAR30ROW_AVX2
|
||||
#define HAS_ARGBTORAWROW_AVX2
|
||||
#define HAS_ARGBTORGB24ROW_AVX2
|
||||
#define HAS_ARGBTORGB24ROW_AVX512VBMI
|
||||
#define HAS_CONVERT16TO8ROW_AVX2
|
||||
#define HAS_CONVERT8TO16ROW_AVX2
|
||||
#define HAS_I210TOAR30ROW_AVX2
|
||||
@ -289,6 +295,14 @@ extern "C" {
|
||||
#define HAS_MULTIPLYROW_16_AVX2
|
||||
#endif
|
||||
|
||||
// The following are available for AVX512 clang x86 platforms:
|
||||
// TODO(fbarchard): Port to GCC and Visual C
|
||||
#if !defined(LIBYUV_DISABLE_X86) && \
|
||||
(defined(__x86_64__) || (defined(__i386__) && !defined(_MSC_VER))) && \
|
||||
(defined(CLANG_HAS_AVX512))
|
||||
#define HAS_ARGBTORGB24ROW_AVX512VBMI
|
||||
#endif
|
||||
|
||||
// The following are available on Neon platforms:
|
||||
#if !defined(LIBYUV_DISABLE_NEON) && \
|
||||
(defined(__aarch64__) || defined(__ARM_NEON__) || defined(LIBYUV_NEON))
|
||||
|
||||
@ -11,6 +11,6 @@
|
||||
#ifndef INCLUDE_LIBYUV_VERSION_H_
|
||||
#define INCLUDE_LIBYUV_VERSION_H_
|
||||
|
||||
#define LIBYUV_VERSION 1705
|
||||
#define LIBYUV_VERSION 1706
|
||||
|
||||
#endif // INCLUDE_LIBYUV_VERSION_H_
|
||||
|
||||
@ -505,6 +505,7 @@ void ARGBToRAWRow_SSSE3(const uint8_t* src, uint8_t* dst, int width) {
|
||||
: "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6");
|
||||
}
|
||||
|
||||
#ifdef HAS_ARGBTORGB24ROW_AVX2
|
||||
// vpermd for 12+12 to 24
|
||||
static const lvec32 kPermdRGB24_AVX = {0, 1, 2, 4, 5, 6, 3, 7};
|
||||
|
||||
@ -551,9 +552,9 @@ void ARGBToRGB24Row_AVX2(const uint8_t* src, uint8_t* dst, int width) {
|
||||
: "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6",
|
||||
"xmm7");
|
||||
}
|
||||
#endif
|
||||
|
||||
// TODO(fbarchard): Detect compiler can di avx512 and add ifdefs
|
||||
|
||||
#ifdef HAS_ARGBTORGB24ROW_AVX512VBMI
|
||||
// Shuffle table for converting ARGBToRGB24
|
||||
static const ulvec8 kPermARGBToRGB24_0 = {
|
||||
0u, 1u, 2u, 4u, 5u, 6u, 8u, 9u, 10u, 12u, 13u,
|
||||
@ -599,7 +600,9 @@ void ARGBToRGB24Row_AVX512VBMI(const uint8_t* src, uint8_t* dst, int width) {
|
||||
"m"(kPermARGBToRGB24_2) // %5
|
||||
: "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm5", "xmm6", "xmm7");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAS_ARGBTORAWROW_AVX2
|
||||
void ARGBToRAWRow_AVX2(const uint8_t* src, uint8_t* dst, int width) {
|
||||
asm volatile(
|
||||
"vbroadcastf128 %3,%%ymm6 \n"
|
||||
@ -643,6 +646,7 @@ void ARGBToRAWRow_AVX2(const uint8_t* src, uint8_t* dst, int width) {
|
||||
: "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6",
|
||||
"xmm7");
|
||||
}
|
||||
#endif
|
||||
|
||||
void ARGBToRGB565Row_SSE2(const uint8_t* src, uint8_t* dst, int width) {
|
||||
asm volatile(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user