Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5093944yba; Wed, 8 May 2019 07:48:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNzxRJH+CdC2XwPK2kYDj2wuoZkpSuEJUKzAnx129mdUT6+Nop/pExufSRrJVpiN0SiVJD X-Received: by 2002:a63:5659:: with SMTP id g25mr47865869pgm.59.1557326920821; Wed, 08 May 2019 07:48:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557326920; cv=none; d=google.com; s=arc-20160816; b=PBk7MeuqYw6TNgWkwiv4PB51COXF32qYR7pbLmImTVZvftC2bFMGuEDA4J5xtGtu7V ++7KDpkk4bp0t9x8p6IF1EtZiSFuvhfiLF1NVzK/UCHrf3ty62qrNKChea79vHFxQ8ns T7pcGm286C+gvEVWtU6kruwS5pasAH9yawHc2RauHvf3YxKt1JHFQk/YBkCQ+S55Kxkh dVg+CcfZgNUByoEoopk4elANuBKENeubT9bGHpOrxPkZ8u2ViEYMuKbmrWILl3jq+/IT MA/n5SLedwuRaZpYkJVAHBn+twYCCS0rQnvWeTdqKVzB2lekziWCr3Ww0ZzKFAWO+17w 9VrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=qD7THbst5YDsVGC0T/i3W/pOTt6Ba/hlw6B24xT7ZuI=; b=va3yDGMxQXXk38YR8GJ5jzmMMBboO4DF/WmEp7jtCpTKfxcI7dcfmHVvdVHY224BTU ac/0P5xp5DjjFbTBODQbmCHgNbN8cBCkdy4CQKFIOxehHS/Fkzf5mMgXfrShFMlP5Iij hVdZgh8jqzj9BCAunt/kIC/nyA8Kz1VHqsCNopfsjBLcyDB0aKgfde4lPQpdE72nr20k chIoKe5EdcjrbqufWyXmlj0VHTVUXVa4X5el6GglkpoYdBATRLSUl9IAFBU7363wVYJL Bc12IeD7M5vKgGInyQTMQeD/nRNYmolPMzwtNR82OShHeBmAgX6ZtXOzVJs28CiBNA5p nxqg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a13si22374819pfn.70.2019.05.08.07.48.24; Wed, 08 May 2019 07:48:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728002AbfEHOl1 (ORCPT + 99 others); Wed, 8 May 2019 10:41:27 -0400 Received: from gate.crashing.org ([63.228.1.57]:51974 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726592AbfEHOl0 (ORCPT ); Wed, 8 May 2019 10:41:26 -0400 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x48Ef0ZK007596; Wed, 8 May 2019 09:41:00 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id x48Eexn8007593; Wed, 8 May 2019 09:40:59 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Wed, 8 May 2019 09:40:58 -0500 From: Segher Boessenkool To: Christophe Leroy Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH] powerpc: slightly improve cache helpers Message-ID: <20190508144058.GI8599@gate.crashing.org> References: <0b460a85319fb89dab2c5d1200ac69a3e1b7c1ef.1557235807.git.christophe.leroy@c-s.fr> <20190507151030.GF8599@gate.crashing.org> <720e7c77-3f5c-83f3-6013-36b265c1ba73@c-s.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <720e7c77-3f5c-83f3-6013-36b265c1ba73@c-s.fr> User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 07, 2019 at 06:53:30PM +0200, Christophe Leroy wrote: > Le 07/05/2019 à 17:10, Segher Boessenkool a écrit : > >On Tue, May 07, 2019 at 01:31:39PM +0000, Christophe Leroy wrote: > >>Cache instructions (dcbz, dcbi, dcbf and dcbst) take two registers > >>that are summed to obtain the target address. Using '%y0' argument > >>gives GCC the opportunity to use both registers instead of only one > >>with the second being forced to 0. > > > >That's not quite right. Sorry if I didn't explain it properly. > > > >"m" allows all memory. But this instruction only allows reg,reg and > >0,reg addressing. For that you need to use constraint "Z". > > But gcc help > (https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html#Machine-Constraints) > says it is better to use 'm': It says it *usually* is better to use "m". What it really should say is it is better to use "m" _when that is valid_. It is not valid for the cache block instructions. I'll fix up the comment... "es" is ancient, too, nowadays it is equivalent to just "m" (and you need "m<>" to allow pre-modify addressing). > Z > > Memory operand that is an indexed or indirect from a register (it > is usually better to use ‘m’ or ‘es’ in asm statements) > > That's the reason why I used 'm', I thought it was equivalent. Yeah, the manual text could be clearer. Segher