-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Open
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang:headersHeaders provided by Clang, e.g. for intrinsicsHeaders provided by Clang, e.g. for intrinsics
Description
Bugzilla Link | 49040 |
Version | unspecified |
OS | Linux |
CC | @topperc,@RKSimon,@zygoloid,@rnk |
Extended Description
$ cat bswap.cc
#include <stdint.h>
#include <intrin.h>
int32_t ByteSwap(uint32_t x) {
return _byteswap_ulong(x);
}
$ out/gn/bin/clang-cl /FA /c bswap.cc /O2 /winsysroot ~/src/chrome/src/third_party/depot_tools/win_toolchain/vs_files/782813b4eb/
$ cat bswap.asm
...
"?ByteSwap@@yahi@Z": # @"?ByteSwap@@yahi@Z"
%bb.0: # %entry
jmp _byteswap_ulong # TAILCALL
# -- End function
Compare to https://godbolt.org/z/97YjTT in MSVC.
Our clang/lib/Headers/intrin.h only has a declaration for these functions in arm64 mode for some reason. So how does this even build? => Windows Kits/10/Include/10.0.19041.0/ucrt/stdlib.h declares these too.
So I guess we should put these in intrin.h, with an inline definition?
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang:headersHeaders provided by Clang, e.g. for intrinsicsHeaders provided by Clang, e.g. for intrinsics