From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe2f.google.com (mail-vs1-xe2f.google.com [IPv6:2607:f8b0:4864:20::e2f]) by sourceware.org (Postfix) with ESMTPS id 756203858D39 for ; Mon, 27 Mar 2023 08:53:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 756203858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-vs1-xe2f.google.com with SMTP id h27so6846708vsa.1 for ; Mon, 27 Mar 2023 01:53:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679907213; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ltk32T7VLmE+6Jg0doaqYJG11fzYhnlYcmsx/D61yA4=; b=ImIWHnlyEliwKIA6dcPHgPZ1yg8jfc3HkZ4I6Tr3DmNUtvRwJmcsMNtuEq1elitNCz pYsikY2I6udU5aMkai6sU7YairjSfIg71rsk7YskpNHEui+A4sQrQyq3xmLUpOQKDvjI IGvMsZm36X0KTmJ2ZYg14Zq1oZRG3ky4ewlSjFGklD2NcQvkELIFh+zkY6nBC7lKuS26 ORKg2WURwvDeczeD13n/vAmqC2xBPCujg0Ktqpl0H95sQJKGNxLuao8tvchfj+IekW1d zvvn1WUeaKH2dwYiVbuP1ZAmejcTUiXAJZjqbia/ThVOgWdysbBUseMmfX/WDCWi4sbH TStQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679907213; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ltk32T7VLmE+6Jg0doaqYJG11fzYhnlYcmsx/D61yA4=; b=yFoELaymOrI3Lqjt4Hbun/OANsEFryyNdeTYLa/tLTFaEBz7QprxGJ0FRhL0nf0juJ aF+z3bJ/bgrxqfXg0jNpx+u+5FQ02SqARKVbkrc6mVMkF48nxZd0aDZG/JXjDT+BqrAi Hkq3GIyoZefv/RJafVf1s4c5rMWu/qa/aLs9Zo9a8J5OP4XlFXamW8GhfKKJOGBGaxJC r+Ji8b1KkRXpzrkQsBpjY0JWVlIu6Ojkei0jzmmvULQMKSLRv4iuJzFl5woltWFQWVCE JAofYQYJNbkdciNuNHNqdITtTEjKsdS6wcqoTfoJ8S7K7YPttec+q8Zstw7OO+fVSw98 fCgA== X-Gm-Message-State: AAQBX9dJbICX6ub8vJXxW3mlkDo79N+LLWdLy25mZACBqYHoPVUsZP5o ERMjfi5ltOISbJZbzvUHax5fKiuIevjH7H/zdKE= X-Google-Smtp-Source: AKy350aLLOys1RskuFmTuCtzMDpuKhsYFhZW7RjEcSLN24iAHJ5TjmxOxgxzdaLQ62/nhO4nWzLYmuMSjwQ0RUA17uw= X-Received: by 2002:a67:c31b:0:b0:426:392a:92bd with SMTP id r27-20020a67c31b000000b00426392a92bdmr6017107vsj.7.1679907212617; Mon, 27 Mar 2023 01:53:32 -0700 (PDT) MIME-Version: 1.0 References: <20230327080107.3266866-1-christoph.muellner@vrull.eu> <20230327080107.3266866-3-christoph.muellner@vrull.eu> <981c0ad5-3e84-d2f3-c14a-4c7bb70749a9@suse.com> In-Reply-To: <981c0ad5-3e84-d2f3-c14a-4c7bb70749a9@suse.com> From: Kito Cheng Date: Mon, 27 Mar 2023 16:53:21 +0800 Message-ID: Subject: Re: [RFC PATCH v2 2/2] RISC-V: Add support for the Zfa extension To: Jan Beulich Cc: Christoph Muellner , binutils@sourceware.org, Nelson Chu , Andrew Waterman , Palmer Dabbelt , Jim Wilson , Philipp Tomsich , Jeff Law , Tsukasa OI Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Wait, I mean the hex floating point format defined in C99/C++17, not the raw hex value. so something like 0x1p-16 (0.0000152587890625), 0x1p-2 (0.25) 0x1p+0, -0x1p+0 could be used for fli.* instruction. You could use printf with %a to get those values. https://gcc.gnu.org/onlinedocs/gcc/Hex-Floats.html https://developer.arm.com/documentation/dui0375/latest/Compiler-Coding-Prac= tices/Hexadecimal-floating-point-numbers-in-C99 On Mon, Mar 27, 2023 at 4:39=E2=80=AFPM Jan Beulich via Binutils wrote: > > On 27.03.2023 10:01, Christoph Muellner wrote: > > --- a/opcodes/riscv-opc.c > > +++ b/opcodes/riscv-opc.c > > @@ -110,6 +110,16 @@ const char * const riscv_vma[2] =3D > > "mu", "ma" > > }; > > > > +/* The FLI.[HSDQ] value constants. */ > > +const char * const riscv_fli_value[32] =3D > > +{ > > + "-1.0", "min", "0.0000152587890625", "0.000030517578125", > > + "0.00390625", "0.0078125", "0.0625", "0.125", > > + "0.25", "0.3125", "0.375", "0.4375", "0.5", "0.625", "0.75", "0.875"= , > > + "1.0", "1.25", "1.5", "1.75", "2.0", "2.5", "3.0", "4.0", > > + "8.0", "16.0", "128.0", "256.0", "32768.0", "65536.0", "inf", "nan"= , > > +}; > > Especially for values like 1.0x2^^-n (entries 2 and onwards) I question > the spelled out numbers to be the most suitable ones usability wise. At > least some alternative spelling (e.g. 2.e-16) ought to be recognized as > well. But since there are meany reasonable spellings (leading 0 omitted > in 0. or trailing zero omitted in .0), I guess I'd prefer > if values were actually parsed as a floating point number (e.g. via > ieee_md_atof()), and then matched against values stored in the table. > One might further consider to also permit the 2nd form accepted > elsewhere, see read.c:parse_one_float(). > > Jan