From abe523d0a58985348ebe70076924727e091e4303 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Wed, 11 May 2022 02:26:25 +0000 Subject: [PATCH] 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 Change-Id: Ie2c1023d2c1d041ba1d140f06af432ed9e9f7432 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262002 Commit-Queue: Alexander Cooper Reviewed-by: Mark Foltz Cr-Commit-Position: refs/heads/main@{#36856} --- AUTHORS | 1 + modules/desktop_capture/differ_block.cc | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/AUTHORS b/AUTHORS index 393c1e1005..68653f4e0d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -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> diff --git a/modules/desktop_capture/differ_block.cc b/modules/desktop_capture/differ_block.cc index 4f0c5430c9..54ee0829ea 100644 --- a/modules/desktop_capture/differ_block.cc +++ b/modules/desktop_capture/differ_block.cc @@ -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 }