MIPS: math-emu: Reduce code duplication.
authorRalf Baechle <ralf@linux-mips.org>
Fri, 13 Jun 2014 14:36:45 +0000 (15:36 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 26 Jun 2014 09:47:55 +0000 (10:47 +0100)
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>
arch/mips/math-emu/ieee754.c

index cb9214da372fc2fce7ecff09f63e4c499cccf8e5..8e97acbbe22ceb96789d36c44b98500f9885154a 100644 (file)
  * 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   */