From owner-freebsd-mips@FreeBSD.ORG Mon Jun 15 21:39:10 2015 Return-Path: Delivered-To: freebsd-mips@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22DD6CB3 for ; Mon, 15 Jun 2015 21:39:10 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ig0-f181.google.com (mail-ig0-f181.google.com [209.85.213.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E0BDD2AD for ; Mon, 15 Jun 2015 21:39:09 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: by igboe5 with SMTP id oe5so40905485igb.1 for ; Mon, 15 Jun 2015 14:39:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=lL+u8VwC7ZDuaKSyGo2cWDOHDazSsK6I3l9TtCTkVXk=; b=iAfjfCyYJAHudOgz9E9/p12R/jd+NS3kuOij9B7+fnmZ7jMnHpN9656e7Yn1B8KO7F GhlN/8GSdMDgywdoBquZu22UlUdadDqnvCM6AQik+DPNzsnLFTNTHObPWrTqYwXV2FHc m2u6UUKxC5H+2sqxu1nD21fNbQV73ulaGlLnXBIF0W7c+7vDgTq5QgxEljCgkbS5VESU wo3OC15bysyqAXMkHU6KD5FRfe2ZcLBGtXiSx32avuUCu/Y5yH3Rn6O5bUw2nal8lEiP BZSxkdOzHDz/EA6H3Z9GklvDMddIwHlWAUasoYAkndauk7BQ0I8h1RD07fvgM+DmEZfq tmDw== X-Gm-Message-State: ALoCoQk7/yECPIH+kr2V1eAzw9E/5k/rX5SfFj/jIA/xfDkCe6GsQK2p9I1Fgp9tbSlkOfHuHQ9v X-Received: by 10.50.4.66 with SMTP id i2mr23887578igi.40.1434404348409; Mon, 15 Jun 2015 14:39:08 -0700 (PDT) Received: from netflix-mac-wired.bsdimp.com ([50.253.99.174]) by mx.google.com with ESMTPSA id j5sm9694966ioo.8.2015.06.15.14.39.06 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Jun 2015 14:39:06 -0700 (PDT) Sender: Warner Losh Subject: Re: [rfc] fix umul_ppmm() in our libgcc Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Content-Type: multipart/signed; boundary="Apple-Mail=_75CCEFDB-821A-438B-9686-2C0F0D3046E1"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5 From: Warner Losh In-Reply-To: Date: Mon, 15 Jun 2015 15:39:04 -0600 Cc: Stanislav Sedov , "freebsd-mips@freebsd.org" Message-Id: <4E91032E-901F-4667-B271-5D0C5361CC08@bsdimp.com> References: <7895DD8F-6165-4EF9-AAE7-098C601470D8@freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.2098) X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2015 21:39:10 -0000 --Apple-Mail=_75CCEFDB-821A-438B-9686-2C0F0D3046E1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 do { UDltype ll; __asm__ (=E2=80=9Cmuiltu %2 %3=E2=80=9D : =E2=80=9C=3Dx=E2= =80=9D ll : =E2=80=9Cd=E2=80=9D ((USltype)(u)), =E2=80=9Cd=E2=80=9D((USlty= pe)(v))); w1 =3D ll >> 32; w0 =3D ll;} while 0; might be a good replacement. The =E2=80=9Ch=E2=80=9D constraint was = abandoned and not replaced by anything. Thought there may be simpler = ways, since I haven=E2=80=99t looked to see how this is actually used. Warner > On Jun 15, 2015, at 3:32 PM, Adrian Chadd wrote: >=20 > The error is unsupported constraints. '=3Dh' (hi register) is > unsupported as of some GCC > 4.2.1. >=20 >=20 >=20 > -a >=20 >=20 > On 15 June 2015 at 10:15, Stanislav Sedov wrote: >>=20 >>> On Jun 13, 2015, at 3:41 PM, Adrian Chadd = wrote: >>>=20 >>> Hi, >>>=20 >>> our libgcc in -base is very .. old. It chokes when compiling for >>> mips32. This patch seems to do the right thing. >>>=20 >>> Does anyone have any positive/negative feedback? >>>=20 >>> Thanks, >>>=20 >>>=20 >>> -adrian >>>=20 >>>=20 >>> Index: contrib/gcc/longlong.h >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> --- contrib/gcc/longlong.h (revision 284090) >>> +++ contrib/gcc/longlong.h (working copy) >>> @@ -584,11 +584,11 @@ >>>=20 >>> #if defined (__mips__) && W_TYPE_SIZE =3D=3D 32 >>> #define umul_ppmm(w1, w0, u, v) \ >>> - __asm__ ("multu %2,%3" = \ >>> - : "=3Dl" ((USItype) (w0)), = \ >>> - "=3Dh" ((USItype) (w1)) = \ >>> - : "d" ((USItype) (u)), = \ >>> - "d" ((USItype) (v))) >>> + do { = \ >>> + UDItype __ll =3D (UDItype)(u) * (v); = \ >>> + w1 =3D __ll >> 32; = \ >>> + w0 =3D __ll; = \ >>> + } while (0) >>> #define UMUL_TIME 10 >>> #define UDIV_TIME 100 >>> #endif /* __mips__ */ >>=20 >> This looks right to me in terms of functionality, but what is wrong >> with the original code (multu)? That one seems correct as well. >>=20 >> What error do you see when compiling it? >>=20 >> -- >> ST4096-RIPE >>=20 >>=20 >>=20 > _______________________________________________ > 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" --Apple-Mail=_75CCEFDB-821A-438B-9686-2C0F0D3046E1 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----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----- --Apple-Mail=_75CCEFDB-821A-438B-9686-2C0F0D3046E1--