From owner-freebsd-mips@FreeBSD.ORG Tue Dec 28 17:22:32 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76BC21065670 for ; Tue, 28 Dec 2010 17:22:32 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 35BDC8FC08 for ; Tue, 28 Dec 2010 17:22:32 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id oBSHGp9p056985 for ; Tue, 28 Dec 2010 10:16:52 -0700 (MST) (envelope-from imp@bsdimp.com) Message-ID: <4D1A1B83.5070602@bsdimp.com> Date: Tue, 28 Dec 2010 10:16:51 -0700 From: Warner Losh User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Thunderbird/3.1.6 MIME-Version: 1.0 To: freebsd-mips@freebsd.org References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PATCH] Retrieval of TLS pointer via RDHWR X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Dec 2010 17:22:32 -0000 On 12/28/2010 04:36, Robert Millan wrote: > Not interested? > > Note this might become mandatory if you ever want to compile > code that uses TLS with recent GCC. > > In any case, when executed natively, rdhwr is a speed-up > compared to a sysarch() call. Actually, am interested in this, but have been swamped with other things... The code looks good, and we should definitely move in this direction. Warner > 2010/12/9 Robert Millan: >> 2010/12/9 Jayachandran C.: >>> I'm not sure that the freebsd mips toolchain supports the __thread >>> directive yet. Were you able to test this from C? >> Yes, but not via __thread. I wrote a small program that sets >> the TLS pointer to an arbitrary value (via MIPS_SET_TLS), >> then issued rdhwr instruction using C inline assembly, and >> finally verified that both values are the same. >> >> (the toolchain I'm using doesn't support __thread either, >> but I submit this patch with the expectation that it can be >> useful later on) >> >> -- >> Robert Millan >> > >