[X86] Implement __readgsqword (and the rest) as builtins (PR32373)
authorHans Wennborg <hans@hanshq.net>
Wed, 22 Mar 2017 19:13:13 +0000 (19:13 +0000)
committerHans Wennborg <hans@hanshq.net>
Wed, 22 Mar 2017 19:13:13 +0000 (19:13 +0000)
commit043f40258649bab71af75472e54b9fa08bd1da51
tree5f92e49c7b0a7615c009d8bd725c0c9ecb371d19
parentdc13921fbc19bb9455a582e25bf520ab3eb1b991
[X86] Implement __readgsqword (and the rest) as builtins (PR32373)

It seems MS headers have started using __readgsqword, and since it's
used in a header that doesn't include intrin.h, we can't implement it as
an inline function anymore.

That was already the case for __readfsdword, which Saleem added support
for in r220859. This patch reuses that codegen to implement all of
__read[fg]s{byte,word,dword,qword}.

Differential Revision: https://reviews.llvm.org/D31248

llvm-svn: 298538
clang/include/clang/Basic/Builtins.def
clang/include/clang/Basic/BuiltinsX86.def
clang/lib/CodeGen/CGBuiltin.cpp
clang/lib/Headers/intrin.h
clang/test/CodeGen/ms-x86-intrinsics.c