Commit 0875f85d by Jamie Madill

Don't use SSE functions on Android.

These methods are unavailable on ARM platforms. Also fix a sequencing bug that caused us to incorrectly define the Android platform as Linux. BUG=angle:773 Change-Id: Id2b47acdd5b574c618ac86641a1a8238fbb4a2c3 Reviewed-on: https://chromium-review.googlesource.com/240095Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent ce4c0001
...@@ -14,12 +14,12 @@ ...@@ -14,12 +14,12 @@
#elif defined(__APPLE__) #elif defined(__APPLE__)
# define ANGLE_PLATFORM_APPLE 1 # define ANGLE_PLATFORM_APPLE 1
# define ANGLE_PLATFORM_POSIX 1 # define ANGLE_PLATFORM_POSIX 1
#elif defined(__linux__) || defined(EMSCRIPTEN)
# define ANGLE_PLATFORM_LINUX 1
# define ANGLE_PLATFORM_POSIX 1
#elif defined(ANDROID) #elif defined(ANDROID)
# define ANGLE_PLATFORM_ANDROID 1 # define ANGLE_PLATFORM_ANDROID 1
# define ANGLE_PLATFORM_POSIX 1 # define ANGLE_PLATFORM_POSIX 1
#elif defined(__linux__) || defined(EMSCRIPTEN)
# define ANGLE_PLATFORM_LINUX 1
# define ANGLE_PLATFORM_POSIX 1
#elif defined(__FreeBSD__) || \ #elif defined(__FreeBSD__) || \
defined(__OpenBSD__) || \ defined(__OpenBSD__) || \
defined(__NetBSD__) || \ defined(__NetBSD__) || \
...@@ -78,7 +78,11 @@ ...@@ -78,7 +78,11 @@
#ifdef ANGLE_PLATFORM_APPLE #ifdef ANGLE_PLATFORM_APPLE
// TODO(jmadill): other OSX-specific includes // TODO(jmadill): other OSX-specific includes
#include <x86intrin.h> # include <x86intrin.h>
#endif
#if !defined(ANGLE_PLATFORM_WINDOWS_STORE) && !defined(ANGLE_PLATFORM_ANDROID)
# define ANGLE_USE_SSE
#endif #endif
#endif // COMMON_PLATFORM_H_ #endif // COMMON_PLATFORM_H_
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#include "libANGLE/renderer/loadimage.h" #include "libANGLE/renderer/loadimage.h"
#include "common/platform.h"
namespace rx namespace rx
{ {
...@@ -17,12 +19,7 @@ void LoadA8ToBGRA8_SSE2(size_t width, size_t height, size_t depth, ...@@ -17,12 +19,7 @@ void LoadA8ToBGRA8_SSE2(size_t width, size_t height, size_t depth,
const uint8_t *input, size_t inputRowPitch, size_t inputDepthPitch, const uint8_t *input, size_t inputRowPitch, size_t inputDepthPitch,
uint8_t *output, size_t outputRowPitch, size_t outputDepthPitch) uint8_t *output, size_t outputRowPitch, size_t outputDepthPitch)
{ {
#if defined(_M_ARM) #if defined(ANGLE_USE_SSE)
// Ensure that this function is reported as not implemented for ARM builds because
// the instructions below are not present for that architecture.
UNIMPLEMENTED();
return;
#else
__m128i zeroWide = _mm_setzero_si128(); __m128i zeroWide = _mm_setzero_si128();
for (size_t z = 0; z < depth; z++) for (size_t z = 0; z < depth; z++)
...@@ -60,6 +57,11 @@ void LoadA8ToBGRA8_SSE2(size_t width, size_t height, size_t depth, ...@@ -60,6 +57,11 @@ void LoadA8ToBGRA8_SSE2(size_t width, size_t height, size_t depth,
} }
} }
} }
#else
// Ensure that this function is reported as not implemented for ARM builds because
// the instructions below are not present for that architecture.
UNIMPLEMENTED();
return;
#endif #endif
} }
...@@ -67,12 +69,7 @@ void LoadRGBA8ToBGRA8_SSE2(size_t width, size_t height, size_t depth, ...@@ -67,12 +69,7 @@ void LoadRGBA8ToBGRA8_SSE2(size_t width, size_t height, size_t depth,
const uint8_t *input, size_t inputRowPitch, size_t inputDepthPitch, const uint8_t *input, size_t inputRowPitch, size_t inputDepthPitch,
uint8_t *output, size_t outputRowPitch, size_t outputDepthPitch) uint8_t *output, size_t outputRowPitch, size_t outputDepthPitch)
{ {
#if defined(_M_ARM) #if defined(ANGLE_USE_SSE)
// Ensure that this function is reported as not implemented for ARM builds because
// the instructions below are not present for that architecture.
UNIMPLEMENTED();
return;
#else
__m128i brMask = _mm_set1_epi32(0x00ff00ff); __m128i brMask = _mm_set1_epi32(0x00ff00ff);
for (size_t z = 0; z < depth; z++) for (size_t z = 0; z < depth; z++)
...@@ -112,7 +109,13 @@ void LoadRGBA8ToBGRA8_SSE2(size_t width, size_t height, size_t depth, ...@@ -112,7 +109,13 @@ void LoadRGBA8ToBGRA8_SSE2(size_t width, size_t height, size_t depth,
} }
} }
} }
#else
// Ensure that this function is reported as not implemented for ARM builds because
// the instructions below are not present for that architecture.
UNIMPLEMENTED();
return;
#endif #endif
} }
} }
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