This is an archive of the discontinued LLVM Phabricator instance.

[libc] Exclude few unused bits from x86 state for Windows
ClosedPublic

Authored by hedingarcia on Jul 20 2021, 12:15 PM.

Details

Summary

Windows fenv_t does not include the MXCSR register and
the unused bits at the end of the x87 status. So we
exclude them in our struct definitions to make it
easy to read/write the state. getEnv and setEnv
were also excluded to avoid using MXCSR, but a
forthcoming patch will handle these functions.

Diff Detail

Event Timeline

hedingarcia created this revision.Jul 20 2021, 12:15 PM
hedingarcia requested review of this revision.Jul 20 2021, 12:15 PM
aeubanks added inline comments.Jul 20 2021, 12:17 PM
libc/utils/FPUtil/x86_64/FEnv.h
94

according to https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros, we don't need to check for _WIN64, _WIN32 is enough

we should clean this up everywhere in libc

Change macro directives to only evaluate if __WIN32 is undefined.

I think this is not correct but OK for now to unblock other work. We will revisit again when we enable fenv functions on Windows.

sivachandra accepted this revision.Jul 21 2021, 1:19 AM
This revision is now accepted and ready to land.Jul 21 2021, 1:19 AM