From owner-freebsd-mips@FreeBSD.ORG Mon Jun 15 21:32:02 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 901C277F; Mon, 15 Jun 2015 21:32:02 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22f.google.com (mail-ig0-x22f.google.com [IPv6:2607:f8b0:4001:c05::22f]) (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 5AD5F22A; Mon, 15 Jun 2015 21:32:02 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by igbiq7 with SMTP id iq7so28756552igb.1; Mon, 15 Jun 2015 14:32:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=VTJvbC3tTFZt4YDkpArif32zrf6lC+VK1ZHhx0phbY0=; b=S6c1F6zmWXCIK/9oYHh7H0QkuO8l4HXpTmaeUyvBaBGSOyC0ReK/bbDpLz5QctUL6w 3Rr27bwHyZtC2xkD9BjukANtkiLrsdOq2ETrHbJo/3DL3Lama3TaMlPFOnEB9fVotiTv hj2GtO475SdoIvcsVo1jShozsg/CDe+5vfJ3UXzSz7XZlsj3wJB8KQMcePHjCQIo++Bp UuQKV4gU+rJKBM9mX/fiRz1b8byh0QESnXDXTAkqZP7fXpYwOJDd/LAzPvSr6anEXCml sld3tpd2QLuY1vqs771IB5QaYDiBLcGk+EE3PGWKXxIIMtF5Rm3IrZKesTY6Hl2zvn+0 4kxw== MIME-Version: 1.0 X-Received: by 10.50.111.167 with SMTP id ij7mr23473233igb.49.1434403921769; Mon, 15 Jun 2015 14:32:01 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.38.133 with HTTP; Mon, 15 Jun 2015 14:32:01 -0700 (PDT) In-Reply-To: <7895DD8F-6165-4EF9-AAE7-098C601470D8@freebsd.org> References: <7895DD8F-6165-4EF9-AAE7-098C601470D8@freebsd.org> Date: Mon, 15 Jun 2015 14:32:01 -0700 X-Google-Sender-Auth: cbUyLITb-9BeYRqVAZATLMv1V-0 Message-ID: Subject: Re: [rfc] fix umul_ppmm() in our libgcc From: Adrian Chadd To: Stanislav Sedov Cc: "freebsd-mips@freebsd.org" Content-Type: text/plain; charset=UTF-8 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:32:02 -0000 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 wrote: > >> On Jun 13, 2015, at 3:41 PM, Adrian Chadd 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 > > >