[rfc] fix umul_ppmm() in our libgcc

Alexander Kabaev kabaev at gmail.com
Thu Jun 18 03:59:42 UTC 2015


On Wed, 17 Jun 2015 19:57:35 -0700
Adrian Chadd <adrian at freebsd.org> wrote:

> Ok, so this:
> 
> adrian at 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

Looks good to me.

-- 
Alexander Kabaev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 949 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-mips/attachments/20150617/3cc8a388/attachment.sig>


More information about the freebsd-mips mailing list