Skip to content

Commit

Permalink
fdct8x8_test: enable optimizations w/MSVC 17.12.3+
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jzern committed Dec 21, 2024
1 parent 6f125e9 commit 8058a0b
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions test/fdct8x8_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 8058a0b

Please sign in to comment.