summaryrefslogtreecommitdiff
path: root/testsuite/tests/rts/T7289/fp.c
blob: 12f1b3925bd763f5c5cb5a0e170d4f9b0bc5e130 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <stdio.h>
#include <xmmintrin.h>
#include <float.h>

static unsigned int
getFPUStateX86 (void)
{
    unsigned int control = 0;
#if defined(_MSC_VER)
    control = _controlfp(0, 0);
#else
    __asm__ __volatile__("fnstcw %0" : "=m" (control));
#endif
    return control;
}

static unsigned int
getSSEStateX86 (void)
{
    return _mm_getcsr();
}

extern void showControlBits (void)
{
    printf("FPU: 0x%04x\n", getFPUStateX86());
}