From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f41.google.com (mail-pg0-f41.google.com [74.125.83.41]) by dpdk.org (Postfix) with ESMTP id 5D4A7137C for ; Tue, 29 Aug 2017 21:38:03 +0200 (CEST) Received: by mail-pg0-f41.google.com with SMTP id b8so13537410pgn.5 for ; Tue, 29 Aug 2017 12:38:03 -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=oXNADimMEFA8WI6SzaBLKj5nzLq5qBb3khQT9IxttTI=; b=tJHOfV/8mjO/m4jgXWQSjV7QoRsoFilvTtkiIOnXRVPmBRDXGp7j0ZLvwqq7B6YbFE 6+q+Ukt0gljZrfN5liGwKFQHd2TOPwZWcJzagNRU68Np9ZZSDvpJEcRmKsN+467w4pnT 6T8k5KOLiPyIlu3TZDIF4dGfKIgdWAjTDQepk9QEaVwJCSbCbqfLp14xJyEY/h7Kfq2U mnxiMBsI/rskgbmxVzROI57ApZGwn9KJenAPC1DuBgYPh7Ylq13PFWZvZ/cqbnxTVpt3 Zq2lk6czxQK+vtgRMXVDXVyn8JcODbt1WVUH05yTGHf4wC6EimaPXPH7AIfolmPRXbTv y/TA== 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=oXNADimMEFA8WI6SzaBLKj5nzLq5qBb3khQT9IxttTI=; b=LXPufaaQ1Bsg+9WmDL7vzswkAeaJV9AbwmJumxh+UGADMh7hHaf+qV3MORidQTiECH OkcFeg4xhLt9Hxf6PFPbDIpd5a/ks0/3vLJcM4gxaLaSFZIyOBUzfSzZr/mEJ1yeBwLv bGDjJzdRnrlp3Oz8h6BMYTRqVfXpWzFABi7vuvMy5IiqaJG44nk7FM8MBOqdDkOChKR3 E0qeMh/zIx/qLgeNIfDNjsUz/3vJjMrkNKzEcVEz0od0+uDvWPI/4IQLEml9p5OsUKAk oH/xhI2j0m3iO7w+f+jfDYTJe4OxTFnxx3EJGtiQWEq1460pIHuAIZmL+03jSCJzjASz HQQA== X-Gm-Message-State: AHYfb5ihM+sxObk9TE1xGemosA1GUV4hc/JbC+sVvkVSC1HLPUTmcEDz I/Mm2OHuqAn1lWcJ X-Received: by 10.84.232.129 with SMTP id i1mr1715559plk.399.1504035482633; Tue, 29 Aug 2017 12:38:02 -0700 (PDT) Received: from xeon-e3 (76-14-207-240.or.wavecable.com. [76.14.207.240]) by smtp.gmail.com with ESMTPSA id d12sm7256092pgn.53.2017.08.29.12.38.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Aug 2017 12:38:02 -0700 (PDT) Date: Tue, 29 Aug 2017 12:38:00 -0700 From: Stephen Hemminger To: Pavan Nikhilesh Cc: dev@dpdk.org, cristian.dumitrescu@intel.com Message-ID: <20170829123800.066ee293@xeon-e3> In-Reply-To: <1504032378-5483-2-git-send-email-pbhagavatula@caviumnetworks.com> References: <1504032378-5483-1-git-send-email-pbhagavatula@caviumnetworks.com> <1504032378-5483-2-git-send-email-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 2/2] eal: add u64 bit variant for reciprocal 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: Tue, 29 Aug 2017 19:38:03 -0000 On Wed, 30 Aug 2017 00:16:18 +0530 Pavan Nikhilesh wrote: > +static inline uint64_t > +mullhi_u64(uint64_t x, uint64_t y) > { > - uint32_t t = (uint32_t)(((uint64_t)a * R.m) >> 32); > + __uint128_t xl = x; > + __uint128_t yl = y; > + __uint128_t rl = xl * yl; > + return (uint64_t)(rl >> 64); > +} Cast in return not necessary. And cast when setting t not necessary. Please blank line after declarations. Also you don't need to cast both sides of multiply. Some compilers maybe able to optimize 128 bit * 64 bit.