Skip to content

Commit fb738f8

Browse files
committed
MIPS: math-emu: Reduce code duplication.
The fix in the preceeding commit did do exactly the same thing in two places showing some code cleanup was due. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent 91496ea commit fb738f8

1 file changed

Lines changed: 6 additions & 13 deletions

File tree

‎arch/mips/math-emu/ieee754.c‎

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,18 @@
3838
* Older GCC requires the inner braces for initialization of union ieee754dp's
3939
* anonymous struct member. Without an error will result.
4040
*/
41-
#define DPCNST(s, b, m) \
41+
#define xPCNST(s, b, m, ebias) \
4242
{ \
4343
{ \
4444
.sign = (s), \
45-
.bexp = (b) + DP_EBIAS, \
45+
.bexp = (b) + ebias, \
4646
.mant = (m) \
4747
} \
4848
}
4949

50+
#define DPCNST(s, b, m) \
51+
xPCNST(s, b, m, DP_EBIAS)
52+
5053
const union ieee754dp __ieee754dp_spcvals[] = {
5154
DPCNST(0, DP_EMIN - 1, 0x0000000000000ULL), /* + zero */
5255
DPCNST(1, DP_EMIN - 1, 0x0000000000000ULL), /* - zero */
@@ -67,18 +70,8 @@ const union ieee754dp __ieee754dp_spcvals[] = {
6770
DPCNST(0, 63, 0x0000000000000ULL), /* + 1.0e63 */
6871
};
6972

70-
/*
71-
* Older GCC requires the inner braces for initialization of union ieee754sp's
72-
* anonymous struct member. Without an error will result.
73-
*/
7473
#define SPCNST(s, b, m) \
75-
{ \
76-
{ \
77-
.sign = (s), \
78-
.bexp = (b) + SP_EBIAS, \
79-
.mant = (m) \
80-
} \
81-
}
74+
xPCNST(s, b, m, SP_EBIAS)
8275

8376
const union ieee754sp __ieee754sp_spcvals[] = {
8477
SPCNST(0, SP_EMIN - 1, 0x000000), /* + zero */

0 commit comments

Comments
 (0)