clang/win: Add __readfsdword to intrin.h
authorNico Weber <thakis@chromium.org>
Wed, 1 Sep 2021 20:17:19 +0000 (16:17 -0400)
committerNico Weber <thakis@chromium.org>
Thu, 2 Sep 2021 16:22:07 +0000 (12:22 -0400)
commite5438f386854136d848989315f53788808afa37a
tree6643e609178ad8e12be2c112781edf2433c04d3b
parent6eca242e09d08202380e6bfe85e129c50f788d6b
clang/win: Add __readfsdword to intrin.h

When using __readfsdword(), clang used to warn that one has
to include <intrin.h> -- no matter if that was already included
or not.

Now it only warns if it's not yet included.

To verify that this was the only intrin with this problem, I ran:

    $ for f in $(grep intrin.h clang/include/clang/Basic/BuiltinsX86* |
                 egrep -o '\([^,]+,' | egrep -o '[^(,]*'); do
        if ! grep -q $f clang/lib/Headers/intrin.h; then echo $f; fi;
      done

This printed 9 more functions, but those are all in emmintrin.h,
xsaveintrin.h (which are included by intrin.h based on /arch: flags).
So this is indeed the only built-in that was missing in intrin.h.

Fixes PR51188.

Differential Revision: https://reviews.llvm.org/D109085
clang/lib/Headers/intrin.h
clang/test/CodeGen/X86/ms-x86-intrinsics.c