- Notifications
You must be signed in to change notification settings - Fork 31.7k
/
Copy pathpymath.c
19 lines (16 loc) · 478 Bytes
/
pymath.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include"Python.h"
#ifdefHAVE_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 shortcw;
__asm__ __volatile__ ("fnstcw %0" : "=m" (cw));
returncw;
}
void_Py_set_387controlword(unsigned shortcw) {
__asm__ __volatile__ ("fldcw %0" : : "m" (cw));
}
#endif// HAVE_GCC_ASM_FOR_X87