From patchwork Wed Jun 13 12:55:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 138469 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp703597lji; Wed, 13 Jun 2018 06:10:02 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIFCtSU88Wmhyx4tXM1AFZMSboFCCvRSgzxwkwAhLRWY2I6DrN3tI3LFY5quK4eGuW4ogS8 X-Received: by 2002:ac8:1342:: with SMTP id f2-v6mr4449419qtj.25.1528895402863; Wed, 13 Jun 2018 06:10:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528895402; cv=none; d=google.com; s=arc-20160816; b=qhZZOQPyoJkRWdUEjR3vRWLvcog/CaVQhGbGDOwrCP1FV/GLoJqEbHwaeLpX7NtQUM F3L9klhu1/BQUZOAPHpTqy+vSFTSOaYnN1SM0+PdhF9n7BTxA+yMFaGKpe2s4GgnYukp jDiXl8rhIUj90SFIOYuB1htdgSRIzzoG3rFEcedUThD6HSWA+3fBDsn/YO7kDQx4Y3nx OTz2U1/h7tfP1C9QRxZNHusVi/fMKXZ/yZ/iRf+EGtQQ/EzD0jUfdS+URb88uIVcpY+5 FzRy74bc7I+++SRz1epJ8hDf6Q7kv2qDaRguwCJtvYOamrF1eKxKlYnlK64Tfv+LAPCN 8WLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=Uth4Ys8aYr8FACWERzidZ+kd8JZrxlxpRTXWTNIlyrE=; b=Zs9FgnvSfzcLA2h+9WclOuASjQ/092fe/EuuasCmRmPRw3U9niJ6zYSTS36plXoFIQ EwUGMqDpZDWiuhssjZbBVltIU/qsrImS6sy/t2vCHTXw2D48ThkMecoZ9CejFeTB5QVI xOOc86wxrgpy6+uv99seim77iPbJP5+oTrB55S8VxbYOKI8wQkeJihLkR1FjqXNrk2y2 lOcMW2IYAiislKZJyJVwayEtbsB+ba+Vc1WAYkDf+XTZ5+PIPycPIfT5YSVj1DngeVoi P2nVJSQE9qRtXKG7VzRH3I+ZCpOp+LptlI3Fx8pg++/5jwDgh2NDqf8/9KxqQEoaIIzN ZZMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="SR/e8YKr"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id f14-v6si2500291qth.207.2018.06.13.06.10.02 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 13 Jun 2018 06:10:02 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="SR/e8YKr"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34108 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fT5XG-0005Ym-8i for patch@linaro.org; Wed, 13 Jun 2018 09:10:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fT5Jx-0002l7-Fz for qemu-devel@nongnu.org; Wed, 13 Jun 2018 08:56:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fT5Ju-0005GY-3u for qemu-devel@nongnu.org; Wed, 13 Jun 2018 08:56:17 -0400 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:42679) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fT5Jt-0005Ev-Ua for qemu-devel@nongnu.org; Wed, 13 Jun 2018 08:56:14 -0400 Received: by mail-wr0-x242.google.com with SMTP id w10-v6so2645484wrk.9 for ; Wed, 13 Jun 2018 05:56:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Uth4Ys8aYr8FACWERzidZ+kd8JZrxlxpRTXWTNIlyrE=; b=SR/e8YKrX19lZs5Xdiqc0isonzk3Iva2jQCnZpKYEYyMp315GkLP2QJMaAR9jr90TR vLA7XKr/xW6GFSH7uB8c8hPqp64tTDg7s46+0w63JHFeNKvKPCou+5UuIviUjq1n5Dzk ufk2HfPO58cGFewSWhGgQPPwO2Mika1ohbmug= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Uth4Ys8aYr8FACWERzidZ+kd8JZrxlxpRTXWTNIlyrE=; b=ALIAcPoe8BOJG8CyKwtsbbMzG4SbPoXPDhOlgBLWwr5QSsWdZNMSs2quhzFSo9+U1Z nSwBA87ZhQNYAsRC0pWGUJmNEXDJlAHtmqH1IpSUWDFtSp+8d5rNW7s04P9gi063uxX6 O425OLilSAbguT1ga8FeORsHwYdZ5K5ZErMfu5aaEtqjSR1XIeiHirjMGeTxMijKMmuG zBUy5iRJ6EzBtFZ2ve3AmHrW7XmxARrhlKweft1EZmD5Z2IUalbpxz8ezzsFCCft/3Y9 6nsTHN340h02orDKdv/bgVs2ayBwqHN3bjTWXmmq2tRU5HO76+iP7M4mBJCpQAGnGdJR 4W+w== X-Gm-Message-State: APt69E0IfuNOzM+tb2VtpZkiEzIeWs+7Y2dV29OYirAEiNVMBC+NEPbs Iv0/qrHt6G6cbYRdcs+Sm8ZS74LMwjk= X-Received: by 2002:adf:a3c3:: with SMTP id m3-v6mr3894552wrb.208.1528894572781; Wed, 13 Jun 2018 05:56:12 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id t17-v6sm3574692wrr.82.2018.06.13.05.56.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Jun 2018 05:56:07 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id B86393E126F; Wed, 13 Jun 2018 13:56:01 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Wed, 13 Jun 2018 13:55:50 +0100 Message-Id: <20180613125601.14371-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180613125601.14371-1-alex.bennee@linaro.org> References: <20180613125601.14371-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::242 Subject: [Qemu-devel] [RISU PATCH v3 11/22] risugen: add dtype_msz address helper X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-arm@nongnu.org, richard.henderson@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson Signed-off-by: Alex Bennée --- risugen_arm.pm | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.17.1 diff --git a/risugen_arm.pm b/risugen_arm.pm index 696bf5f..8d423b1 100644 --- a/risugen_arm.pm +++ b/risugen_arm.pm @@ -765,6 +765,15 @@ sub write_get_offset() write_risuop($OP_GETMEMBLOCK); } +# Return the log2 of the memory size of an operation described by dtype. +sub dtype_msz($) +{ + my ($dtype) = @_; + my $dth = $dtype >> 2; + my $dtl = $dtype & 3; + return $dtl >= $dth ? $dth : 3 - $dth; +} + sub reg($@) { my ($base, @trashed) = @_;