This source file includes following definitions.
- fld_const
- fld1
- fldl2t
- fldl2e
- fldpi
- fldlg2
- fldln2
- fldz
- fconst
1
2
3
4
5
6
7
8
9
10
11
12
13 #include "fpu_system.h"
14 #include "fpu_emu.h"
15 #include "status_w.h"
16 #include "reg_constant.h"
17
18
19 FPU_REG const CONST_1 = { SIGN_POS, TW_Valid, EXP_BIAS,
20 0x00000000, 0x80000000 };
21 FPU_REG const CONST_2 = { SIGN_POS, TW_Valid, EXP_BIAS+1,
22 0x00000000, 0x80000000 };
23 FPU_REG const CONST_HALF = { SIGN_POS, TW_Valid, EXP_BIAS-1,
24 0x00000000, 0x80000000 };
25 FPU_REG const CONST_L2T = { SIGN_POS, TW_Valid, EXP_BIAS+1,
26 0xcd1b8afe, 0xd49a784b };
27 FPU_REG const CONST_L2E = { SIGN_POS, TW_Valid, EXP_BIAS,
28 0x5c17f0bc, 0xb8aa3b29 };
29 FPU_REG const CONST_PI = { SIGN_POS, TW_Valid, EXP_BIAS+1,
30 0x2168c235, 0xc90fdaa2 };
31 FPU_REG const CONST_PI2 = { SIGN_POS, TW_Valid, EXP_BIAS,
32 0x2168c235, 0xc90fdaa2 };
33 FPU_REG const CONST_PI4 = { SIGN_POS, TW_Valid, EXP_BIAS-1,
34 0x2168c235, 0xc90fdaa2 };
35 FPU_REG const CONST_LG2 = { SIGN_POS, TW_Valid, EXP_BIAS-2,
36 0xfbcff799, 0x9a209a84 };
37 FPU_REG const CONST_LN2 = { SIGN_POS, TW_Valid, EXP_BIAS-1,
38 0xd1cf79ac, 0xb17217f7 };
39
40
41 FPU_REG const CONST_PI2extra = { SIGN_NEG, TW_Valid, EXP_BIAS-66,
42 0xfc8f8cbb, 0xece675d1 };
43
44
45 FPU_REG const CONST_Z = { SIGN_POS, TW_Zero, EXP_UNDER, 0x0, 0x0 };
46
47
48
49
50
51
52 FPU_REG const CONST_QNaN = { SIGN_NEG, TW_NaN, EXP_OVER, 0x00000000, 0xC0000000 };
53
54
55 FPU_REG const CONST_INF = { SIGN_POS, TW_Infinity, EXP_OVER, 0x00000000, 0x80000000 };
56
57
58
59 static void fld_const(FPU_REG const *c)
60 {
61 FPU_REG *st_new_ptr;
62
63 if ( STACK_OVERFLOW )
64 {
65 stack_overflow();
66 return;
67 }
68 push();
69 reg_move(c, FPU_st0_ptr);
70 clear_C1();
71 }
72
73
74 static void fld1(void)
75 {
76 fld_const(&CONST_1);
77 }
78
79 static void fldl2t(void)
80 {
81 fld_const(&CONST_L2T);
82 }
83
84 static void fldl2e(void)
85 {
86 fld_const(&CONST_L2E);
87 }
88
89 static void fldpi(void)
90 {
91 fld_const(&CONST_PI);
92 }
93
94 static void fldlg2(void)
95 {
96 fld_const(&CONST_LG2);
97 }
98
99 static void fldln2(void)
100 {
101 fld_const(&CONST_LN2);
102 }
103
104 static void fldz(void)
105 {
106 fld_const(&CONST_Z);
107 }
108
109 static FUNC constants_table[] = {
110 fld1, fldl2t, fldl2e, fldpi, fldlg2, fldln2, fldz, Un_impl
111 };
112
113 void fconst(void)
114 {
115 (constants_table[FPU_rm])();
116 }