Permalink
Cannot retrieve contributors at this time
19 lines (16 sloc)
478 Bytes
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
cpython/Python/pymath.c
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "Python.h" | |
| #ifdef HAVE_GCC_ASM_FOR_X87 | |
| // Inline assembly for getting and setting the 387 FPU control word on | |
| // GCC/x86. | |
| #ifdef _Py_MEMORY_SANITIZER | |
| __attribute__((no_sanitize_memory)) | |
| #endif | |
| unsigned short _Py_get_387controlword(void) { | |
| unsigned short cw; | |
| __asm__ __volatile__ ("fnstcw %0" : "=m" (cw)); | |
| return cw; | |
| } | |
| void _Py_set_387controlword(unsigned short cw) { | |
| __asm__ __volatile__ ("fldcw %0" : : "m" (cw)); | |
| } | |
| #endif // HAVE_GCC_ASM_FOR_X87 |