From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 51984 invoked by alias); 4 Nov 2016 15:23:08 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 51958 invoked by uid 89); 4 Nov 2016 15:23:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=casa, larsson, LEON3, LEON X-HELO: shards.monkeyblade.net Date: Fri, 04 Nov 2016 15:23:00 -0000 Message-Id: <20161104.112254.1930090925346599920.davem@davemloft.net> To: andreas@gaisler.com Cc: triegel@redhat.com, libc-alpha@sourceware.org, adhemerval.zanella@linaro.org, carlos@redhat.com, software@gaisler.com Subject: Re: [RFC][PATCH 0/2] Make sparcv8 work again on cas enabled hardware From: David Miller In-Reply-To: <581C62A2.8050204@gaisler.com> References: <1478187561.7146.742.camel@localhost.localdomain> <20161103.132213.598669006383889263.davem@davemloft.net> <581C62A2.8050204@gaisler.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2016-11/txt/msg00172.txt.bz2 From: Andreas Larsson Date: Fri, 04 Nov 2016 11:27:46 +0100 > On 2016-11-03 18:22, David Miller wrote: >> From: Torvald Riegel >> Date: Thu, 03 Nov 2016 16:39:21 +0100 >> >>> Is there any difference between the additional CAS on a v8 and the CAS >>> on a v9? If there should be none (eg, same instruciton encoding >>> etc.), >>> we wouldn't need a runtime check for this, would we? >> >> A quick look at binutils shows that the encoding appears to be the >> same. > > The general encoding of the CASA instruction is the same, but on > sparcv9 the ASI to use is the primary address space ASI 0x80 and on > LEON the ASI to use is the user data space ASI 0xa. So different > instruction encodings needs to be used. > > Unfortunately there is no way general way short of trying to use the > CASA instruction and taking a care of a possible illegal instruction > to detect if a LEON3 system has CAS or not. But CAS support is implied > by the the -mcpu=leon3 flag, and LEON3 systems without CAS can use > -mcpu=v8. This really should be advertised in the _dl_hwcaps. We should try as hard as possible to allow dynamic discovery of this.