Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp408946pxy; Wed, 21 Apr 2021 06:05:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgIym/6AnY6tcoV5PBb9SdVZgSMrn12zNCS0JxmKRpvy8Mfixw4QU7TAuYfWShcFQlbR04 X-Received: by 2002:a17:907:217b:: with SMTP id rl27mr32793347ejb.359.1619010345480; Wed, 21 Apr 2021 06:05:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619010345; cv=none; d=google.com; s=arc-20160816; b=XDRTa+9iX1YjNaz9Ei+YiTsHxEOZRaDIEulGCXYZtAOIvucGNHiW65Xx+7/b7fV+ZI KaAwplOoF0IcKmiMBr82b+BhN2m5trC0FeTlR6+KMtoXWEWQ8LSrmoK/P0ndpebH4KwK dy9vbkJHqQDfXyeK6gQD3+5FyCTxS7CETPcYCVMFjwt/oZ1UWgOY86Wg99FiRrBlr7ZP Qp9rUV6xje0fndicyUlTcmIEp+ebQmxzXkCjQQg05XjNg6pX9XH0p34HShLT8vEjCAoN 8y5TY/JvJNG5cJ7hxiMljupyJmWSm0LnL99D0JAGIqFEUf7Ryw253Xnz+6zLcphlaw++ n+WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=V7pbU/rhn/hfWaIdHTS6a/739MLBXT9VDF1vhXgnuOk=; b=A8Mkepw+TOkg6ViRfLJdgPJ0T59Z1N4DYOtJHqcLm0BWUT9mi2mKUtThwOocpxECtw BUyoEPwBqonyEmJvlXwYJcRFuAwBFkjhVI/hAqsm7NaJx70l0Dq4sGKHTSSVG23C8VpS 9gfbeLQ1HI+ejnkaGHl/yIKU658l1o88nZwBFKnyhELYWzfZuBpajh1hnqT9Wvyp0rH6 fuSlfMOR1NXqtL5clWUXfMEZ2+EaX09d4KU6cyPD9N006IfUVKs8+8R4pN9kMEiIB46u DNkZg66QkAqojdwzkYsndJzmQ/mwOYclkihrtf3jIjJE8eh24ncWAoJPa29DDHnnFbEQ g+2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p23si1886680ejg.550.2021.04.21.06.05.21; Wed, 21 Apr 2021 06:05:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239983AbhDUMwa (ORCPT + 99 others); Wed, 21 Apr 2021 08:52:30 -0400 Received: from elvis.franken.de ([193.175.24.41]:35165 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239950AbhDUMw2 (ORCPT ); Wed, 21 Apr 2021 08:52:28 -0400 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1lZCKf-0004Cw-02; Wed, 21 Apr 2021 14:51:53 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id AA7E0C0840; Wed, 21 Apr 2021 14:01:48 +0200 (CEST) Date: Wed, 21 Apr 2021 14:01:48 +0200 From: Thomas Bogendoerfer To: "Maciej W. Rozycki" Cc: Arnd Bergmann , Huacai Chen , Huacai Chen , Jiaxun Yang , linux-arch@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/4] Reinstate and improve MIPS `do_div' implementation Message-ID: <20210421120148.GC8637@alpha.franken.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 20, 2021 at 04:50:22AM +0200, Maciej W. Rozycki wrote: > Hi, > > As Huacai has recently discovered the MIPS backend for `do_div' has been > broken and inadvertently disabled with commit c21004cd5b4c ("MIPS: Rewrite > to work with gcc 4.4.0."). As it is code I have originally > written myself and Huacai had issues bringing it back to life leading to a > request to discard it even I have decided to step in. > > In the end I have fixed the code and measured its performance to be ~100% > better on average than our generic code. I have decided it would be worth > having the test module I have prepared for correctness evaluation as well > as benchmarking, so I have included it with the series, also so that I can > refer to the results easily. > > In the end I have included four patches on this occasion: 1/4 is the test > module, 2/4 is an inline documentation fix/clarification for the `do_div' > wrapper, 3/4 enables the MIPS `__div64_32' backend and 4/4 adds a small > performance improvement to it. > > I have investigated a fifth change as a potential improvement where I > replaced the call to `do_div64_32' with a DIVU instruction for cases where > the high part of the intermediate divident is zero, but it has turned out > to regress performance a little, so I have discarded it. > > Also a follow-up change might be worth having to reduce the code size and > place `__div64_32' out of line for CC_OPTIMIZE_FOR_SIZE configurations, > but I have not fully prepared such a change at this time. I did use the > WIP form I have for performance evaluation however; see the figures quoted > with 4/4. > > These changes have been verified with a DECstation system with an R3400 > MIPS I processor @40MHz and a MTI Malta system with a 5Kc MIPS64 processor > @160MHz. > > See individual change descriptions and any additional discussions for > further details. > > Questions, comments or concerns? Otherwise please apply. series applied to mips-next. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]