From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2B1CC433E7 for ; Fri, 10 Jul 2020 18:32:12 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 885992075D for ; Fri, 10 Jul 2020 18:32:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="JKdSa4Cz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 885992075D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:50494 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jtxoh-0004Fd-RK for qemu-devel@archiver.kernel.org; Fri, 10 Jul 2020 14:32:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44812) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jtxmz-0002q5-Gi for qemu-devel@nongnu.org; Fri, 10 Jul 2020 14:30:25 -0400 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:42348) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jtxmx-0005vo-Um for qemu-devel@nongnu.org; Fri, 10 Jul 2020 14:30:25 -0400 Received: by mail-pl1-x643.google.com with SMTP id q17so2583319pls.9 for ; Fri, 10 Jul 2020 11:30:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=55fervx1vglqX/eRq5XewgkmlGkG0e3dJxxsm7oIer8=; b=JKdSa4CzV1Vb/PY2RQfhpsUtCPP7WuaAkU00Pqjc5yGzB1rbzPelFZlnfxhJcvB4fr ukru2lR2Tk9VUjf09sDURScBv9wvIWHzQoHZBtet90DoNxKvJJq+6MdWqCHQq5tDNgwN Wrf22W+L895/9j9VIyHPu5znbOj8e9wELjZRKEBdzOI/BZmEO8ZtTnh/URQ0pj9ERg9Q 6F6Ch5Esdl7qJKJGuu2BvXX9WXjEGkhJ/t8pV5UoDXh6M0vTCFlgQmOHXq3l8aDNUXC+ TSPjHFzYzMjRuzddk3TYBP6hZRQpoC2xD/TbDE97LKiiOoKwbGzprs866h2ZoPL3Ww+N UubA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=55fervx1vglqX/eRq5XewgkmlGkG0e3dJxxsm7oIer8=; b=bCziiDJfrNAPtXBuFChDmfCv4yOi4OYjlgmWY1W/MVGydvXt/OhTNkZQPVrPuCtRA/ NLlsfUgg37d75kQJvbFhA8tTgDjSjZ5uv2xVVxGMAToDINhrzgyDJi3HdE1LgW0UH2Fa 5G3/J+iAo/MvD6nRUTiyOElDT99jOwevjwT/PEyw+Uzmb5EYhelNf1OLBXlUDA+qhHLs eAfPPu97SldSHrO5ZcKYFK+uUfl7IelDh39MHByGR48O3bkAxf8aAcqboi6HJDB2tuB1 CCZQ28/FLkMvyTHPry8dtJCxOtuBNAbttz4tCjH+z4O6DSoNLJjosBQXAv0gr3zvX5Tf VucQ== X-Gm-Message-State: AOAM530yLent7wYau2cDrKQOKi0Fd13d+ZKmOTP1ETtjDtOPVtwgCNuX 4d2l0L+bDkbtobt27Yi+TlmmPw== X-Google-Smtp-Source: ABdhPJzRsps83aoPEgdB7Yg3OpXKRpgdLJe7HkIGVSEbI7E10B6pJ0z0xoxgBXu1s6FG9665SUTYbg== X-Received: by 2002:a17:902:8d89:: with SMTP id v9mr59012074plo.191.1594405822531; Fri, 10 Jul 2020 11:30:22 -0700 (PDT) Received: from [192.168.1.11] (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id a11sm6250784pjw.35.2020.07.10.11.30.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Jul 2020 11:30:21 -0700 (PDT) Subject: Re: [PATCH] disas/riscv: Fix incorrect disassembly for `imm20` operand. To: Wei Wu , qemu-devel@nongnu.org References: <20200707154336.4963-1-lazyparser@gmail.com> From: Richard Henderson Message-ID: <42554d7a-4c7b-af82-14cd-d448aab98bb3@linaro.org> Date: Fri, 10 Jul 2020 11:30:19 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200707154336.4963-1-lazyparser@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::643; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x643.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: palmer@dabbelt.com, Alistair.Francis@wdc.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 7/7/20 8:43 AM, Wei Wu wrote: > static int32_t operand_imm20(rv_inst inst) > { > - return (((int64_t)inst << 32) >> 44) << 12; > + return ((int64_t)inst << 32) >> 44; > } There's no point in casting to int64_t, for one. But it would be better to use sextract32(inst, 12, 20). r~