Date: Mon, 15 Jun 2015 15:39:04 -0600 From: Warner Losh <imp@bsdimp.com> To: Adrian Chadd <adrian@freebsd.org> Cc: Stanislav Sedov <stas@freebsd.org>, "freebsd-mips@freebsd.org" <freebsd-mips@freebsd.org> Subject: Re: [rfc] fix umul_ppmm() in our libgcc Message-ID: <4E91032E-901F-4667-B271-5D0C5361CC08@bsdimp.com> In-Reply-To: <CAJ-VmokZJvFuLaCGOG34cCE7kCnMbR0E5zmAia045uxcg3tq5g@mail.gmail.com> References: <CAJ-Vmonsmu5dGtWKhJchzZfSsVUjtwEVSEij4u6kwk64E0ZOXw@mail.gmail.com> <7895DD8F-6165-4EF9-AAE7-098C601470D8@freebsd.org> <CAJ-VmokZJvFuLaCGOG34cCE7kCnMbR0E5zmAia045uxcg3tq5g@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
do { UDltype ll; __asm__ (“muiltu %2 %3” : “=x” ll : “d” ((USltype)(u)), “d”((USltype)(v))); w1 = ll >> 32; w0 = ll;} while 0;
might be a good replacement. The “h” constraint was abandoned and not replaced by anything. Thought there may be simpler ways, since I haven’t looked to see how this is actually used.
Warner
> On Jun 15, 2015, at 3:32 PM, Adrian Chadd <adrian@freebsd.org> wrote:
>
> The error is unsupported constraints. '=h' (hi register) is
> unsupported as of some GCC > 4.2.1.
>
>
>
> -a
>
>
> On 15 June 2015 at 10:15, Stanislav Sedov <stas@freebsd.org> wrote:
>>
>>> On Jun 13, 2015, at 3: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?
>>>
>>> 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__ */
>>
>> This looks right to me in terms of functionality, but what is wrong
>> with the original code (multu)? That one seems correct as well.
>>
>> What error do you see when compiling it?
>>
>> --
>> ST4096-RIPE
>>
>>
>>
> _______________________________________________
> 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
iQIcBAEBCgAGBQJVf0X5AAoJEGwc0Sh9sBEAXoMQAIOEaxeB5DRoCqS0EQBUGazk
GgszvSxhPRFezgOOdtko/DeSu4WBVhmTPaKNU607VABKH4taISzIWvt+ZirNox4D
7gvFy9UoVjy8BnL5gxEraFVZ2KG0A5U3ilrmZWrrMrjMzGWlQFjszC4sFYr3RgOA
/Y0W2f1Qahc9jY+NPWKU9CGsYkqaCc6APOokKoOVHPj5NFw1X1wJhQAgpUf70W/X
XqVOpjG/sEdr49CE3WklZmFzD6WOEt1hkQpJdCsO+CR8clDv6+MZyYLCqrOz5GQu
sR6gvCxK5NYLhaJ9To2MzlPC4P1WaLl+d2RsVmXA5lsTJKo+cw4ND4nWioINxnV5
uZZACKNDWnXYQjqrCYnSPlbNvN9FhQQEVXlAYVYJ3CMbiIYg8b+CaV/JO/k/CyiF
Qlse/8g0RVouflRdRzHauhu1etty9y18FhUts29rEuUfVrORQ7K/5QkeVCnQ5KZH
MSoUVb/mBZBQ5NEdNnjyVMZJ2CrfRKHSGQyuiB19+3jdfGrX1enwCecsxCOv4o+X
/unbuboto7G41ks32xTb38rBuUdL/4THZTHi0K39BWR7KvlbY7d5tmFk1WTV25Om
KQHMPjN0pNsw3HaH4TJHi+SgnXlQab43twyB6Kyre3kL3JXpUzYllIf2z15qCr5P
6jxf06d3rY8cg+3Ybtxw
=M2jk
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E91032E-901F-4667-B271-5D0C5361CC08>
