From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by dpdk.org (Postfix) with ESMTP id 09FA51B119 for ; Mon, 15 Apr 2019 17:44:48 +0200 (CEST) Received: by mail-pg1-f178.google.com with SMTP id v12so8783107pgq.1 for ; Mon, 15 Apr 2019 08:44:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EtxWETIg+KMoIWNAgi/ARyfW4cZCRbe0f2rO5Ig+Pck=; b=nwHOaxXo47ThLGqhv3ocBAcIN5tq0ucig+NeYvKLSK25bQmfcPVNMSDga7SLYAxjpk x/FrgOdDrS7Eicaxa3E1WNRZc+/rt6ouShZsoK2S0Lktigk/f+SvPZS209D4SIBNDZAw jyAt2QbwN3ZmqdiLtoUXNSCXktB+4XGHe7IzjJxia325dAjhe+ATXqdnx03J2YHCxCS6 kbQT7cinW8L1J6vhk6G6Isd3PeyPybbdmH6fvM5yc0FP4d5h6kftQasolOP2qebOxJyo QbDLvXaP5QZZDZQUff8PstJkKou78ZwZyjlzV/vOYKGZ6iT3YXOMvUnys/AAoLdtSLGr nKDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EtxWETIg+KMoIWNAgi/ARyfW4cZCRbe0f2rO5Ig+Pck=; b=MQ46eF8V0zi7uz8EbYO9p5uv1gDHzpbyuLDZ5FIvybGBKg5Sof3wA+khk/LI8VIm02 NDAFl9QIkVCoQaiN/spcaer3/2EYvkZ35phXdKX2LNn0OFBX8ZwHmKqz3aeTVKgvyxZM glMCWVifNhujOdbj+h7raul4zM2Jb+7R67gU2XOKW9Bfv3pT2yXyjosWrUUttLJK3aDq G8FNp951x16FekDDVoqOPN+X6K4c13r8oTk0/56yOJaJrVmjdNwZJC+FltcOOO448Fjo Z5RJQI10zU+BD3eSVgwIu+WYEWiKrQmCQbjV/iM2QtTThpQFrejb5qFSBWUPv1YBkFS1 QYFw== X-Gm-Message-State: APjAAAUI8HCBammxjReVmldwXKH9gwvU6nMG3KHjDBfMRmT3V1wT2OV5 g/dvhZ7p4a0EPbSpI8fgtBnDcg== X-Google-Smtp-Source: APXvYqx4lOdEfQqLjQ/Rlu+i5uVKf5iuuygXXLigVOZb50kdL+WeSKuar3hsqr2bNKKt5L/jWobeBQ== X-Received: by 2002:aa7:8c42:: with SMTP id e2mr75698853pfd.24.1555343087214; Mon, 15 Apr 2019 08:44:47 -0700 (PDT) Received: from shemminger-XPS-13-9360 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id r76sm58815559pfa.39.2019.04.15.08.44.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Apr 2019 08:44:47 -0700 (PDT) Date: Mon, 15 Apr 2019 08:44:44 -0700 From: Stephen Hemminger To: Cc: , , , Stefan Kanthak Message-ID: <20190415084444.30c10fba@shemminger-XPS-13-9360> In-Reply-To: <20190414052325.15984-1-pbhagavatula@marvell.com> References: <20190414052325.15984-1-pbhagavatula@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] eal: fix large multiple calculation in reciprocal division X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2019 15:44:48 -0000 On Sun, 14 Apr 2019 10:52:59 +0530 wrote: > + int64_t i; Since i only does 1..64 it can be int. > + uint64_t t; > + > + for (i = 1; i <= 64; i++) { > + t = x >> 63; > + x = (x << 1) | (y >> 63); > + y = y << 1; > + if ((x | t) >= z) { > + x = x - z; > + y = y + 1; From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id A61D4A00E6 for ; Mon, 15 Apr 2019 17:44:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9E4581B120; Mon, 15 Apr 2019 17:44:49 +0200 (CEST) Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by dpdk.org (Postfix) with ESMTP id 09FA51B119 for ; Mon, 15 Apr 2019 17:44:48 +0200 (CEST) Received: by mail-pg1-f178.google.com with SMTP id v12so8783107pgq.1 for ; Mon, 15 Apr 2019 08:44:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EtxWETIg+KMoIWNAgi/ARyfW4cZCRbe0f2rO5Ig+Pck=; b=nwHOaxXo47ThLGqhv3ocBAcIN5tq0ucig+NeYvKLSK25bQmfcPVNMSDga7SLYAxjpk x/FrgOdDrS7Eicaxa3E1WNRZc+/rt6ouShZsoK2S0Lktigk/f+SvPZS209D4SIBNDZAw jyAt2QbwN3ZmqdiLtoUXNSCXktB+4XGHe7IzjJxia325dAjhe+ATXqdnx03J2YHCxCS6 kbQT7cinW8L1J6vhk6G6Isd3PeyPybbdmH6fvM5yc0FP4d5h6kftQasolOP2qebOxJyo QbDLvXaP5QZZDZQUff8PstJkKou78ZwZyjlzV/vOYKGZ6iT3YXOMvUnys/AAoLdtSLGr nKDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EtxWETIg+KMoIWNAgi/ARyfW4cZCRbe0f2rO5Ig+Pck=; b=MQ46eF8V0zi7uz8EbYO9p5uv1gDHzpbyuLDZ5FIvybGBKg5Sof3wA+khk/LI8VIm02 NDAFl9QIkVCoQaiN/spcaer3/2EYvkZ35phXdKX2LNn0OFBX8ZwHmKqz3aeTVKgvyxZM glMCWVifNhujOdbj+h7raul4zM2Jb+7R67gU2XOKW9Bfv3pT2yXyjosWrUUttLJK3aDq G8FNp951x16FekDDVoqOPN+X6K4c13r8oTk0/56yOJaJrVmjdNwZJC+FltcOOO448Fjo Z5RJQI10zU+BD3eSVgwIu+WYEWiKrQmCQbjV/iM2QtTThpQFrejb5qFSBWUPv1YBkFS1 QYFw== X-Gm-Message-State: APjAAAUI8HCBammxjReVmldwXKH9gwvU6nMG3KHjDBfMRmT3V1wT2OV5 g/dvhZ7p4a0EPbSpI8fgtBnDcg== X-Google-Smtp-Source: APXvYqx4lOdEfQqLjQ/Rlu+i5uVKf5iuuygXXLigVOZb50kdL+WeSKuar3hsqr2bNKKt5L/jWobeBQ== X-Received: by 2002:aa7:8c42:: with SMTP id e2mr75698853pfd.24.1555343087214; Mon, 15 Apr 2019 08:44:47 -0700 (PDT) Received: from shemminger-XPS-13-9360 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id r76sm58815559pfa.39.2019.04.15.08.44.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Apr 2019 08:44:47 -0700 (PDT) Date: Mon, 15 Apr 2019 08:44:44 -0700 From: Stephen Hemminger To: Cc: , , , Stefan Kanthak Message-ID: <20190415084444.30c10fba@shemminger-XPS-13-9360> In-Reply-To: <20190414052325.15984-1-pbhagavatula@marvell.com> References: <20190414052325.15984-1-pbhagavatula@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] eal: fix large multiple calculation in reciprocal division X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190415154444.DEuTgs7_fA_PKzBRzTxrhVcSkgRM3pk3M8sOx3izBZY@z> On Sun, 14 Apr 2019 10:52:59 +0530 wrote: > + int64_t i; Since i only does 1..64 it can be int. > + uint64_t t; > + > + for (i = 1; i <= 64; i++) { > + t = x >> 63; > + x = (x << 1) | (y >> 63); > + y = y << 1; > + if ((x | t) >= z) { > + x = x - z; > + y = y + 1;