Switch SSE2 architecture check to x86 platforms only

This allows builds on non-x86 architectures such
as ppc64el.

Bug: webrtc:14057
Signed-off-by: Timothy Pearson <tpearson@raptorcs.com>
Change-Id: Ie2c1023d2c1d041ba1d140f06af432ed9e9f7432
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262002
Commit-Queue: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: Mark Foltz <mfoltz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#36856}
This commit is contained in:
Timothy Pearson 2022-05-11 02:26:25 +00:00 committed by WebRTC LUCI CQ
parent 7555ac5316
commit abe523d0a5
2 changed files with 6 additions and 5 deletions

View File

@ -148,6 +148,7 @@ NVIDIA Corporation <*@nvidia.com>
Opera Software ASA <*@opera.com>
Optical Tone Ltd <*@opticaltone.com>
Pengutronix e.K. <*@pengutronix.de>
Raptor Computing Systems, LLC <*@raptorcs.com>
RingCentral, Inc. <*@ringcentral.com>
Signal Messenger, LLC <*@signal.org>
Sinch AB <*@sinch.com>

View File

@ -30,11 +30,7 @@ bool VectorDifference(const uint8_t* image1, const uint8_t* image2) {
static bool (*diff_proc)(const uint8_t*, const uint8_t*) = nullptr;
if (!diff_proc) {
#if defined(WEBRTC_ARCH_ARM_FAMILY) || defined(WEBRTC_ARCH_MIPS_FAMILY)
// For ARM and MIPS processors, always use C version.
// TODO(hclam): Implement a NEON version.
diff_proc = &VectorDifference_C;
#else
#if defined(WEBRTC_ARCH_X86_FAMILY)
bool have_sse2 = GetCPUInfo(kSSE2) != 0;
// For x86 processors, check if SSE2 is supported.
if (have_sse2 && kBlockSize == 32) {
@ -44,6 +40,10 @@ bool VectorDifference(const uint8_t* image1, const uint8_t* image2) {
} else {
diff_proc = &VectorDifference_C;
}
#else
// For other processors, always use C version.
// TODO(hclam): Implement a NEON version.
diff_proc = &VectorDifference_C;
#endif
}