_byteswap_uint64()带有clang-cl的代码不正确
如果我使用MSVC的_byteswap_uint64()与MSVC兼容的编译器clang-cl使用_byteswap_uint64(),则代码会生成对外部库函数的调用_byteswap_uint64(),该函数可以执行众所周知的掩码和移位。在MSVC的情况下,我只是获得X86 BSWAP指令,该指令从486开始就在那里,因此在这里不应有任何处理器优化级别。 Clang -Cl了解许多命令行选项MSVC也不理解-March =本机。因此,如果我有-march =天然,代码仍然是对提到函数的调用。
我通过IDE使用Clang-Cl 13(从Visual Studio Installer安装)。
有没有一种方法可以像MSVC一样获得正确的代码?
If I use the _byteswap_uint64() intrinsic of MSVC with the mostly MSVC compatible compiler clang-cl the code generates a call to the external library function _byteswap_uint64() which does the well known mask and shift orgy. Whith MSVC I simply get a x86 BSWAP instruction which is there since the 486 so there shouldn't be any processor optimization level relevant here. clang-cl understands a lot of command line options MSVC doesn't understand, even -march=native. So if I have -march=native the code is still a call to the mentioned function.
I use clang-cl 13 through the IDE (installed from the Visual Studio installer).
Is there a way to get proper code like with MSVC ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道了。只需将特定的特定内在物质与条件编译中:
clang _在Windows下的clang-cl不定义,而仅在Windows下方使用Clang ++定义,因此我必须使用_ llvm 。
I've got it. Simply use the clang specific intrinsics with conditional compilation:
clang_ isn't defined with clang-cl under Windows but only with clang++ under Windows, so I had to use _llvm.