From patchwork Wed Sep 2 13:36:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Landley X-Patchwork-Id: 7111771 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B6966BEEC1 for ; Wed, 2 Sep 2015 13:36:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C2E1520653 for ; Wed, 2 Sep 2015 13:36:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A267B2034A for ; Wed, 2 Sep 2015 13:36:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752323AbbIBNgX (ORCPT ); Wed, 2 Sep 2015 09:36:23 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:36549 "EHLO mail-ob0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751931AbbIBNgW (ORCPT ); Wed, 2 Sep 2015 09:36:22 -0400 Received: by obqa2 with SMTP id a2so7869379obq.3 for ; Wed, 02 Sep 2015 06:36:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-type:content-transfer-encoding; bh=23N2M92CXFPo4JyoKs2zOtLUaUQ7rcoGsCy3Plon2EY=; b=VMZk9xcbdlXMgVJGyPanztnJOAqcTjuJxRj/ZNTQ93jmjRO5030ZAFQtsG9AudAU9+ qayn8jVTuBaCsabhqV2hkY+FvnO5DOurSIMRs0ol/is1xYks0xS6rRVqv4mLnfH+8nYJ HFHN/MHWTdO+p9nDGNqWh0SwKb8ZmD9rDVIt6vi+YALWICicWOL0XvCzrIQJeM6bQbdE i/crMVBQ06CjAgKEFSbxBpB5Vb1nQYcz+1/5nU1FRiUZRV+JDguWBEwBKragEJrBp61S zUBXXZRhG1CZx0QMiYX4q0nPpjuk9o96fjGAknTJq/Iqo3+qRAF7oiiZKBL0wJ3G++KR tVxQ== X-Gm-Message-State: ALoCoQn+aTbuJTF/bLeC6OiG0FneiNjFGc/0ZVOu8xS8xlOkmlMPKjajio9li6RK8ooTHA4cJFpS X-Received: by 10.182.33.197 with SMTP id t5mr15015439obi.40.1441200982072; Wed, 02 Sep 2015 06:36:22 -0700 (PDT) Received: from [10.0.2.15] (cpe-72-182-52-210.austin.res.rr.com. [72.182.52.210]) by smtp.googlemail.com with ESMTPSA id s8sm14510066oet.1.2015.09.02.06.36.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Sep 2015 06:36:21 -0700 (PDT) To: Linux-sh list From: Rob Landley Subject: [PATCH] common checksum code uses post-sh2 instruction Message-ID: <55E6FB54.9090800@landley.net> Date: Wed, 2 Sep 2015 08:36:20 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rob Landley The common checksum code uses shld which sh2 hasn't got, so unwind it. Note: http://nommu.org/jcore added SHAD and SHLD, and if anybody's building for an actual sh2 they'll either need gcc 4.7 or earlier or a fix to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54089 but when regression testing against the actual historical hardware, you need this. Signed-off-by: Rob Landley --- arch/sh/lib/checksum.S | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/sh/lib/checksum.S b/arch/sh/lib/checksum.S index 356c8ec..7f0fc6b 100644 --- a/arch/sh/lib/checksum.S +++ b/arch/sh/lib/checksum.S @@ -88,8 +88,9 @@ ENTRY(csum_partial) 2: ! buf is 4 byte aligned (len could be 0) mov r5, r1 - mov #-5, r0 - shld r0, r1 + shlr2 r1 ! mov #-5, r0 + shlr2 r1 ! shld r0, r1 + shlr r1 tst r1, r1 bt/s 4f ! if it's =0, go to 4f clrt @@ -288,8 +289,9 @@ DST( mov.w r0,@r5 ) addc r0,r7 2: mov r6,r2 - mov #-5,r0 - shld r0,r6 + shlr2 r6 ! mov #-5, r0 + shlr2 r6 ! shld r0, r6 + shlr r6 tst r6,r6 bt/s 2f clrt