Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3319127imw; Wed, 6 Jul 2022 22:47:31 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ulCA1BY4g5fiV8H30cViJwX8Uj94hZVXBhF8ItJKq1MAQrGxFkwkFm2dqsOKKMsUzCR8mR X-Received: by 2002:a17:907:8a14:b0:72a:facd:c058 with SMTP id sc20-20020a1709078a1400b0072afacdc058mr6549082ejc.666.1657172850710; Wed, 06 Jul 2022 22:47:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657172850; cv=none; d=google.com; s=arc-20160816; b=YlFj49GhFxqPdSVu23siIvACwFX8zwz1uXAAXWC3dFAAIko0N45NGn/vSWl+5Z01Wx 7lheLKNvVKInMxOYwpoeLQdL54oxAIknJyRb+aurJbIDBeJUT/1TjAmr1QsOpBgY6rlZ p+AZuGCwfvAZx3mifEjpt0SLLusetjrDTX7X9ZHi05chWyaedNgKvwHZ58skRhS8p6cV RO5B2MLOCBgJQgpHczgyoHJnnOqUWCSSzTEFC1001nhzxckjhxlkuJpULwACAJT4UhFL /KDO7aqbACteSgExNEnDFsa4SR8nSg2l6xZbx/AUOh1zyV1Vn3g/YJewcnPHezC8gK7M sKvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=PkZOW4QFK7CB4uvj+cb1ItMmrxw5FVGhOBDC8Kf6J4Q=; b=fE3ivhovM6/xtneeQP2B4UJedyri0++L8GkGGq5uSZvvsubvTjFrH0Z792NUaDqaC/ npPUvRRckKOuOxzLrzw+S1ycsZPiQvK98fbOGLFjRgGqLQZyhQNYc+cZ1x8xSOBsARW3 9nsvcjCdJzyi7Hg3d3u6hzKfOtDEchH4U7DBuPjU3E2Jw1aiNrFytX/a3vBB9laEciO9 YhBmA3poFRBxqdJ5FuZoajrGHUu8uRNbzYCV+DKiMXMSuC8JYUnxI2YSMhfpWJzMUwgq kFPcnBwF/r9gGyB4mbyR7xRH93zVQ0g3yuTlNDM29K8bRKxGMwO6Px2u6A4BCTF6iuDT aFiQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u8-20020a056402110800b0043567906342si30496776edv.163.2022.07.06.22.47.05; Wed, 06 Jul 2022 22:47:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232893AbiGGFnK (ORCPT + 99 others); Thu, 7 Jul 2022 01:43:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbiGGFnI (ORCPT ); Thu, 7 Jul 2022 01:43:08 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A028B31207 for ; Wed, 6 Jul 2022 22:43:06 -0700 (PDT) Received: from [198.18.0.1] (unknown [192.168.200.1]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Dxj9JjcsZi224OAA--.1647S3; Thu, 07 Jul 2022 13:43:00 +0800 (CST) Message-ID: <6b501500-793f-5ba5-e21e-47c18342c21f@loongson.cn> Date: Thu, 7 Jul 2022 13:42:59 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v2] LoongArch: Clean useless vcsr in loongarch_fpu. Content-Language: en-US To: WANG Xuerui , Jiaxun Yang , Xi Ruoyao , Huacai Chen Cc: loongarch@lists.linux.dev, LKML References: <20220704153612.314112-1-huqi@loongson.cn> <4273e104-8392-6a06-5d18-a1933978d8c3@xen0n.name> <22a1ba993e298ce12a374decefebeca484240883.camel@xry111.site> <16c9ccaa5e5a2ffd39272cff6f66e487c659b571.camel@xry111.site> <9d064771-9402-4e84-96f8-4713cddf42f2@www.fastmail.com> <730cb4c4-a6a3-783e-3e4c-7c2bdc35c088@loongson.cn> <0583a335-72f7-55cf-3cd9-4dbd8109a440@xen0n.name> From: Qi Hu In-Reply-To: <0583a335-72f7-55cf-3cd9-4dbd8109a440@xen0n.name> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf9Dxj9JjcsZi224OAA--.1647S3 X-Coremail-Antispam: 1UD129KBjvJXoW7ZrykJrW8uF1xtr13Jw45trb_yoW8Kr13pF 4fGa10kF4kJr1Fvw4vvw4vka4YkryxG3yUXw4vqr10ywnrtw13WrWrZrs8CFyxGr18tF4Y qr4jqr97Z34DAaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnUUvcSsGvfC2KfnxnUUI43ZEXa7xR_UUUUUUUUU== X-CM-SenderInfo: pkxtxqxorr0wxvrqhubq/1tbiAQAACV3QvPyIzAABsA X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/7/7 11:05, WANG Xuerui wrote: > On 2022/7/7 09:29, Qi Hu wrote: >> >> On 2022/7/7 04:49, Jiaxun Yang wrote: >>> >>> 在2022年7月6日七月 上午5:00,Qi Hu写道: >>>> On 2022/7/6 10:51, Xi Ruoyao wrote: >>>>> On Wed, 2022-07-06 at 10:35 +0800, Huacai Chen wrote: >>>>> >>>>>> Maybe Xuerui and Ruoyao have some misunderstanding. LSX/LASX will >>>>>> surely be upstream, this has nothing to do with cleanup VCSR16. >>>>>> Because FP/LSX/LASX share the same control bits in FCSR now. >>>>> My guess: >>>>> >>>>> Almost all behavior of vector unit is controlled by FCSR (for >>>>> example, >>>>> the rounding of both FPU and vector unit should be controlled by FCSR >>>>> altogether), except one bit similar to the bit 24 of MSACSR >>>>> ("flush to >>>>> zero") is in VCSR [^1].  And "flush to zero" is not really useful >>>>> so it >>>>> will be removed in 3A6000, and we'll not use it for 3A5000. >>>> Actually, flush to zero has been removed in 3A5000. >>>>> [^1]: A more bold guess: the hardware engineers could have just said >>>>> "let's wire this register called MSACSR in GS464V as FCSR16/VCSR in >>>>> LA464, maybe it will be useful and who knows?"  But now in >>>>> practice it's >>>>> not useful. >>>>> >>>>> Am I correct? >>>> The hardware(LA464) has removed the vcsr("has but not use" is >>>> incorrect), and here are some details: >>>> >>>> - For all FP operations, including LSX/LASX, they are controlled by >>>> fcsr0/1/2/3. >>>> >>>> - For LSX/LASX other operations, they are *not* controlled by any >>>> other >>>> CSR now. And fcsr16 to fcsr31 are reserved to control these operations >>>> (now they are *undefined*). >>> Sorry but what do you meant by “these” here? >> "These operations" means "LSX/LASX other operations", except its >> floating-point operations. > > This is getting hard to follow. Assuming the expression "LSX/LASX > other operations" is Chinglish (it's certainly not proper English), I > think you mean "the non-FP operations belonging to LSX/LASX" here right? That's right. > > And it's strange, that these ops do exist in LSX/LASX, hence also > present in 3A5000, but the control bits are undefined. How come this > is even possible? The code is redundant, actually. Reading or writing the fcsr16 do not have any effect on LSX/LASX.