From patchwork Fri Aug 27 16:04:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pierre-Cl=C3=A9ment_Tosi?= X-Patchwork-Id: 1521801 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=PPwvXn8x; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GxD0L12c5z9sWk for ; Sat, 28 Aug 2021 07:50:10 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 37B6F832CA; Fri, 27 Aug 2021 23:49:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="PPwvXn8x"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D5202831DB; Fri, 27 Aug 2021 18:04:17 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0946282BFA for ; Fri, 27 Aug 2021 18:04:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ptosi@google.com Received: by mail-wr1-x42a.google.com with SMTP id q11so11166751wrr.9 for ; Fri, 27 Aug 2021 09:04:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding; bh=HgHvl/nHWYa/1r6gOaaxS3/K1aoifJ/zXhZRzFEmMS4=; b=PPwvXn8xlQrbD/F70xSZpFly0io2r+r1ttMiCK82U6/H6sJ7B6JCWYCJTqC5nrbQVH idAg7H/lXKLh/AkNT/zanUMBAzNKqoZEM0lR2YlXx1UPws11lsKnCO2/cPpscfX8LrRG jL56/NjZmiR8ddmEvltwz/xxPy+yzrOq6kVqwlgS66972xX9b+OFyUAMy89pcuYDdr7k O3LM1tUyG2Yw5bwmEqXXTMe4z0+wfLVihM8lxhCva7S5U8zWLOpMFrujFIDwpeqmfNOK BAl1R/yx9eRh6gY5mBv1Ye2vpWI3r+xDNsvY0hSuLfOEJtl8DShOPdKi4aU5Qd4vKPXw znzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding; bh=HgHvl/nHWYa/1r6gOaaxS3/K1aoifJ/zXhZRzFEmMS4=; b=Ar3xAz2VtiuunKW1WdpynCTgEriT4pzqaMvkFQv2ZlpcrZAtWlpIsMdn+nlhxukwpG C+H2xnDznVh2GMCX+HBsz8ZpU5XatdqqT6J9h2yv2rrqFiD+873LZs6jg3lrTzSePcNZ G0Nv/fhbHAzJpw1tOD/jeVWCsXFUtp3UUxtrs7Lork7wIfwoSkzFW3gcXM5xHpw2Xhmn yjhW2OPahEkSwTeGJ3xPgXI21QRV5B6/hOK93JyuP471GbcJ1fupaM2WP4m314b8c6Aj Dm9ZBiVWC3u9QF1TIkS9u2LzLHEHW4PPxVFbsSZHtQ3Xov4W+W2r5eCn838P+sz2bJ8V 56dw== X-Gm-Message-State: AOAM531Wh/EcaA3Z0zEmsxXrTgDy46WdTXXqsphA7hbU0yf6eKHz52+4 5gQ3W+ep7a+S0cGCXWa+Kq3/bpSbQPnXSA== X-Google-Smtp-Source: ABdhPJwwzzzIY1p3HUBRlYFdA1wgH0xQs+9MiqS8JTvpM9+r+nNurf9hdBw7fKl1afsqp2iXvVe7og== X-Received: by 2002:a5d:5107:: with SMTP id s7mr10923518wrt.283.1630080254248; Fri, 27 Aug 2021 09:04:14 -0700 (PDT) Received: from google.com (203.75.199.104.bc.googleusercontent.com. [104.199.75.203]) by smtp.gmail.com with ESMTPSA id b62sm1217458wmb.17.2021.08.27.09.04.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Aug 2021 09:04:13 -0700 (PDT) Date: Fri, 27 Aug 2021 18:04:10 +0200 From: =?utf-8?q?Pierre-Cl=C3=A9ment?= Tosi To: u-boot@lists.denx.de Cc: =?utf-8?q?Pierre-Cl=C3=A9ment?= Tosi , Stephen Warren , Simon Glass Subject: [PATCH 2/2] armv8/cache.S: Triple with single instruction Message-ID: <20210827160410.pv2ws2ghy66hpodf@google.com> MIME-Version: 1.0 Content-Disposition: inline X-Mailman-Approved-At: Fri, 27 Aug 2021 23:49:50 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Replace the current 2-instruction 2-step tripling code by a corresponding single instruction leveraging ARMv8-A's "flexible second operand as a register with optional shift". This has the added benefit (albeit arguably negligible) of reducing the final code size. Fix the comment as the tripled cache level is placed in x12, not x0. Signed-off-by: Pierre-Clément Tosi --- arch/arm/cpu/armv8/cache.S | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm/cpu/armv8/cache.S b/arch/arm/cpu/armv8/cache.S index aabb3dff61..5051597f6f 100644 --- a/arch/arm/cpu/armv8/cache.S +++ b/arch/arm/cpu/armv8/cache.S @@ -80,8 +80,7 @@ ENTRY(__asm_dcache_all) /* x15 <- return address */ loop_level: - lsl x12, x0, #1 - add x12, x12, x0 /* x0 <- tripled cache level */ + add x12, x0, x0, lsl #1 /* x12 <- tripled cache level */ lsr x12, x10, x12 and x12, x12, #7 /* x12 <- cache type */ cmp x12, #2