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.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, 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 1851FC4338F for ; Mon, 26 Jul 2021 16:43:07 +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 7E7F36044F for ; Mon, 26 Jul 2021 16:43:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7E7F36044F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:60870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m83h3-0001Gv-CN for qemu-devel@archiver.kernel.org; Mon, 26 Jul 2021 12:43:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m83gU-0000bE-Gr for qemu-devel@nongnu.org; Mon, 26 Jul 2021 12:42:30 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]:35769) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m83gS-0002WB-RC for qemu-devel@nongnu.org; Mon, 26 Jul 2021 12:42:30 -0400 Received: by mail-pl1-x62d.google.com with SMTP id f13so1833268plj.2 for ; Mon, 26 Jul 2021 09:42:28 -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=OmNB5RXGATOlLIiKW/9hNFqMg6QWlwIHlNi502M7MZQ=; b=I3/TRNXXqPFCsUPC7QMxibsrF5I+wHFavA8HCvS3B+9xCsmfp1Dds/Fnz82RVVqnjl orYMFqzkfcnR2OYdp9Cr0YQuY4P7gbe+XwuLl+k1Tpr002yqCMYl6w631jSfiyL3vvNo D11iYYV7rntGuMqozO2mTR+18VrRi3wgl5klci8mZ2lc1s6IZaSAkgS8Z/C28BL5q3LE rPw+j5IZfE63uYd+jbBgYUXavTsgQdQO1VdIes+6Y15yCPUXRJ9YTgPP9UIiN5PrDzZu rcH5H78KsnaIBdjxodsEdifPO+GadBLpmv4kC2MFwHTOTOtZTyGD67+126JvZ/Pgsq4x I8Pg== 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=OmNB5RXGATOlLIiKW/9hNFqMg6QWlwIHlNi502M7MZQ=; b=bQ/3MD0KkdMQNOm41sIb4GcZDQ5nApsm0beyYPiZKvuiJHL48/vM+/UcMbDfnYhVGn SO9T2NGQnhWmG4/vXMIcN+sJE/lkuLxculUIu7RudG34e61FTiJQiPCjIZWbdhhkU68y 57O/hfnJ2wjjPVgFVlkJYPp5W2eWC4e7DUKVOJyvFMKZlRoWipL8AJIbSfagFTsKU8qI 443QckYROSw7L3rq0PwWnE2kBJt6QqmNpk6BYvYLrhLotDkZ0yEl/9cU9wF7wAMm3O3u I9fZ0vLxW5kC2++Eoi4TSqEDcMyP40eFvwi+6HBduxnrvXP6yzDtoU8Y7d1U/fqS1Ktf AZJQ== X-Gm-Message-State: AOAM532erkViJ9x9+7SiR7eAS5GC6gg9sWKv1kpwxRWJTk2x2qFQHLxe VdluU28ho/HSmegaAE93h2Smeg== X-Google-Smtp-Source: ABdhPJw0pW5b8/Ae3tafoEq/uMa7nNQxw72cNVS4GJW57QjZmajyhPLrfKFNckErIiUmdXxNeWv+Uw== X-Received: by 2002:a62:e50c:0:b029:2f9:b9b1:d44f with SMTP id n12-20020a62e50c0000b02902f9b9b1d44fmr19390755pff.42.1627317747083; Mon, 26 Jul 2021 09:42:27 -0700 (PDT) Received: from ?IPv6:2603:800c:3202:ffa7:497b:6ae4:953c:7ad1? (2603-800c-3202-ffa7-497b-6ae4-953c-7ad1.res6.spectrum.com. [2603:800c:3202:ffa7:497b:6ae4:953c:7ad1]) by smtp.gmail.com with ESMTPSA id p53sm494887pfw.168.2021.07.26.09.42.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Jul 2021 09:42:26 -0700 (PDT) Subject: Re: [PATCH v2 12/22] target/loongarch: Add fixed point extra instruction translation To: Song Gao References: <1626861198-6133-1-git-send-email-gaosong@loongson.cn> <1626861198-6133-13-git-send-email-gaosong@loongson.cn> <7a500d72-7d16-1a02-2ede-5e07f1383812@linaro.org> From: Richard Henderson Message-ID: <67b93a73-466b-cbb6-89ce-1b1908d74898@linaro.org> Date: Mon, 26 Jul 2021 06:42:22 -1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.google.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 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, NICE_REPLY_A=-0.438, 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: peter.maydell@linaro.org, thuth@redhat.com, chenhuacai@gmail.com, philmd@redhat.com, yangxiaojuan@loongson.cn, qemu-devel@nongnu.org, maobibo@loongson.cn, laurent@vivier.eu, alistair.francis@wdc.com, pbonzini@redhat.com, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 7/26/21 2:57 AM, Song Gao wrote: > > Hi, Richard. > > On 07/23/2021 01:12 PM, Richard Henderson wrote: >> On 7/20/21 11:53 PM, Song Gao wrote: >>> +target_ulong helper_cpucfg(CPULoongArchState *env, target_ulong rj) >>> +{ >>> +    target_ulong r = 0; >>> + >>> +    switch (rj) { >>> +    case 0: >>> +        r = env->CSR_MCSR0 & 0xffffffff; >>> +        break; >>> +    case 1: >>> +        r = (env->CSR_MCSR0 & 0xffffffff00000000) >> 32; >>> +        break; >> >> Why do you represent all of these as high and low portions of a 64-bit internal value, when the manual describes them as 32-bit values? >> > This method can reduce variables on env. The number of variables may increase, but the memory consumed -- which is the metric that is more important -- is still the same. Also, it is much less confusing to match the description in the manual. r~