Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2028164imw; Tue, 5 Jul 2022 21:26:26 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v5YxRqR1NdseuAShyaxrIrLmCP/m+srlVmeJUIwHyOyv/+1mnWjFAp4cwPXDxdDQU8sANg X-Received: by 2002:a17:907:2d08:b0:726:35bd:b3c1 with SMTP id gs8-20020a1709072d0800b0072635bdb3c1mr36518764ejc.281.1657081586454; Tue, 05 Jul 2022 21:26:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657081586; cv=none; d=google.com; s=arc-20160816; b=zeUkzLoqojAt5656GfkoJemejbOJDgNv3IqvJKyENwx1rWz1jSzvnincBRItvILtkn j4y2iOiEUHBEJsug5PFUVj4F/O4vyH75yLCbW3ip7fjeV84P/7UoqxX4hSyBOW1xnIcQ 7GudMR3Rg9kBULRjSNE+EovNLPiWdtQx64o1brlJFH+AkSPSN7QA9OcEb2ki/2PDCnEM lgFy89DDmkeiY/ZnXobXcJ2qDxmAJuvpvh9wR/IVmrb6Q9WBwXouahaW2Xtyc9yuAbCA BHz60Mcy/+TEsvIUOQCzimsWfKq2r1hwax4ocVYE9YvOxg1RTzf/gEZvixIr6RDg2uJq vxqw== 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=fVbaBf2ncMNflhycEPPLfx6dhQdEsAY38nOA+3PKKG0=; b=YV2wfwjUQQIm/i4cSx62NfDPWrSKpC1TOSWstvxzT/w3U+2howVeRZeVzAgQZManBx xaRJHDSwb5hDP0y0W+Rk/fHMVcILIgUly/ib9nYH/7qOpBP55jZvOGBjf/etfkYt+Kl+ tNiZfSUkqCjN2SSaIdGWEkBkkiKaNfN0XjylblcB46pxH1ppgxxyKYGE1B0sHcxNWeJw QVbzXZpwhzjr7E7/CVRUfu6dv4epzumLqeM9N/S20Gde51e642EKUpoEj87dhCOhiFuK AqdQl2AxvUpFeZ9Krb972ymRhLzOB9yjyPDqDwtfbV2jL6hMWvDZAp90aha31BApkpxW Uwgg== 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 cs16-20020a170906dc9000b00722e4cb31aesi3234704ejc.254.2022.07.05.21.26.02; Tue, 05 Jul 2022 21:26:26 -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 S231591AbiGFEAo (ORCPT + 99 others); Wed, 6 Jul 2022 00:00:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231637AbiGFEAl (ORCPT ); Wed, 6 Jul 2022 00:00:41 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0BD901EC7F for ; Tue, 5 Jul 2022 21:00:39 -0700 (PDT) Received: from [198.18.0.1] (unknown [192.168.200.1]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Axn+LhCMViZP0LAA--.36560S3; Wed, 06 Jul 2022 12:00:33 +0800 (CST) Message-ID: Date: Wed, 6 Jul 2022 12:00:33 +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: Xi Ruoyao , Huacai Chen Cc: WANG Xuerui , Jiaxun Yang , 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> From: Qi Hu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CM-TRANSID: AQAAf9Axn+LhCMViZP0LAA--.36560S3 X-Coremail-Antispam: 1UD129KBjvJXoW7ArWUurWDJw45KrWUurWkXrb_yoW8Gw17pF 4xWw4fAF4kArnIva1kAw4rKa13W348WayUKwsIvr1jkrn2q343KrWrXFs5GFyfGr1SyF45 Xr4qqryxZ3yDZaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnUUvcSsGvfC2KfnxnUUI43ZEXa7xR_UUUUUUUUU== X-CM-SenderInfo: pkxtxqxorr0wxvrqhubq/1tbiAQATCV3QvPxRrAABsq 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/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*). - Flush to zero(MSACSR.FS) is removed and not supported. - If you use "movfcsr2gr" to read the fcsr16, the value is *UNDEFINED*.