Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Jun 2015 19:57:35 -0700
From:      Adrian Chadd <adrian@freebsd.org>
To:        Alexander Kabaev <kabaev@gmail.com>
Cc:        "freebsd-mips@freebsd.org" <freebsd-mips@freebsd.org>
Subject:   Re: [rfc] fix umul_ppmm() in our libgcc
Message-ID:  <CAJ-Vmoncx=Qr_FY7qEPxK0j12_pGREG05qrk65QLk01Arf4RmQ@mail.gmail.com>
In-Reply-To: <CAJ-Vmokm1anJUaZLEFpW=JpV5nec7CTuL1yPOJdZniQ53%2BArcQ@mail.gmail.com>
References:  <CAJ-Vmonsmu5dGtWKhJchzZfSsVUjtwEVSEij4u6kwk64E0ZOXw@mail.gmail.com> <20150616011832.146e0f0e@kan> <CAJ-Vmokm1anJUaZLEFpW=JpV5nec7CTuL1yPOJdZniQ53%2BArcQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Ok, so this:

adrian@lucy-11i386:~/work/freebsd/head-embedded-2/src/contrib/gcc %
svn diff longlong.h
Index: longlong.h
===================================================================
--- longlong.h    (revision 284394)
+++ longlong.h    (working copy)
@@ -584,11 +584,11 @@

 #if defined (__mips__) && W_TYPE_SIZE == 32
 #define umul_ppmm(w1, w0, u, v) \
-  __asm__ ("multu %2,%3"                        \
-       : "=l" ((USItype) (w0)),                    \
-         "=h" ((USItype) (w1))                    \
-       : "d" ((USItype) (u)),                    \
-         "d" ((USItype) (v)))
+    do {                                \
+    UDItype __x = (UDItype) (USItype) (u) * (USItype) (v);        \
+     w1 = __x >> 32;                        \
+     w0 = __x;                            \
+    } while (0)
 #define UMUL_TIME 10
 #define UDIV_TIME 100
 #endif /* __mips__ */


?



-a



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmoncx=Qr_FY7qEPxK0j12_pGREG05qrk65QLk01Arf4RmQ>