Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3121432imm; Thu, 17 May 2018 03:52:00 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr4DySUYYzf0Qy6uGcqGLVnNilz2mwRHV4j3L8j4bU890zVTzkCy6buJy9B8BAVGICjSQG9 X-Received: by 2002:a63:6447:: with SMTP id y68-v6mr3692758pgb.205.1526554320042; Thu, 17 May 2018 03:52:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526554320; cv=none; d=google.com; s=arc-20160816; b=wI5zvfPta/fKdkVoWBW+/xqcMXMflsLKBImvH9w1a7eQafksaLNHHCkUtWsDYTCe8n N4LyImrENS/WpNI8pKGG1xsiC+WBuSRXwe9m8Y8eY1vX3RSRqWXvdchwaYvP2rtRHXLE 6hwdKdlZT/364aHr9tZax1CRJRrl3S8Jfe2FF4EJORmtnYl1emUJmMsfeQ7K/yNA2WSa hCo699O0JueRLNZjroTtG8FCtBYtWmnbS5YrMpe1JIf6BModgvxVymXrCD3lOeuvAuS/ KAZnwS3LyI30t9sH3LL+EOyvosbkHArdMKHRzsIMbTnEKag8U2RWYdvmsi1ie+NiD0sI JTKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:message-id :arc-authentication-results; bh=QCXco+N5JWVC2L4UCy1HlRp7FEGWa6RTRfqZVNlNU6w=; b=sW80RPvF/mj/MszubIpOsBHOE1eEKt3mq4h6BFQA9amRYKEY+anCK3ZtaszcVeDCQo 1acpC6acq9Cgs6bJgIajbIdvKhcusqVjmR5tb0EZc6FlLRf3fi/jCCWqHITRC1UMTn/Z M2vlfve4wcKMhWoUFLcGbiWTR5TsbM0JvJThWcIxftzf7Ktv5yAcyVDH5Vu9PTDiAWfW jGhuagd0jNX6RN7d73bZAIJD9VVXz92CCUzqZ5PEBnpIfBmQX4tBwyk6Q58yE5ue8IIo BKDGi291oEg1fgw/Uf3OQLSZGOxaKIDGhEXDvby1pfYex/n+IPlWffeCPAPli634vjcO +iEg== 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 l63-v6si4677416plb.49.2018.05.17.03.51.46; Thu, 17 May 2018 03:52:00 -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 S1751649AbeEQKtv (ORCPT + 99 others); Thu, 17 May 2018 06:49:51 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:61217 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751097AbeEQKtu (ORCPT ); Thu, 17 May 2018 06:49:50 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 40mp3H5lq9z9v0kC; Thu, 17 May 2018 12:49:47 +0200 (CEST) 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 NmL_6UizP_Ne; Thu, 17 May 2018 12:49:47 +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 40mp3H5HCgz9v0k0; Thu, 17 May 2018 12:49:47 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 290F38B987; Thu, 17 May 2018 12:49:49 +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 o4h-kVmLhhFn; Thu, 17 May 2018 12:49:49 +0200 (CEST) Received: from po14934vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.2]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 111AF8B97E; Thu, 17 May 2018 12:49:49 +0200 (CEST) Received: by po14934vm.idsi0.si.c-s.fr (Postfix, from userid 0) id D0E1D6F937; Thu, 17 May 2018 12:49:48 +0200 (CEST) Message-Id: From: Christophe Leroy Subject: [PATCH v2 0/5] powerpc/lib: Optimisation of string functions (mainly for PPC32) To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Thu, 17 May 2018 12:49:48 +0200 (CEST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This serie intend to optimise string functions for PPC32 in the same spirit as already done on PPC64. The first patch moves PPC32 specific functions from string.S into a dedicated file named string_32.S The second patch rewrites __clear_user() by using dcbz intruction The third patch rewrites memcmp() to compare 32 bits words instead of comparing byte per byte. The fourth patch removes NUL size verification from the assembly functions so that GCC can optimise them out when the size is constant The last patch inlines memcmp() for constant sizes <= 16 As shown in each individual commit log, second, third and last patches provides significant improvment. Changes in v2: - Moved out the patch removing the hot loop alignment on PPC32 - Squashed the changes related to NUL size verification in a single patch - Reordered the patches in a more logical order - Modified the inlining patch to avoid warning about impossibility to version symbols. Christophe Leroy (5): powerpc/lib: move PPC32 specific functions out of string.S powerpc/lib: optimise 32 bits __clear_user() powerpc/lib: optimise PPC32 memcmp powerpc/lib: inline string functions NUL size verification powerpc/lib: inline memcmp() for small constant sizes arch/powerpc/include/asm/string.h | 91 ++++++++++++++++++++- arch/powerpc/kernel/prom_init_check.sh | 2 +- arch/powerpc/lib/Makefile | 5 +- arch/powerpc/lib/memcmp_64.S | 8 ++ arch/powerpc/lib/string.S | 75 ++++------------- arch/powerpc/lib/string_32.S | 145 +++++++++++++++++++++++++++++++++ 6 files changed, 259 insertions(+), 67 deletions(-) create mode 100644 arch/powerpc/lib/string_32.S -- 2.13.3