1
2
3
4
5
6
7
8
9
10
11
12
13
14 #include <linux/compiler.h>
15
16 #include "ieee754.h"
17 #include "ieee754sp.h"
18 #include "ieee754dp.h"
19
20
21
22
23
24
25
26
27
28 #define xPCNST(s, b, m, ebias) \
29 { \
30 { \
31 .sign = (s), \
32 .bexp = (b) + ebias, \
33 .mant = (m) \
34 } \
35 }
36
37 #define DPCNST(s, b, m) \
38 xPCNST(s, b, m, DP_EBIAS)
39
40 const union ieee754dp __ieee754dp_spcvals[] = {
41 DPCNST(0, DP_EMIN - 1, 0x0000000000000ULL),
42 DPCNST(1, DP_EMIN - 1, 0x0000000000000ULL),
43 DPCNST(0, 0, 0x0000000000000ULL),
44 DPCNST(1, 0, 0x0000000000000ULL),
45 DPCNST(0, 3, 0x4000000000000ULL),
46 DPCNST(1, 3, 0x4000000000000ULL),
47 DPCNST(0, DP_EMAX + 1, 0x0000000000000ULL),
48 DPCNST(1, DP_EMAX + 1, 0x0000000000000ULL),
49 DPCNST(0, DP_EMAX + 1, 0x7FFFFFFFFFFFFULL),
50 DPCNST(0, DP_EMAX + 1, 0x8000000000000ULL),
51 DPCNST(0, DP_EMAX, 0xFFFFFFFFFFFFFULL),
52 DPCNST(1, DP_EMAX, 0xFFFFFFFFFFFFFULL),
53 DPCNST(0, DP_EMIN, 0x0000000000000ULL),
54 DPCNST(1, DP_EMIN, 0x0000000000000ULL),
55 DPCNST(0, DP_EMIN - 1, 0x0000000000001ULL),
56 DPCNST(1, DP_EMIN - 1, 0x0000000000001ULL),
57 DPCNST(0, 31, 0x0000000000000ULL),
58 DPCNST(0, 63, 0x0000000000000ULL),
59 };
60
61 #define SPCNST(s, b, m) \
62 xPCNST(s, b, m, SP_EBIAS)
63
64 const union ieee754sp __ieee754sp_spcvals[] = {
65 SPCNST(0, SP_EMIN - 1, 0x000000),
66 SPCNST(1, SP_EMIN - 1, 0x000000),
67 SPCNST(0, 0, 0x000000),
68 SPCNST(1, 0, 0x000000),
69 SPCNST(0, 3, 0x200000),
70 SPCNST(1, 3, 0x200000),
71 SPCNST(0, SP_EMAX + 1, 0x000000),
72 SPCNST(1, SP_EMAX + 1, 0x000000),
73 SPCNST(0, SP_EMAX + 1, 0x3FFFFF),
74 SPCNST(0, SP_EMAX + 1, 0x400000),
75 SPCNST(0, SP_EMAX, 0x7FFFFF),
76 SPCNST(1, SP_EMAX, 0x7FFFFF),
77 SPCNST(0, SP_EMIN, 0x000000),
78 SPCNST(1, SP_EMIN, 0x000000),
79 SPCNST(0, SP_EMIN - 1, 0x000001),
80 SPCNST(1, SP_EMIN - 1, 0x000001),
81 SPCNST(0, 31, 0x000000),
82 SPCNST(0, 63, 0x000000),
83 };