From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123368 invoked by alias); 21 Jan 2020 22:43:40 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 123358 invoked by uid 89); 21 Jan 2020 22:43:39 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=mentions X-HELO: mail-vs1-f65.google.com Received: from mail-vs1-f65.google.com (HELO mail-vs1-f65.google.com) (209.85.217.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 21 Jan 2020 22:43:38 +0000 Received: by mail-vs1-f65.google.com with SMTP id b79so2988453vsd.9 for ; Tue, 21 Jan 2020 14:43:38 -0800 (PST) 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=O5dm/qQPh87yHm/QlKfO6ysTmjIxHH9o6zdtbax6Ylk=; b=g3njvTbTubDFwN7Vmas3aaQB2+Xtn9Bj68AofeLwGGP8ja7WM2w1kqBywuNA7hwgxZ ozYsjuwpjDuUJQIYYDgh2ggZV0j/TGwYKNUPqryeczsCXQSpqWT1h8fUpLRXvvy1h9SP HPk/X1i1vjRg4qq1y6JQtoSo/SFuTGXyJp4hIOPR+HXN6y/BKwFj5T55USN86mg9V/ap Uln9zQLyJ0awNRSiYeXFWtT4Iry5RJCIxkOa3YNXNF9fm0Vsggowq4xDuhQW+Z975jp+ RagHiki7Lt5hsnIHhgo/bgIaJjYrO1o5zIEvJ+eBTYQ3U2S3UboG68se3aNqlAClRfrQ my3w== MIME-Version: 1.0 References: <20200121064637.1355843-1-keithp@keithp.com> <20200121064637.1355843-4-keithp@keithp.com> <87pnfdfca9.fsf@keithp.com> In-Reply-To: <87pnfdfca9.fsf@keithp.com> From: Jim Wilson Date: Tue, 21 Jan 2020 22:43:00 -0000 Message-ID: Subject: Re: [PATCH 4/4] riscv: Addfpgetroundtoi and fpsetroundtoi stubs To: Keith Packard Cc: Kito Cheng , Newlib Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2020/txt/msg00013.txt I think fpgetroundtoi and fpsetroundtoi should always return error. I found a reference in a NEC V810 manual that has separate bits for FP rounding and FP->INT conversion rounding. Hence it needs two separate interfaces to be able to access the two sets of rounding bits. For bonus points, it mentions that tkcw means task control word. tkcw is used in the newlib sysvi386 port implementation of these functions. So I think some very old (pre x87?) x86 ports also had two separate sets of rounding bits, and this is why newlib has the second set of functions. I didn't find a reference to confirm this though. But for any modern machine, there is only one set of FP rounding flags, and hence I think the fp{get,set}roundtoi functions are useless, and should always return error. Jim