@@ -22,7 +22,8 @@ typedef uint32_t src_rep_t;
22
22
static const int srcBits = sizeof (src_t ) * CHAR_BIT ;
23
23
static const int srcSigFracBits = 23 ;
24
24
// -1 accounts for the sign bit.
25
- static const int srcExpBits = srcBits - srcSigFracBits - 1 ;
25
+ // srcBits - srcSigFracBits - 1
26
+ static const int srcExpBits = 8 ;
26
27
27
28
#elif defined SRC_DOUBLE
28
29
typedef double src_t ;
@@ -31,7 +32,8 @@ typedef uint64_t src_rep_t;
31
32
static const int srcBits = sizeof (src_t ) * CHAR_BIT ;
32
33
static const int srcSigFracBits = 52 ;
33
34
// -1 accounts for the sign bit.
34
- static const int srcExpBits = srcBits - srcSigFracBits - 1 ;
35
+ // srcBits - srcSigFracBits - 1
36
+ static const int srcExpBits = 11 ;
35
37
36
38
#elif defined SRC_QUAD
37
39
// TODO: use fp_lib.h once QUAD_PRECISION is available on x86_64.
@@ -46,7 +48,8 @@ typedef __uint128_t src_rep_t;
46
48
static const int srcBits = sizeof (src_t ) * CHAR_BIT ;
47
49
static const int srcSigFracBits = 112 ;
48
50
// -1 accounts for the sign bit.
49
- static const int srcExpBits = srcBits - srcSigFracBits - 1 ;
51
+ // srcBits - srcSigFracBits - 1
52
+ static const int srcExpBits = 15 ;
50
53
51
54
#else
52
55
#error Source should be double precision or quad precision!
@@ -59,7 +62,8 @@ typedef uint64_t dst_rep_t;
59
62
static const int dstBits = sizeof (dst_t ) * CHAR_BIT ;
60
63
static const int dstSigFracBits = 52 ;
61
64
// -1 accounts for the sign bit.
62
- static const int dstExpBits = dstBits - dstSigFracBits - 1 ;
65
+ // dstBits - dstSigFracBits - 1
66
+ static const int dstExpBits = 11 ;
63
67
64
68
#elif defined DST_80
65
69
typedef long double dst_t ;
@@ -69,7 +73,8 @@ static const int dstBits = 80;
69
73
static const int dstSigFracBits = 63 ;
70
74
// -1 accounts for the sign bit.
71
75
// -1 accounts for the explicitly stored integer bit.
72
- static const int dstExpBits = dstBits - dstSigFracBits - 1 - 1 ;
76
+ // dstBits - dstSigFracBits - 1 - 1
77
+ static const int dstExpBits = 15 ;
73
78
74
79
#elif defined DST_SINGLE
75
80
typedef float dst_t ;
@@ -78,7 +83,8 @@ typedef uint32_t dst_rep_t;
78
83
static const int dstBits = sizeof (dst_t ) * CHAR_BIT ;
79
84
static const int dstSigFracBits = 23 ;
80
85
// -1 accounts for the sign bit.
81
- static const int dstExpBits = dstBits - dstSigFracBits - 1 ;
86
+ // dstBits - dstSigFracBits - 1
87
+ static const int dstExpBits = 8 ;
82
88
83
89
#elif defined DST_HALF
84
90
#ifdef COMPILER_RT_HAS_FLOAT16
@@ -91,7 +97,8 @@ typedef uint16_t dst_rep_t;
91
97
static const int dstBits = sizeof (dst_t ) * CHAR_BIT ;
92
98
static const int dstSigFracBits = 10 ;
93
99
// -1 accounts for the sign bit.
94
- static const int dstExpBits = dstBits - dstSigFracBits - 1 ;
100
+ // dstBits - dstSigFracBits - 1
101
+ static const int dstExpBits = 5 ;
95
102
96
103
#elif defined DST_BFLOAT
97
104
typedef __bf16 dst_t ;
@@ -100,7 +107,8 @@ typedef uint16_t dst_rep_t;
100
107
static const int dstBits = sizeof (dst_t ) * CHAR_BIT ;
101
108
static const int dstSigFracBits = 7 ;
102
109
// -1 accounts for the sign bit.
103
- static const int dstExpBits = dstBits - dstSigFracBits - 1 ;
110
+ // dstBits - dstSigFracBits - 1
111
+ static const int dstExpBits = 8 ;
104
112
105
113
#else
106
114
#error Destination should be single precision or double precision!
0 commit comments