From owner-freebsd-mips@FreeBSD.ORG Thu Jun 18 02:57:36 2015 Return-Path: Delivered-To: freebsd-mips@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D42FC7DF for ; Thu, 18 Jun 2015 02:57:36 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ie0-x22c.google.com (mail-ie0-x22c.google.com [IPv6:2607:f8b0:4001:c03::22c]) (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 9DA0DCAC for ; Thu, 18 Jun 2015 02:57:36 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by iebmu5 with SMTP id mu5so46496327ieb.1 for ; Wed, 17 Jun 2015 19:57:35 -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=E8X4JhON1fiIbhh9XQfI6YtQe56bcJrR+k8boSzp9bU=; b=H8AZF74lYkiwh26k/4sg3ZX3UyKqMpZQ88dYwU7v4gtBLxMvOSCwhAIkbuhvPMM3d1 A0LI0Om0/KaFtnwZAtPpOoUMaThQH5Y5GMRMKQ0iG7KXmXyROm76i0UBdphOX3mctH+f Yiaq1Ha6tuMtjN3hRAOY+/D0nzUmj1PwCO9oycDVC4Q+DsX66WPActYZNXBehrJ+wln9 O0JtVPWQaFw1zmOqfhxAIwc7XZiRWoMzLxDAfJIVyCvKmOjnM7jpgwaGohywFppgWDkt HuP+muWSKZiaIBh5vmpdUaZaZzR8f65e6pYutyG/SRwYZOtVKnimSJtY3TPsLWqAG8TQ kU9g== MIME-Version: 1.0 X-Received: by 10.50.79.129 with SMTP id j1mr2148451igx.32.1434596255852; Wed, 17 Jun 2015 19:57:35 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.38.133 with HTTP; Wed, 17 Jun 2015 19:57:35 -0700 (PDT) In-Reply-To: References: <20150616011832.146e0f0e@kan> Date: Wed, 17 Jun 2015 19:57:35 -0700 X-Google-Sender-Auth: HHRvLenoSenlfcEN5zWsLVdTnwM Message-ID: Subject: Re: [rfc] fix umul_ppmm() in our libgcc From: Adrian Chadd To: Alexander Kabaev 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: Thu, 18 Jun 2015 02:57:36 -0000 Ok, so this: adrian@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