MIPS: math-emu: Avoid definition duplication for macro DPXMULT()
authorAleksandar Markovic <aleksandar.markovic@mips.com>
Thu, 2 Nov 2017 11:14:01 +0000 (12:14 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 12 Dec 2017 16:20:19 +0000 (17:20 +0100)
Avoid duplicate definition of macro DPXMULT(). Move its definition
to a header.

Signed-off-by: Aleksandar Markovic <aleksandar.markovic@mips.com>
Cc: Douglas Leung <douglas.leung@mips.com>
Cc: Goran Ferenc <goran.ferenc@mips.com>
Cc: James Hogan <james.hogan@mips.com>
Cc: Miodrag Dinic <miodrag.dinic@mips.com>
Cc: Paul Burton <paul.burton@mips.com>
Cc: Petar Jovanovic <petar.jovanovic@mips.com>
Cc: Raghu Gandham <raghu.gandham@mips.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/17584/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/math-emu/dp_maddf.c
arch/mips/math-emu/dp_mul.c
arch/mips/math-emu/ieee754dp.h

index 7ad79ed411f5b3a94695e0d85f55f511c2abf270..28b90fd3e0930ecddff2b1eec29f38f8e9ab87c4 100644 (file)
@@ -201,9 +201,6 @@ static union ieee754dp _dp_maddf(union ieee754dp z, union ieee754dp x,
         * Multiply 64 bits xm and ym to give 128 bits result in hrm:lrm.
         */
 
-       /* 32 * 32 => 64 */
-#define DPXMULT(x, y)  ((u64)(x) * (u64)y)
-
        lxm = xm;
        hxm = xm >> 32;
        lym = ym;
index 60c8bfe409473409653a5f6775cc59af039fc0ed..7bc5dde8e7460ee31602ff806e2098cf402facd7 100644 (file)
@@ -128,9 +128,6 @@ union ieee754dp ieee754dp_mul(union ieee754dp x, union ieee754dp y)
         * Multiply 64 bits xm, ym to give high 64 bits rm with stickness.
         */
 
-       /* 32 * 32 => 64 */
-#define DPXMULT(x, y)  ((u64)(x) * (u64)y)
-
        lxm = xm;
        hxm = xm >> 32;
        lym = ym;
index 9ba023004eb6ff7f03a796a3acae8b609e3faea6..a56707b75282a7fbdcf56f5cbf7b410b334275d6 100644 (file)
@@ -55,6 +55,9 @@ static inline int ieee754dp_finite(union ieee754dp x)
 #define XDPSRS1(v)     \
        (((v) >> 1) | ((v) & 1))
 
+/* 32bit * 32bit => 64bit unsigned integer multiplication */
+#define DPXMULT(x, y)  ((u64)(x) * (u64)y)
+
 /* convert denormal to normalized with extended exponent */
 #define DPDNORMx(m,e) \
        while ((m >> DP_FBITS) == 0) { m <<= 1; e--; }