Received: from eggs.gnu.org ([2001:4830:134:3::10]:41532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQ7Pd-00026R-Tj for qemu-devel@nongnu.org; Thu, 21 Jul 2016 02:24:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQ7Pa-0008Jr-I3 for qemu-devel@nongnu.org; Thu, 21 Jul 2016 02:24:49 -0400 Sender: Richard Henderson References: <1468346602-20700-1-git-send-email-nikunj@linux.vnet.ibm.com> <1468346602-20700-6-git-send-email-nikunj@linux.vnet.ibm.com> <20160718020449.GK16769@voom.fritz.box> <87fur7pm7e.fsf@abhimanyu.i-did-not-set--mail-host-address--so-tickle-me> From: Richard Henderson Message-ID: Date: Thu, 21 Jul 2016 11:54:39 +0530 MIME-Version: 1.0 In-Reply-To: <87fur7pm7e.fsf@abhimanyu.i-did-not-set--mail-host-address--so-tickle-me> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC 5/6] target-ppc: add modulo word operations List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikunj A Dadhania , David Gibson Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, aneesh.kumar@linux.vnet.ibm.com On 07/18/2016 10:38 AM, Nikunj A Dadhania wrote: > David Gibson writes: > >> [ Unknown signature status ] >> On Tue, Jul 12, 2016 at 11:33:21PM +0530, Nikunj A Dadhania wrote: >>> Adding following instructions: >>> >>> moduw: Modulo Unsigned Word >>> modsw: Modulo Signed Word >>> >>> Signed-off-by: Nikunj A Dadhania >> >> Hrm.. any reason you're not using the TCG inbuilt remainder ops >> (tcg_gen_rem_i32() etc.)? > > I have an updated version with me which uses inbuilt ops, i was searching > for modulo expressions, which I didn't find, so wrote. Found later that > it is called tcg_gen_rem. Will send in the next version. It would probably be better to use helper functions for both div and mod, because of the branches required. C.f. target-arm/helper-a64.c, helper_sdiv64 et al. r~