xref: /reactos/sdk/lib/crt/float/arm/fpscr.h (revision 1734f297)
1 /*
2  * PROJECT:     ReactOS CRT library
3  * LICENSE:     MIT (https://spdx.org/licenses/MIT)
4  * PURPOSE:     Headers for ARM fpcsr
5  * COPYRIGHT:   Copyright 2021 Roman Masanin <36927roma@gmail.com>
6  */
7 
8 #include <float.h>
9 
10 #define ARM_CW_STATUS_MASK 0x9F
11 #define ARM_CW_IM          (1 << 0)      /* Invalid operation mask */
12 #define ARM_CW_ZM          (1 << 1)      /* Zero divide mask */
13 #define ARM_CW_OM          (1 << 2)      /* Overflow mask */
14 #define ARM_CW_UM          (1 << 3)      /* Underflow mask */
15 #define ARM_CW_PM          (1 << 4)      /* Precision mask */
16 #define ARM_CW_DM          (1 << 7)      /* Denormal operand mask */
17 
18 #define ARM_CW_RC_NEAREST  0  /* round to nearest */
19 #define ARM_CW_RC_UP       1  /* round up */
20 #define ARM_CW_RC_DOWN     2  /* round down */
21 #define ARM_CW_RC_ZERO     3  /* round toward zero (chop) */
22 
23 typedef union _ARM_FPSCR
24 {
25     unsigned int raw;
26     struct
27     {
28         unsigned int exception: 8;
29         unsigned int ex_control: 8;
30         unsigned int len: 3;
31         unsigned int unused3: 1;
32         unsigned int stride: 2;
33         unsigned int rounding_mode: 2;
34         unsigned int flush_to_zero: 1;
35         unsigned int unused4: 3;
36         unsigned int status_flag: 4;
37     } data;
38 } ARM_FPSCR;
39 
40 void __setfp(unsigned int);
41 unsigned int __getfp(void);
42