Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1242098ybl; Wed, 14 Aug 2019 13:13:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFqrOfWe1I1jahNTi0nlYrI4mc+ZvGe+o1rzYNEljXiwXNjBQq90KeH84KykiiJRAo6pxF X-Received: by 2002:a17:902:b203:: with SMTP id t3mr1084806plr.174.1565813625391; Wed, 14 Aug 2019 13:13:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565813625; cv=none; d=google.com; s=arc-20160816; b=TYiHWrgvzoUEvZm97LWa7jUtUEEs8Ze09oBppkWRx7XVDXwQFK81kNQYcUqEjuqzfr RI0YcgUVAeUAw1hMcaO8im4ITK6INMVUMqkbvqitabtbmzfy/Y/93mW0o2svGRuY8ftg PBiY6ZgkfoK/BEh4E02hMvhTwkx1lgePVRUu+W4Lj8Lr3FKNv567oF4rpC9rPCL+78/8 7t9dSdNkSAfT/Soc7bz1QwWeaTokqKi2uqFiIaMQ72QGwtDBYyVL/JErvOBgueTt0gAu ibe6IWIGO6x+rBfyGJRDWXbH19sImt249BxJUbMZAwTO2njrYN9zT7Vl0XkwpkG3YOtD TD/Q== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=4Nrg/8Dj30poQfF0iZ55SWTERjhSDx3U/xUN34ID3S8=; b=Y3SCdc8YdPtWqOin+BA+LsvBaD0NbZDfxMlmsOWbojPobFVSS8j8HHwPhhdieel5zI Ky4BQbAT10L55mYrt+853YNpdaZQGwpf6p/W+IqBx2Vs2P7YnYIXOo8AADTXXgByPyAO o2o65/mRAeaSwIlvRNBNQcCNsLxl4gL6p3gvWltBo+YSAt14zGIaDpLVpeYIRLZkzSzd kPNqJQCjzG9eUnYLnBQI8C+4YX74+gBNLALpqyraCZFB9wTCsk+7l5MfPaCRfEFPoLpP 5S69RmBqwFefgGgbDOGHjw2HVxvkKG1ejqSIWtneucJhGiadyIQYtM7dXzC0BVUDmTNG m1/Q== 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 m9si430159pjs.95.2019.08.14.13.13.28; Wed, 14 Aug 2019 13:13:45 -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 S1729099AbfHNULK (ORCPT + 99 others); Wed, 14 Aug 2019 16:11:10 -0400 Received: from gate.crashing.org ([63.228.1.57]:39568 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729014AbfHNULJ (ORCPT ); Wed, 14 Aug 2019 16:11:09 -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 x7EKAi95012038; Wed, 14 Aug 2019 15:10:44 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id x7EKAh6H012037; Wed, 14 Aug 2019 15:10:43 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Wed, 14 Aug 2019 15:10:42 -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 1/2] powerpc: rewrite LOAD_REG_IMMEDIATE() as an intelligent macro Message-ID: <20190814201042.GH31406@gate.crashing.org> References: <61d2a0b6f0c89b1ee546851ce9b6bd345e5ec968.1565690241.git.christophe.leroy@c-s.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <61d2a0b6f0c89b1ee546851ce9b6bd345e5ec968.1565690241.git.christophe.leroy@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 Hi Christophe, On Tue, Aug 13, 2019 at 09:59:35AM +0000, Christophe Leroy wrote: > + rldicr \r, \r, 32, 31 Could you please write this as sldi \r, \r, 32 ? It's much easier to read, imo (it's the exact same instruction). You can do a lot cheaper sequences if you have a temporary reg, as well (longest path of 3 insns instead of 5): lis rt,A ori rt,B lis rd,C ori rd,D rldimi rd,rt,32,0 to load ABCD. Segher