This is an archive of the discontinued LLVM Phabricator instance.

clang/win: Add __readfsdword to intrin.h
ClosedPublic

Authored by thakis on Sep 1 2021, 1:22 PM.

Details

Summary

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.

Diff Detail

Event Timeline

thakis created this revision.Sep 1 2021, 1:22 PM
thakis requested review of this revision.Sep 1 2021, 1:22 PM
thakis updated this revision to Diff 370041.Sep 1 2021, 1:25 PM

no-op rebase in the hope that the precommit bot doesn't run in a "git lockfile already held" error again

hans accepted this revision.Sep 2 2021, 7:06 AM

lgtm

This revision is now accepted and ready to land.Sep 2 2021, 7:06 AM
This revision was landed with ongoing or failed builds.Sep 2 2021, 9:22 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 2 2021, 9:22 AM