From owner-freebsd-sparc64@FreeBSD.ORG Wed Dec 28 00:29:24 2011 Return-Path: Delivered-To: sparc64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25746106564A; Wed, 28 Dec 2011 00:29:24 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 95D1B8FC12; Wed, 28 Dec 2011 00:29:23 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id pBS07NH8077408; Wed, 28 Dec 2011 01:07:24 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id pBS07NK3077407; Wed, 28 Dec 2011 01:07:23 +0100 (CET) (envelope-from marius) Date: Wed, 28 Dec 2011 01:07:23 +0100 From: Marius Strobl To: Ed Schouten Message-ID: <20111228000723.GA77332@alchemy.franken.de> References: <20111227231243.GB1895@hoeg.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111227231243.GB1895@hoeg.nl> User-Agent: Mutt/1.4.2.3i Cc: mips@freebsd.org, sparc64@freebsd.org Subject: Re: (Finally) migrate MIPS and SPARC64 to libcompiler_rt X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2011 00:29:24 -0000 On Wed, Dec 28, 2011 at 12:12:43AM +0100, Ed Schouten wrote: > Hi all, > > Quite some time ago, we switched from libgcc to libcompiler_rt on all > architectures except MIPS and SPARC64. At the time I was also quite busy > with other FreeBSD and LLVM related things, so I decided to leave MIPS > and SPARC64 the way they were. > > The reason why we haven't switched these two architectures yet, is due > to a minor bug in __ctzdi2() calling __builtin_ctz(). On these two > architectures, this ends up calling __ctzdi2() again, causing a hang. > > I have filed a bug for this at the LLVM folks, but until that time I > want to ask if there are people that are willing to test the attached > patch on their MIPS and SPARC64 systems. The only thing you need to do: > rebuild world two iterations to see whether everything works properly. I > do advise you to test this patch in a jail first. > > If this patch fixes the problem, I will commit the change to SVN. As of > then, every architecture will use libcompiler_rt. This also makes > work on MIPS properly. > Before making libcompiler_rt the default for sparc64 could you please also look into adding the optimized versions of _divsi3 and _modsi3 (see contrib/gcc/config/sparc/lb1spc.asm) to libcompiler_rt? They're taken from/based on the SPARC V8 Architecture Manual and IIRC I once compared them and there actually was little difference so there should be no licensing issues. Marius