From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 65F671F8C6 for ; Wed, 15 Sep 2021 00:14:12 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5D7B13857817 for ; Wed, 15 Sep 2021 00:14:11 +0000 (GMT) Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id B29AD3858402 for ; Wed, 15 Sep 2021 00:13:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B29AD3858402 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=sifive.com Received: by mail-ot1-x333.google.com with SMTP id i3-20020a056830210300b0051af5666070so1120436otc.4 for ; Tue, 14 Sep 2021 17:13:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jkrtZps6tE+YG3Otw39Nl88xlVFJi1tHRHiiW15tMHQ=; b=lkJbdSOF3SfEzRXQrHEkrhY/GYVlheMJeYsAKxBLfUddyJkgeG7UYwnmADXWCvemTJ QalK7FPt/1fj6nkRYVKizFPn7PGFHpY1hFraKk0867wzrI5mk0RSy8tVWacMcUKJYs/8 rtrRRE+LMGZHDNMJmEvPsl2oMQA7KDgrYkxQki7jU0l4N2uTcM5AZxw5cJSq/Vux0Rky PcdvEKuHRia1EVNCz7Htr07iLaQ8SCwbv+KsbKfYpnMMU7sort/W1WEXeuAr6HxI29VI fepOf0pk/i/ahCtGH/l3qkiWfPHEvjIbxbGGpnyIGPNLJkC6NQ48eh1qUovAuvW1UjS+ atiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jkrtZps6tE+YG3Otw39Nl88xlVFJi1tHRHiiW15tMHQ=; b=7stkGku67hbdP01XiBaNx/ummuS7bWK5m4oMB8SrrRO+d58UfmtvIGxq23cVek0XDP Q7mIw8qhTtWOKU+xz990nCG2x6NqChiWeQeSIscchcT+O4hSZYdSpR+ClejY/Zy8aZKG SLisLGOphdG6xkKDdM9xI6UGVlYVvlsbGkMrYghvks57pctVj8baGqvT7hpsl7IgM632 TdIcVgBdOqEkmecdo/NTJh4RPJP9yvqYoDMfukSGkepZnwl947gFVc23Kny1+h6REgd1 RekRIlqn0eCRWAHlsXSvEfY5XSLoYKo2Z/V8G9574RgcKlPv/DayNxbiN8+KRfhrkIyd Rd2g== X-Gm-Message-State: AOAM532kpUnRsnwWU0Nrct44igFO29nGRzd0Qm1S58sYHOvlToRIETXz hzH0xiOCMh/feQQcDLbQLjM51uvy9L22lQ== X-Google-Smtp-Source: ABdhPJzIykfZMqnNZuLwyutiuRZzhGrTZxQYNZyC/dENguwKZDpkOZTpH9HOkaW3FMt4Rg5N0WORYg== X-Received: by 2002:a9d:654b:: with SMTP id q11mr17048586otl.184.1631664838817; Tue, 14 Sep 2021 17:13:58 -0700 (PDT) Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com. [209.85.210.54]) by smtp.gmail.com with ESMTPSA id b25sm2985091ooq.6.2021.09.14.17.13.58 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Sep 2021 17:13:58 -0700 (PDT) Received: by mail-ot1-f54.google.com with SMTP id q11-20020a9d4b0b000000b0051acbdb2869so1142753otf.2 for ; Tue, 14 Sep 2021 17:13:58 -0700 (PDT) X-Received: by 2002:a05:6830:25d5:: with SMTP id d21mr17226797otu.105.1631664838074; Tue, 14 Sep 2021 17:13:58 -0700 (PDT) MIME-Version: 1.0 References: <1631497278-29829-1-git-send-email-vincent.chen@sifive.com> <1631497278-29829-4-git-send-email-vincent.chen@sifive.com> In-Reply-To: From: Andrew Waterman Date: Tue, 14 Sep 2021 17:13:47 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC patch 3/5] RISC-V: Save and restore VCSR when doing user context switch To: Joseph Myers Content-Type: text/plain; charset="UTF-8" X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vincent Chen , libc-alpha@sourceware.org Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On Tue, Sep 14, 2021 at 4:48 PM Joseph Myers wrote: > > On Mon, 13 Sep 2021, Vincent Chen wrote: > > > According to the RISC-V V extension specification, all vector registers > > except VCSR are caller-saved registers. The VCSR (vxrm + vxsat) has thread > > storage duration. Therefore, only VCSR needs to be added to the user > > context operation. > > What is the intended programming model for using vxrm and vxsat? > > The expectation for the floating-point rounding modes and flags is that > they work just like user-defined _Thread_local variables - that is, they > are *not* saved or restored by setjmp/longjmp or *context functions. It > would be natural to expect fixed-point rounding modes and flags to work > similarly. Indeed, Joseph, vxsat and vxrm should be treated analogously to the FP flags and rounding mode, respectively. > > -- > Joseph S. Myers > joseph@codesourcery.com