Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1772049yba; Fri, 10 May 2019 00:23:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqyRpawGZn8tiZ6d0lwQoo0NmN7qq1eEB6QV8xwNysL6VU0DnxUhnCD1GGQjMtKnGgMmzezR X-Received: by 2002:a17:902:f096:: with SMTP id go22mr11389844plb.49.1557473000652; Fri, 10 May 2019 00:23:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557473000; cv=none; d=google.com; s=arc-20160816; b=HHEdWTsprV6/bkmdZcP8WkIxsZSFQvkVvyKZM7wRe2p5KWwfdd654Fp3ygTZ8T1IS1 1RC+g2N3lGDto+nl5AYwGJOf42LLVU7j1HFxjvleJIqte0OBf4STyZfsek0e/gDLZxzo HbefySYy0XnGIJmdo80/tTQNQ7cLvhZNIuC0qmN3B9FS+6FsStoESzxwX9Z51YyPwDCq 48HmMTgd1r8P5yr7+bSgkPpVfJk7ekD13hz9iIXUK9XpK/PadN904UlxTGKEFT3TlspB ploB59oORczd7aSa8v9RFxr3HWTWfTOv5i78D4g8Sr/RkzyBuhVRALwJeTkWi56klf7j QY7w== 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:message-id :date:subject:cc:to:from:dkim-signature:dkim-filter; bh=0GHg7hg1JH/Hx2kxrbu6qAah08w35aybr4V9aViVsPs=; b=VQa6whnPWJbDxYZqFvBgjGeY0FLCWkt8m1+z97/9k6Lwsnc2l+KTWEus/W2C4DpxE2 BLP7/3TxmS8ZpM4Y4ahEO5iRWtjFAlJlm//WIvrsYzYm+1oedcf/8e/QIqZQxbJUz6N8 LVFdQxZ/9QPfEEP+7YurZyrZ5FRbDLxx/L451d0STM02PNLtRhtM1bBPsFN+KwdmcwJy He1xDCHrg7AX1r0uj1Urji4iNqaAQW8KgRXXQSDC23E537N5IY8zWfDVcf4BKhQY36xW Bv+Z1eHZiZu2krt9bogZ+PqVTWu75Nd7OZBP3M8PoQ4mgjrBZwzu2KyMTNh7fx8I+J/X PH7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=bYXJGAYT; 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 y34si5314333plb.434.2019.05.10.00.23.00; Fri, 10 May 2019 00:23:20 -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=bYXJGAYT; 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 S1727294AbfEJHV6 (ORCPT + 99 others); Fri, 10 May 2019 03:21:58 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:35977 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727225AbfEJHV6 (ORCPT ); Fri, 10 May 2019 03:21:58 -0400 Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20190510072155epoutp044be737075f960ed599e077941d73dcbe~dQV1-FGhy1831418314epoutp04d for ; Fri, 10 May 2019 07:21:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20190510072155epoutp044be737075f960ed599e077941d73dcbe~dQV1-FGhy1831418314epoutp04d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1557472916; bh=0GHg7hg1JH/Hx2kxrbu6qAah08w35aybr4V9aViVsPs=; h=From:To:Cc:Subject:Date:References:From; b=bYXJGAYT85TwR7MMryABJh+YY5gqdJBzz2lYzSlZpIgAWShlcbDxKpbQQW7CSCG4z 08r2MaKwxExPvVXl9YcWVukd7YvVR973XhAuz/BKlrO46kl/FTRQVKT9Qx8rpSDTG/ 3iyiWVcVZBGz8uRCsZMHeWxAIBDTE7K5lUZJdrP4= Received: from epsmges5p3new.samsung.com (unknown [182.195.40.193]) by epcas5p1.samsung.com (KnoxPortal) with ESMTP id 20190510072154epcas5p109db6ea89ab70e5b214436f6dff7fca6~dQV0USwuU3047530475epcas5p1E; Fri, 10 May 2019 07:21:54 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmges5p3new.samsung.com (Symantec Messaging Gateway) with SMTP id 2D.BB.04067.29625DC5; Fri, 10 May 2019 16:21:54 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p3.samsung.com (KnoxPortal) with ESMTPA id 20190510061418epcas5p3679447cedd01f3ec70139f79ac7bcca1~dPazciaV32280722807epcas5p3V; Fri, 10 May 2019 06:14:18 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190510061418epsmtrp14aaaf105d4d2f8ab03548bbbe07e9a1d~dPazbvThh0714207142epsmtrp1J; Fri, 10 May 2019 06:14:18 +0000 (GMT) X-AuditID: b6c32a4b-78bff70000000fe3-59-5cd526922ef3 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 35.36.03692.AB615DC5; Fri, 10 May 2019 15:14:18 +0900 (KST) Received: from localhost.localdomain (unknown [107.109.224.135]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20190510061416epsmtip290cabd8939c2be6a25e4ab8ae7a48a7f~dPaxVZ6e51223912239epsmtip2h; Fri, 10 May 2019 06:14:16 +0000 (GMT) From: Maninder Singh To: terrelln@fb.com, herbert@gondor.apana.org.au, davem@davemloft.net, keescook@chromium.org, gustavo@embeddedor.com Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, a.sahrawat@samsung.com, pankaj.m@samsung.com, Maninder Singh , Vaneet Narang Subject: [PATCH 2/2] zstd: use U16 data type for rankPos Date: Fri, 10 May 2019 11:43:59 +0530 Message-Id: <1557468839-3388-1-git-send-email-maninder1.s@samsung.com> X-Mailer: git-send-email 2.7.4 X-Brightmail-Tracker: H4sIAAAAAAAAA02SaUhUURTHufPeLC5Tj2k7WcrwcII0bcaa6VYuUSED+kEIKmLKXnoZpdl4 b8a2D01llkpZttBimlSUFi2mZprlVtFie5YNWpAVmU2omIUUzfMl9e13/ud/7v9y71FRmmF5 mCrb4Sa8g7OximC6tnVmVEzxjJcWve+BEj9tILjkcS6Na27ocGHvdPyw0I7fdv+U4ef1JQrc WpZH4+6+Ghnu/d2hwC33TqBFIebj3qe0ubqiU2a+2Kwz79/hV5prm3TmvdWVyDxYFZGmXGWL zyJcJuG1xJHhzMx2WBPYlGXpS9KNJr0hxjAfz2O1Ds5OEtilqWkxydm2wPVYbQ5n8wSkNE4Q 2NmJ8bzT4ybaLKfgTmCJK9PmMsS5YgXOLngc1tgMp32BQa+PMwaca21ZHeXn5a6CoI0/hr20 F/kVBUilAmYu1DQuLEBBKg3TgMBbCBIPIPB/tBSg4AB/R+ArG0Jj/r6etZLeGPCUtiulYgjB heP5CnFawcRCZf0NWuSJTA6cvH5TLpoopgnBkP8KJTYmMBi2595RikwzOhh4tkcpJqiZZGiv 2CLKwERA56N8SpwF5oICzua3UVJjKXTknZZJPAF671YrJQ6Dz0V5SmlgF4JXRztoqTiIIP9b xV9XErx7fXs0jWJmwqX62ZIcDofuXxw9lGLGwZ6Rnr8BaqgrHWMd5HZelks8DQb7+2mJz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+Nik/qlBYxDmHZ2fUssfvvvf/SlPqf9K8mUNwaufsWy8X XRQ88Lc717NTiaU4I9FQi7moOBEA0G2ajDYCAAA= X-CMS-MailID: 20190510061418epcas5p3679447cedd01f3ec70139f79ac7bcca1 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: 20190510061418epcas5p3679447cedd01f3ec70139f79ac7bcca1 References: 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