https://github.com/python/cpython
Revision e6c0efa25a47488f400093fc556c03e83567aed8 authored by Thomas Wouters on 06 June 2023, 14:12:06 UTC, committed by Thomas Wouters on 06 June 2023, 14:16:21 UTC
1 parent 2d9ead2
Raw File
Tip revision: e6c0efa25a47488f400093fc556c03e83567aed8 authored by Thomas Wouters on 06 June 2023, 14:12:06 UTC
Python 3.12.0b2
Tip revision: e6c0efa
pymath.c
#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
back to top