Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jun 2015 10:08:12 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Adrian Chadd <adrian@freebsd.org>
Cc:        "freebsd-mips@freebsd.org" <freebsd-mips@freebsd.org>
Subject:   Re: [rfc] fix umul_ppmm() in our libgcc
Message-ID:  <47D07C4F-1AF3-4AD7-BFAA-76B0FD8BFFC4@bsdimp.com>
In-Reply-To: <CAJ-Vmonsmu5dGtWKhJchzZfSsVUjtwEVSEij4u6kwk64E0ZOXw@mail.gmail.com>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]

> On Jun 13, 2015, at 4:41 PM, Adrian Chadd <adrian@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@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-mips
> To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org"


[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJVfvhsAAoJEGwc0Sh9sBEAE3sP/Ryyiyxg4eN6WMgy1pSy+3xp
am4JIA5vPQrgd4kpzryz5Tq5s/uIr3rSOKKyHvFM47PUW5n/lpM08OdYzITR7BzV
0ducAaN9ohnzoG4rTJZH924mm42VHvpF/CgpIeALmZXvQqy9bGJKVQ27KfijD9/6
QE1bMPdzlh0Iuy6iUJsVcS1z0piY+8tDdzIbp8IGa2EHcNoMo9GeVKuiCLq89WHn
IT7zJS+u3sCD54EKB24BG3ZL8UmQD8Lb5Qti4xBFmLxs9hdfofevcicZM9BNafAO
UOiU3hgMlbb4t99Q+WLncdYg3AsDX5J2J/EJQ3TliYTT6u0jHKyW2e4BKYcsXkc+
yP7e0V1bU9Q15cZUzVT99ygonk9aqwTzroM6RPs2+XY4LDbuSgnSmqHRtEIy/HR3
3i2assbNOUBNh3QFdngNFLuCTmLnLKPWfLZpsOkGDkDnxtYwRbPL+Fy/8r6Bdt3x
wYKiZn3bcTfMqrFlXLfyWUB4LCFsJpx5Ta0AJ5OG1RilmM8f8Q/1eOvUhq7YdJcN
VYwOSmrCcd71t83HY8Pga3PKovsM+34bNamDlMrr+XMnqBR31v7KdMop898HOyvy
j7OWU9otucJ8prgKWNOycN08sovgdsSczjg6KkRhEtlldd3XWviPI+IvOsOFLQ1I
K5YNxSSCJUYehIa67xGM
=w0mn
-----END PGP SIGNATURE-----
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?47D07C4F-1AF3-4AD7-BFAA-76B0FD8BFFC4>