Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3899321ybi; Mon, 3 Jun 2019 02:07:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqz3e0idogZswpdKpxAZ/eR1pImZa6Pk+ZA/i7Wy0XUwFACVJcJiaccczidS4B6W7KlO1TML X-Received: by 2002:a17:90a:36c5:: with SMTP id t63mr28561307pjb.2.1559552873790; Mon, 03 Jun 2019 02:07:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559552873; cv=none; d=google.com; s=arc-20160816; b=nZjMPDX15uAfoUeiAFJhPs34NVPqLgqCoPJ5QNatxIDIhxJNWmz3rxus85+AQjIslY 76zhGy2LArQSHy4u11no146uZP+RfLxeqRxUEMERPxS0hmIqKKRKPX+J/JxHRNbsqrj0 RtMb140ejXa9WQGMAABxyY+As2tfDYymrlwrDc2BfhebeDxpA1s3DEOXWoJuY6RZeNBc SbB4fJPC/qbWjo0e7Rh+ID0LMSFV/B2H6irPhQLcJFTMRTE0Yp8ypGh5IFmvjaTphhDH UT8WPQRkBGtLBgI6k417m5ujEquwf99bPz9waXX8N6fwSuZ9M7/UlKYZFvGhkBav7CON nc8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :dkim-filter; bh=0GHg7hg1JH/Hx2kxrbu6qAah08w35aybr4V9aViVsPs=; b=Nh+jtXKMESXl7aaoMB7meAOCLiwZeeeJB2zDYtpL460fRo9r/eaLqvEr5HOSqVclFP 19ruUyKW/xIiExT+YNC/5TDRMMirrLSPfq74Mxg3J760pb3riXu4TGaIKw8WvBmabIQH w8/dcYOYSjHX37+m66uhHdDZMzOIBqq2v+WglsnIMSODFliC5xNc18qb3EkypesnvZrG Dpt/e2z1aj24vN9zmaOot32B+4mI/Go5RZ8zOyuom5yTQh46iS8jeGwqnHEcZIX1PKr2 Z4NNWazNGK8QarJ9DoDnq4JtS2VuOI2vS8lVw7AB1FldI+4R4yp8uyxPyhRfxVlxa/se 6UDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=lGn1PjZY; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i5si18455088pfr.52.2019.06.03.02.07.39; Mon, 03 Jun 2019 02:07:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=lGn1PjZY; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727856AbfFCJHR (ORCPT + 99 others); Mon, 3 Jun 2019 05:07:17 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:45436 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726792AbfFCJHR (ORCPT ); Mon, 3 Jun 2019 05:07:17 -0400 Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20190603090715epoutp0291f0281ca9c883ae799672f51dd6d19e~kpQqGBNBK2326923269epoutp02H for ; Mon, 3 Jun 2019 09:07:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20190603090715epoutp0291f0281ca9c883ae799672f51dd6d19e~kpQqGBNBK2326923269epoutp02H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1559552835; bh=0GHg7hg1JH/Hx2kxrbu6qAah08w35aybr4V9aViVsPs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lGn1PjZYLnokgyXaEvwvtM4F63sHOvSvvFJLJqKf4HbPC2/7OD1bQzAm5MNe6BsWL SgP2UIvqV3FdlJ3j0hjsodd5uuwzrejCxz6SwG+uW3ulhS6HiZLfpjeGYhJd9oNxdI IoOmy5/puV1dyvBtkQxgwaGpKvjgFMSaPW7jmP3o= Received: from epsmges5p1new.samsung.com (unknown [182.195.40.192]) by epcas5p1.samsung.com (KnoxPortal) with ESMTP id 20190603090712epcas5p1623502192e828555f940641b348af16a~kpQngs8y73073330733epcas5p1W; Mon, 3 Jun 2019 09:07:12 +0000 (GMT) Received: from epcas5p1.samsung.com ( [182.195.41.39]) by epsmges5p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 57.73.04071.043E4FC5; Mon, 3 Jun 2019 18:07:12 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPA id 20190603090236epcas5p1bf0733024f7fb52f8129157b11c8f882~kpMlyvevu3216432164epcas5p1b; Mon, 3 Jun 2019 09:02:36 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20190603090236epsmtrp26a9c8d81f8a8876b2141a4b84defcf78~kpMlxyRk32094820948epsmtrp2M; Mon, 3 Jun 2019 09:02:36 +0000 (GMT) X-AuditID: b6c32a49-5b7ff70000000fe7-5a-5cf4e3406010 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 95.FB.03662.B22E4FC5; Mon, 3 Jun 2019 18:02:35 +0900 (KST) Received: from localhost.localdomain (unknown [107.109.224.135]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190603090233epsmtip2905b22e825a6e9007111de59c0c0ff5b~kpMjufs1l1650516505epsmtip2m; Mon, 3 Jun 2019 09:02:33 +0000 (GMT) From: Maninder Singh To: akpm@linux-foundation.org, herbert@gondor.apana.org.au, davem@davemloft.net, keescook@chromium.org, gustavo@embeddedor.com Cc: joe@perches.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, a.sahrawat@samsung.com, pankaj.m@samsung.com, v.narang@samsung.com, Maninder Singh Subject: [PATCH 2/4] zstd: use U16 data type for rankPos Date: Mon, 3 Jun 2019 14:32:04 +0530 Message-Id: <1559552526-4317-3-git-send-email-maninder1.s@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1559552526-4317-1-git-send-email-maninder1.s@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA01SW0wTQRTNdLdli1Q3ReOISppNqpEEbNHWxYjiI7iCiUS/NGjdwIQ2ttu1 W1D8qgYfrVFRUQHrW1SKgEFAUyBY6gOfxAcoMSIR9UMNVKkgosaWLdG/c86cM2dy5xKYskQW R5g4O7JxrJmSReON/jmzE9P6gtmay26SftqEaHftVRnt7ijC6YZmNb3/0wz65Ns+nH6030K/ 7RmR0M+9bhntP7MHp3u+NEjotvunQFoMc9LxFGfqK7slTI1PzTTeUjPtpaM4E/R0YczBeg9g Buvis4gN5kVGxOYimwpxOdZcE5eXSmWuMyw36PQabaI2hV5AqTjWglKpFauzEtNN5tBDKVUB a84PSVmsIFBzFy+yWfPtSGW0CvZUCvG5Zl6bzCcJrEXI5/KScqyWhVqNJlkXcm42G7vOVUl5 l3z7j2EH7gD9MheQE5CcD/tLy4ALRBNKsgnAnSNXokTyDcAOrx8TyRCAx6teYOORGz9/RVwt AFbuPSoRyXcAXX+ugbBLRiZBj7cZDx9MJh0A9nQeHmvBSB+AH/ZcGHPFkjQs7Xk9hnFSDbve vJOGsYJMh0crnEDsi4fdT5yhboKQkyvhw9aV4Xsg+VwGLwb9Ec8KeL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kziuffyxSSCA9sSQ1OzW1 ILUIJsvEwSnVwOhSfbdV3XmFnq3qk4TNjNcf+qwTPGp90ivvufbvrR23EjedWrBq3jbhlMCQ fUnV55/oS7PyCDy7I6PGq+R39d+uBbwKAZM3KTjLH2gW3KpQLryBd3tM2C7hbX0sHEpLq6wn dwXo55ent3e+nrWq6eLO+blZOw2cw5+qyAtxCYgYTfgiFt8cpMRSnJFoqMVcVJwIAAf5WOpa AgAA X-CMS-MailID: 20190603090236epcas5p1bf0733024f7fb52f8129157b11c8f882 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20190603090236epcas5p1bf0733024f7fb52f8129157b11c8f882 References: <1559552526-4317-1-git-send-email-maninder1.s@samsung.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org rankPos structure variables value can not be more than 512. So it can easily be declared as U16 rather than U32. It will reduce stack usage of HUF_sort from 256 bytes to 128 bytes original: e92ddbf0 push {r4, r5, r6, r7, r8, r9, fp, ip, lr, pc} e24cb004 sub fp, ip, #4 e24ddc01 sub sp, sp, #256 ; 0x100 changed: e92ddbf0 push {r4, r5, r6, r7, r8, r9, fp, ip, lr, pc} e24cb004 sub fp, ip, #4 e24dd080 sub sp, sp, #128 ; 0x80 Signed-off-by: Maninder Singh Signed-off-by: Vaneet Narang --- lib/zstd/huf_compress.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/zstd/huf_compress.c b/lib/zstd/huf_compress.c index e727812..2203124 100644 --- a/lib/zstd/huf_compress.c +++ b/lib/zstd/huf_compress.c @@ -382,8 +382,8 @@ static U32 HUF_setMaxHeight(nodeElt *huffNode, U32 lastNonNull, U32 maxNbBits) } typedef struct { - U32 base; - U32 curr; + U16 base; + U16 curr; } rankPos; static void HUF_sort(nodeElt *huffNode, const U32 *count, U32 maxSymbolValue) -- 2.7.4