Bug 1516062 - Turn on NEON when using gcc or clang on aarch64 r=jrmuizel

Since we don't define BUILD_ARM_NEON on aarch64 due to bug 1303952, aarch64
doesn't turn on neon for moz2d.

Also, msvc don't have arm_neon.h [*1], so we should turn on neon on aarch64
excepting msvc.

*1 https://developercommunity.visualstudio.com/content/problem/201662/arm-neonh-doenst-support-arm64-compiler.html

Differential Revision: https://phabricator.services.mozilla.com/D15371

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Makoto Kato 2018-12-26 16:27:08 +00:00
Родитель 220a9b83b3
Коммит 2fe6d4569a
5 изменённых файлов: 12 добавлений и 12 удалений

Просмотреть файл

@ -16,7 +16,7 @@
#include "DataSurfaceHelpers.h"
#include "Tools.h"
#ifdef BUILD_ARM_NEON
#ifdef USE_NEON
#include "mozilla/arm.h"
#endif
@ -660,7 +660,7 @@ void AlphaBoxBlur::Blur(uint8_t* aData) const {
integralImageStride);
} else
#endif
#ifdef BUILD_ARM_NEON
#ifdef USE_NEON
if (mozilla::supports_neon()) {
BoxBlur_NEON(aData, horizontalLobes[0][0], horizontalLobes[0][1],
verticalLobes[0][0], verticalLobes[0][1], integralImage,

Просмотреть файл

@ -135,12 +135,10 @@ class GFX2D_API AlphaBoxBlur {
int32_t aTopLobe, int32_t aBottomLobe,
uint32_t* aIntegralImage,
size_t aIntegralImageStride) const;
#ifdef BUILD_ARM_NEON
void BoxBlur_NEON(uint8_t* aData, int32_t aLeftLobe, int32_t aRightLobe,
int32_t aTopLobe, int32_t aBottomLobe,
uint32_t* aIntegralImage,
size_t aIntegralImageStride) const;
#endif
#ifdef _MIPS_ARCH_LOONGSON3A
void BoxBlur_LS3(uint8_t* aData, int32_t aLeftLobe, int32_t aRightLobe,
int32_t aTopLobe, int32_t aBottomLobe,

Просмотреть файл

@ -14,7 +14,7 @@
#include "BufferEdgePad.h"
#include "BufferUnrotate.h"
#ifdef BUILD_ARM_NEON
#ifdef USE_NEON
#include "mozilla/arm.h"
#include "LuminanceNEON.h"
#endif
@ -63,7 +63,7 @@ static void ComputesRGBLuminanceMask(const uint8_t* aSourceData,
int32_t aSourceStride, uint8_t* aDestData,
int32_t aDestStride, const IntSize& aSize,
float aOpacity) {
#ifdef BUILD_ARM_NEON
#ifdef USE_NEON
if (mozilla::supports_neon()) {
ComputesRGBLuminanceMask_NEON(aSourceData, aSourceStride, aDestData,
aDestStride, aSize, aOpacity);

Просмотреть файл

@ -14,7 +14,7 @@
#include "mozilla/SSE.h"
#endif
#ifdef BUILD_ARM_NEON
#ifdef USE_NEON
#include "mozilla/arm.h"
#endif
@ -131,7 +131,7 @@ void Swizzle_SSE2(const uint8_t*, int32_t, uint8_t*, int32_t, IntSize);
#endif
#ifdef BUILD_ARM_NEON
#ifdef USE_NEON
/**
* ARM NEON optimizations
*/
@ -294,7 +294,7 @@ bool PremultiplyData(const uint8_t* aSrc, int32_t aSrcStride,
}
#endif
#ifdef BUILD_ARM_NEON
#ifdef USE_NEON
if (mozilla::supports_neon()) switch (FORMAT_KEY(aSrcFormat, aDstFormat)) {
PREMULTIPLY_NEON(SurfaceFormat::B8G8R8A8, SurfaceFormat::B8G8R8A8)
PREMULTIPLY_NEON(SurfaceFormat::B8G8R8A8, SurfaceFormat::B8G8R8X8)
@ -426,7 +426,7 @@ bool UnpremultiplyData(const uint8_t* aSrc, int32_t aSrcStride,
}
#endif
#ifdef BUILD_ARM_NEON
#ifdef USE_NEON
if (mozilla::supports_neon()) switch (FORMAT_KEY(aSrcFormat, aDstFormat)) {
UNPREMULTIPLY_NEON(SurfaceFormat::B8G8R8A8, SurfaceFormat::B8G8R8A8)
UNPREMULTIPLY_NEON(SurfaceFormat::B8G8R8A8, SurfaceFormat::R8G8B8A8)
@ -710,7 +710,7 @@ bool SwizzleData(const uint8_t* aSrc, int32_t aSrcStride,
}
#endif
#ifdef BUILD_ARM_NEON
#ifdef USE_NEON
if (mozilla::supports_neon()) switch (FORMAT_KEY(aSrcFormat, aDstFormat)) {
SWIZZLE_NEON(SurfaceFormat::B8G8R8A8, SurfaceFormat::R8G8B8A8)
SWIZZLE_NEON(SurfaceFormat::B8G8R8X8, SurfaceFormat::R8G8B8X8)

Просмотреть файл

@ -221,12 +221,14 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
'QuartzSupport.mm',
]
if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['BUILD_ARM_NEON']:
if CONFIG['CC_TYPE'] in ('clang', 'gcc') and (CONFIG['CPU_ARCH'] == 'aarch64' or CONFIG['BUILD_ARM_NEON']):
# MSVC cannot use arm_neon.h.
SOURCES += [
'BlurNEON.cpp',
'LuminanceNEON.cpp',
'SwizzleNEON.cpp',
]
DEFINES['USE_NEON'] = True
SOURCES['BlurNEON.cpp'].flags += CONFIG['NEON_FLAGS']
SOURCES['LuminanceNEON.cpp'].flags += CONFIG['NEON_FLAGS']
SOURCES['SwizzleNEON.cpp'].flags += CONFIG['NEON_FLAGS']