Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2573726rdb; Wed, 4 Oct 2023 05:37:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEmEzhpNF5k8fUuwcidyr985oeRAfIvDX4gtiBdoCyOtHj5D180ivB9tztgV7SL5sJz7jvR X-Received: by 2002:a17:902:ea8d:b0:1b8:2c6f:3248 with SMTP id x13-20020a170902ea8d00b001b82c6f3248mr2332767plb.39.1696423027254; Wed, 04 Oct 2023 05:37:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696423027; cv=none; d=google.com; s=arc-20160816; b=DVs7Au+60f9YwAsNeN1cFBuzar999hMl0W8CZMk6Fcj2g8qT7BqmY4cy5uWzTviY6V sH9aGcQsMnx2O2E+YRKsP4W7fbx0JGMfaG1YfNNdGLs1QjNlgveJB3H7A4qJiwLxCKK3 zPE89pH4yWGIFPtLYMUNqe+LWT8621vDrxNiXJOkgsoC/nY/dvVjceA2HP6oz+y3CExs DmSJrL6MoWjxBrliM7Q6z262YR2ATIH8dX4w/xdamVLwwEhvr6E1qnGeJ8c+aIahvaFV Aih38KcfrSP6slIqu7MvH/uFZwLwFlNagQDLhKbtKryKriOGsJqGk5TYjJROZmUJdKf2 QiwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=uYz/8HpYt26zKfRLp5C2vrFcfKb7Jd0O7eswsgHtnq0=; fh=LWwNeWFeooMBp7eX7u17eOGBpRWFjrwcafFie7RO8gg=; b=F9jIe1d60URlZP9OdQ9hxn98nl86ihn1FPBfYjW1UFBpwvepoWBStN3w3h86NY1iWK w6U5gzkUyZ9yzUypeXcpIJFtIksxNtMbVy3LD9I0uL+3yL+8zFTUchNM48Q2KebM5G5I S20R+ofOGYlkmjjBGBpOcPk3RGlBy+VHIwHFs5uZxLFyArRo8xwFi+TiOxqD29sb/V5a yCpGxiO6q3mhc8FsKunYvd8LGQ5/TiLb1uqE8mh4xPz43AgrOR63c7Jd67dmzFyxjQO5 pjxeXR3aLYPJEp92cuI8oBgPTVTelatBEFCHBl5BMpAIkXixe3K3pkneCZNXLmDSo8KK mNVg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id n2-20020a170902e54200b001b8a56b9895si3985085plf.616.2023.10.04.05.37.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 05:37:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 513988216915; Wed, 4 Oct 2023 05:36:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242426AbjJDMgp (ORCPT + 99 others); Wed, 4 Oct 2023 08:36:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242457AbjJDMfx (ORCPT ); Wed, 4 Oct 2023 08:35:53 -0400 Received: from icp-osb-irony-out4.external.iinet.net.au (icp-osb-irony-out4.external.iinet.net.au [203.59.1.220]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 99BC1E4; Wed, 4 Oct 2023 05:35:43 -0700 (PDT) Received: from gateway.pc5.atmailcloud.com (HELO mqr.i-08c0d97331176e550) ([13.54.26.16]) by icp-osb-irony-out4.iinet.net.au with ESMTP; 04 Oct 2023 20:35:35 +0800 Received: from CMR-KAKADU04.i-00e2aafc82f8e4b03 by MQR.i-08c0d97331176e550 with esmtps (envelope-from ) id 1qo16F-0002by-1P; Wed, 04 Oct 2023 12:35:35 +0000 Received: from [203.220.76.238] (helo=[192.168.0.22]) by CMR-KAKADU04.i-00e2aafc82f8e4b03 with esmtpsa (envelope-from ) id 1qo0eB-0005nQ-3A; Wed, 04 Oct 2023 12:06:36 +0000 Message-ID: <22caaecc-c954-d880-672f-45761bf7fac2@westnet.com.au> Date: Wed, 4 Oct 2023 22:06:29 +1000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH 09/17] m68k: Implement xor_unlock_is_negative_byte Content-Language: en-US To: Matthew Wilcox Cc: David Laight , "linux-kernel@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-arch@vger.kernel.org" , "torvalds@linux-foundation.org" , Nicholas Piggin References: <20230915183707.2707298-10-willy@infradead.org> <6e409d5f-a419-07b7-c82c-4e80fe19c6ba@westnet.com.au> <35a33582-9206-94bb-eca2-a1d9c585f6c1@westnet.com.au> <9d73b9e2-502e-4ef5-bb49-bc89d478329a@westnet.com.au> From: Greg Ungerer In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Atmail-Id: gregungerer@westnet.com.au X-atmailcloud-spam-action: no action X-atmailcloud-spam-report: Action: no action X-Cm-Analysis: v=2.4 cv=P7P8xAMu c=1 sm=1 tr=0 ts=651d554c a=1qi1FL2F0EdFFg+SXJ3Exg==:117 a=1qi1FL2F0EdFFg+SXJ3Exg==:17 a=IkcTkHD0fZMA:10 a=bhdUkHdE2iEA:10 a=80-xaVIC0AIA:10 a=x7bEGLp0ZPQA:10 a=8g8xS9MRXoAFlEb5IXsA:9 a=QEXdDO2ut3YA:10 X-Cm-Envelope: MS4xfAmUuvsILtV2K9sDwZC7fTHAJy9B8bsXj8FFb2QWx9qHYZfrqmuosXgYNdJncSBIxJksOu0m7jpqiLpP1/a4zgICWf3m2wymcwM7oLDbgG7NaJT/Pn8y L1cRWkaievwZGd5kr54HDH08FzyhIQCsHeV5DP7JVYumukb5Jes2ti+fcgYw2dtXG8jxpxqxOHzRgw== X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 05:36:50 -0700 (PDT) On 4/10/23 06:07, Matthew Wilcox wrote: > On Wed, Oct 04, 2023 at 12:14:10AM +1000, Greg Ungerer wrote: >> On 3/10/23 06:07, Matthew Wilcox wrote: >>> 00000918 : >>> 918: 206f 0004 moveal %sp@(4),%a0 >>> 91c: 7001 moveq #1,%d0 >>> 91e: b190 eorl %d0,%a0@ >>> 920: 2010 movel %a0@,%d0 >>> 922: 4a00 tstb %d0 >>> 924: 6a0a bpls 930 >>> 926: 42a7 clrl %sp@- >>> 928: 2f08 movel %a0,%sp@- >>> 92a: 4eba fafa jsr %pc@(426 ) >>> 92e: 508f addql #8,%sp >>> 930: 4e75 rts > > fwiw, here's what folio_unlock looks like today without any of my > patches: > > 00000746 : > 746: 206f 0004 moveal %sp@(4),%a0 > 74a: 43e8 0003 lea %a0@(3),%a1 > 74e: 0891 0000 bclr #0,%a1@ > 752: 2010 movel %a0@,%d0 > 754: 4a00 tstb %d0 > 756: 6a0a bpls 762 > 758: 42a7 clrl %sp@- > 75a: 2f08 movel %a0,%sp@- > 75c: 4eba fcc8 jsr %pc@(426 ) > 760: 508f addql #8,%sp > 762: 4e75 rts > > Same number of instructions, but today's code has slightly longer insns, > so I'm tempted to take the win? Yes, I reckon so. >>> We could use eori instead of eorl, at least according to table 3-9 on >>> page 3-8: >>> >>> EOR Dy,x L Source ^ Destination → Destination ISA_A >>> EORI #,Dx L Immediate Data ^ Destination → Destination ISA_A > > Oh. I misread. It only does EORI to a data register; it can't do EORI > to an address. > >> 400413e6 : >> 400413e6: 206f 0004 moveal %sp@(4),%a0 >> 400413ea: 2010 movel %a0@,%d0 >> 400413ec: 0a80 0000 0001 eoril #1,%d0 >> 400413f2: 2080 movel %d0,%a0@ >> 400413f4: 2010 movel %a0@,%d0 >> 400413f6: 4a00 tstb %d0 >> 400413f8: 6c0a bges 40041404 >> 400413fa: 42a7 clrl %sp@- >> 400413fc: 2f08 movel %a0,%sp@- >> 400413fe: 4eba ff30 jsr %pc@(40041330 ) >> 40041402: 508f addql #8,%sp >> 40041404: 4e75 rts >> >> But that is still worse anyway. > > Yup. Looks like the version I posted actually does the best! I'll > munge that into the patch series and repost. Thanks for your help! No worries. Sorry I didn't notice it earlier, but glad it is sorted now. Regards Greg