-
Notifications
You must be signed in to change notification settings - Fork 349
Build issues using Visual Studio (latest) #2568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi, thanks for pointing this out. Out of curiosity, what's the build error, and on which VS? FYI we will likely roll this back soon. |
Hi,The error happens in "per_target.cc" for example, line 57:HWY_DLLEXPORT int64_t DispatchedTarget() { return HWY_DYNAMIC_DISPATCH(GetTarget)(); // syntax error: missing ';' before '{'}I am using Visual Studio Community 2020, preview 6.0 (just released) on Windows 11.Greetings,AukeJan Wassenberg wrote:jan-wassenberg left a comment (google/highway#2568)
Hi, thanks for pointing this out. Out of curiosity, what's the build error, and on which VS?
FYI we will likely roll this back soon. —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
@jan-wassenberg and @anauta00 I am able to get Google Highway to compile successfully with Visual C++ 2022 (with both cl 19.43.34810 and clang-cl 19.1.1) with the fix in pull request #2571. I am also now able to get Google Highway to compile successfully with Visual C++ 2019 if the fixes in pull requests #2571 and #2572 are both applied. |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
Since this revision:
Revision: c02c0e3
Author: Highway no-reply@google.com
Date: 28/04/2025 09:37:13
Message:
Work around an LLVM inliner crash in HWY_DYNAMIC_DISPATCH(...)
LLVM may attempt to inline incompatible intrinsics (and crash) when this macro
is used. As a workaround, we add a zero-instruction inline asm blob.
PiperOrigin-RevId: 752193594
Modified: hwy/highway.h
hwy can no longer be build using Visual Studio.
The problem lies with the adjusted code in highway.h:
// We call hwy::PreventElision(...) to work around a compiler crash where the // LLVM inliner crashes due to inlining incompatible intrinsics. #define HWY_DYNAMIC_DISPATCH(FUNC_NAME) ({ \ auto p = *(HWY_DYNAMIC_POINTER(FUNC_NAME)); \ hwy::PreventElision(p); \ p; \ })
This is not understood by VS.
Gemini suggests to change it to:
namespace hwy_internal { template <typename FuncPtrType> inline FuncPtrType DynamicDispatchWrapper(FuncPtrType ptr) { PreventElision(ptr); return ptr; } } // namespace hwy_internal #define HWY_DYNAMIC_DISPATCH(FUNC_NAME) \ hwy_internal::DynamicDispatchWrapper(*(HWY_DYNAMIC_POINTER(FUNC_NAME)))
For my own use, I changed the code back to the previous line:
#define HWY_DYNAMIC_DISPATCH(FUNC_NAME) (*(HWY_DYNAMIC_POINTER(FUNC_NAME)))
but it would be nice if this incompatibility could be fixed.
Thanks and greetings,
Auke Nauta
The text was updated successfully, but these errors were encountered: