Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3969521yba; Tue, 7 May 2019 09:54:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqwjLtiRBwnzIanc9XSB37CP2cpN9pwDkiKHlVgJ0rQp1u1UIsiiI4kTD6kMPMBdYtW52jb6 X-Received: by 2002:aa7:80c6:: with SMTP id a6mr42431520pfn.114.1557248091295; Tue, 07 May 2019 09:54:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557248091; cv=none; d=google.com; s=arc-20160816; b=pKJRZi/G7ByKWn23ToTB8sRUivy+V3/qmG3lkWBbRN3h+hImKYhO4DmIN2Bj4xG096 96sJtWFuTXUOuWZCscoQ9+6cA/vQgE1PUsiXQ8aOkI/MGFOPhdQVsvjCToiZfUe/x2ML HNFzrlj1XCBE2fxkLIQBNw+/3Z9cM1Ub95Ao6gk9XOQG42O1bhqV/Ilc1dpOZF3Ea5OS Lh5/86wNIWDe5iObbsI9hTIuvJA4c0gJouZmtGkmhgGf+dcl+Z0oboOsPD2ZhXOZQW80 wARvEUmXrq5qAL1+GTpmCpOKTCraii9dYXEluP+0i3zTAQznCn7l9PwC7Ubv/FNjPf4M K+JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=WprILXdm/abE/MEzyylSE7b5a084BNrypeqdWUqRY4c=; b=UTFqGbCSnsejx2PL2nEDOR4PwjjBaSMgDZYJYmwXILrXC5oq6kIcq8mcnBy3Vi2Qg0 kFNRFcbz1O2zRdhyr+wygsSEO8H64Yr6UigcSmf5vGXq5SF9EHO18FwqH910J1D2olrd wuimTRb65+owz1QqFwDRS3UqkgxDrnLmwQQoMjPqw3oTXmrEo8/hJM4R7Su8kOWJE+Gb zAoDcy0Fk8sOJ313D/jrj4CG8apYz3lHoUnNL7KxAvh9bEZTDiIxmW5fueIN4Nw41a3w a492ErPutSwCsyi2OtGzfxRtKVLXIEd48p+Xf5+cPrtQDLQDl8peMBjhS1n/qTrk4rmh /IDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=DaJtWWko; 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 n3si20959914plb.148.2019.05.07.09.54.35; Tue, 07 May 2019 09:54:51 -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; dkim=pass header.i=@c-s.fr header.s=mail header.b=DaJtWWko; 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 S1726921AbfEGQxd (ORCPT + 99 others); Tue, 7 May 2019 12:53:33 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:12678 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725859AbfEGQxc (ORCPT ); Tue, 7 May 2019 12:53:32 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 44z5K61W3Cz9tyhg; Tue, 7 May 2019 18:53:30 +0200 (CEST) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=DaJtWWko; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id OaKjzUDVVKym; Tue, 7 May 2019 18:53:30 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 44z5K60SSPz9tycB; Tue, 7 May 2019 18:53:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1557248010; bh=WprILXdm/abE/MEzyylSE7b5a084BNrypeqdWUqRY4c=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=DaJtWWkoS3t7AQul3FXtkjh6BnenaYM73Y6WLeliWA/9Qc/6HGyTYOGn3uiEqWgNU avZnC5MsawFt2k0j1cV+VNsf3QFyd0Mx1cV5TyD2kJ9JR9Ejkyk5MoTv0epBmxNXRW ARaY3YDe2G0lsBYelezWXO/ZeQZ605N8Rzanjoak= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id BA77E8B932; Tue, 7 May 2019 18:53:31 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id FpuzyaJjCwg8; Tue, 7 May 2019 18:53:31 +0200 (CEST) Received: from PO15451 (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 5B91D8B8CB; Tue, 7 May 2019 18:53:31 +0200 (CEST) Subject: Re: [PATCH] powerpc: slightly improve cache helpers To: Segher Boessenkool Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org References: <0b460a85319fb89dab2c5d1200ac69a3e1b7c1ef.1557235807.git.christophe.leroy@c-s.fr> <20190507151030.GF8599@gate.crashing.org> From: Christophe Leroy Message-ID: <720e7c77-3f5c-83f3-6013-36b265c1ba73@c-s.fr> Date: Tue, 7 May 2019 18:53:30 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190507151030.GF8599@gate.crashing.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 07/05/2019 à 17:10, Segher Boessenkool a écrit : > Hi Christophe, > > 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': 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. Christophe > > The output modifier "%y0" just makes [reg] (i.e. simple indirect addressing) > print as "0,reg" instead of "0(reg)" as it would by default (for just "%0"). > > > Segher >