From 8058a0b54991257a0e1a2fcf08d993a8b70c1d3a Mon Sep 17 00:00:00 2001 From: James Zern Date: Fri, 20 Dec 2024 15:09:20 -0800 Subject: [PATCH] fdct8x8_test: enable optimizations w/MSVC 17.12.3+ The misoptimization issue was marked fixed as of 17.12.3. This particular issue may have been hidden / fixed in a slightly earlier version, as it didn't reproduce in 17.11.x, but to be safe we'll target the official version: https://developercommunity.visualstudio.com/t/1770-preview-1:-Misoptimization-for-AR/10369786 Change-Id: I2edabe3f4ac3666ac14d6d20c0cd20904d3c824f --- test/fdct8x8_test.cc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/test/fdct8x8_test.cc b/test/fdct8x8_test.cc index d8778f98743..7eeba71e444 100644 --- a/test/fdct8x8_test.cc +++ b/test/fdct8x8_test.cc @@ -133,13 +133,16 @@ void idct8x8_64_add_12_sse2(const tran_low_t *in, uint8_t *out, int stride) { #endif // HAVE_SSE2 #endif // CONFIG_VP9_HIGHBITDEPTH -// Visual Studio 2022 (cl.exe) targeting AArch64 with optimizations enabled -// produces invalid code in RunExtremalCheck() and RunInvAccuracyCheck(). -// See: +// Visual Studio 2022 < 17.12.3 (cl.exe) targeting AArch64 with optimizations +// enabled produces invalid code in RunExtremalCheck() and +// RunInvAccuracyCheck(). See: // https://developercommunity.visualstudio.com/t/1770-preview-1:-Misoptimization-for-AR/10369786 -// TODO(jzern): check the compiler version after a fix for the issue is -// released. -#if defined(_MSC_VER) && defined(_M_ARM64) && !defined(__clang__) +#if defined(_MSC_FULL_VER) && _MSC_FULL_VER < 194234435 && \ + defined(_M_ARM64) && !defined(__clang__) +#define AOM_WORK_AROUND_MSVC_BUG_10369786 +#endif + +#ifdef AOM_WORK_AROUND_MSVC_BUG_10369786 #pragma optimize("", off) #endif class FwdTrans8x8TestBase { @@ -533,7 +536,7 @@ class FwdTrans8x8TestBase { vpx_bit_depth_t bit_depth_; int mask_; }; -#if defined(_MSC_VER) && defined(_M_ARM64) && !defined(__clang__) +#ifdef AOM_WORK_AROUND_MSVC_BUG_10369786 #pragma optimize("", on) #endif