[rfc] fix umul_ppmm() in our libgcc
Warner Losh
imp at bsdimp.com
Mon Jun 15 16:08:14 UTC 2015
> On Jun 13, 2015, at 4:41 PM, Adrian Chadd <adrian at freebsd.org> wrote:
>
> Hi,
>
> our libgcc in -base is very .. old. It chokes when compiling for
> mips32. This patch seems to do the right thing.
>
> Does anyone have any positive/negative feedback?
What code does it generate?
Something doesn’t look quite right, but I can’t quite put my finger on it.
Warner
> Thanks,
>
>
> -adrian
>
>
> Index: contrib/gcc/longlong.h
> ===================================================================
> --- contrib/gcc/longlong.h (revision 284090)
> +++ contrib/gcc/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 __ll = (UDItype)(u) * (v); \
> + w1 = __ll >> 32; \
> + w0 = __ll; \
> + } while (0)
> #define UMUL_TIME 10
> #define UDIV_TIME 100
> #endif /* __mips__ */
> _______________________________________________
> freebsd-mips at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-mips
> To unsubscribe, send any mail to "freebsd-mips-unsubscribe at freebsd.org"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/freebsd-mips/attachments/20150615/88bdf93a/attachment.sig>
More information about the freebsd-mips
mailing list