aboutsummaryrefslogtreecommitdiff
path: root/arch/mips/math-emu
diff options
context:
space:
mode:
authorRalf Baechle2014-06-13 15:36:45 +0100
committerRalf Baechle2014-06-26 10:47:55 +0100
commitfb738f8544d8ceb3599598f3500f33bf6ff2fca4 (patch)
treea9c7299334e8b240c3619b2c285ec15c945f14d6 /arch/mips/math-emu
parent91496ea9f86f55e87be78ecc88c8a6b7e3802601 (diff)
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>
Diffstat (limited to 'arch/mips/math-emu')
-rw-r--r--arch/mips/math-emu/ieee754.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/arch/mips/math-emu/ieee754.c b/arch/mips/math-emu/ieee754.c
index cb9214da372f..8e97acbbe22c 100644
--- a/arch/mips/math-emu/ieee754.c
+++ b/arch/mips/math-emu/ieee754.c
@@ -38,15 +38,18 @@
* Older GCC requires the inner braces for initialization of union ieee754dp's
* anonymous struct member. Without an error will result.
*/
-#define DPCNST(s, b, m) \
+#define xPCNST(s, b, m, ebias) \
{ \
{ \
.sign = (s), \
- .bexp = (b) + DP_EBIAS, \
+ .bexp = (b) + ebias, \
.mant = (m) \
} \
}
+#define DPCNST(s, b, m) \
+ xPCNST(s, b, m, DP_EBIAS)
+
const union ieee754dp __ieee754dp_spcvals[] = {
DPCNST(0, DP_EMIN - 1, 0x0000000000000ULL), /* + zero */
DPCNST(1, DP_EMIN - 1, 0x0000000000000ULL), /* - zero */
@@ -67,18 +70,8 @@ const union ieee754dp __ieee754dp_spcvals[] = {
DPCNST(0, 63, 0x0000000000000ULL), /* + 1.0e63 */
};
-/*
- * Older GCC requires the inner braces for initialization of union ieee754sp's
- * anonymous struct member. Without an error will result.
- */
#define SPCNST(s, b, m) \
-{ \
- { \
- .sign = (s), \
- .bexp = (b) + SP_EBIAS, \
- .mant = (m) \
- } \
-}
+ xPCNST(s, b, m, SP_EBIAS)
const union ieee754sp __ieee754sp_spcvals[] = {
SPCNST(0, SP_EMIN - 1, 0x000000), /* + zero */