From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id B83BE3858D39 for ; Mon, 27 Mar 2023 09:08:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B83BE3858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrull.eu Received: by mail-wr1-x42c.google.com with SMTP id e18so7884376wra.9 for ; Mon, 27 Mar 2023 02:08:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1679908104; 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=VEWz7LaDNDOzgnpGUfAbInt/3C1pPUReKop/zBiwNsM=; b=CWrPubRKBJojdP2uLRQW6IPNpnSZsbbwLN7rXVMHXe9ev4XjQw4IS+uDwDaRfrxDRu zlGJ/1orzAIgIX7AeG2jgZ5xmxNRY1yroEU+iYNA+GlJ+5Q9mH3lWIDzJVQvbQPkvk0E doIgsKI36Q5cN6s7S90bBJAVXELJqAj9IWNsamtumFkXfqGv19XXAuBc0WqC8GEbV46s 98uTqa07WwDQyhdrMffczaEYXQUKSvxsjz4Xj8c7ttsEgUBkBNSd6eJESw6/67s0+9Z6 zXo0rRpVRNGI5u5lFhf1FFIW3wHz+gtL8Ork0tjGiy5i+6iWGm7v7836ttORAp64CiPQ d55Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679908104; 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=VEWz7LaDNDOzgnpGUfAbInt/3C1pPUReKop/zBiwNsM=; b=XAvev2ZpjTxth00x1OfzUZWWY47iYKCXYgQh/2H85DYvnyRngv4Tf1VEhaDEyIaskX JrnMV052IBb8pQQlbziLZrSNeKQpzpYtjfrOSSmLvMemv1e946w11puoZ/1IIOEHkRA/ nBi6YbggHO2qXzxMbcp34ZXzhV/qiOSIvoKC/YYl1t56sY8ks5n6nKjBxXOCaG7z1rER H0Td2mYUBJgz6EG2zJjnl2fnJ7QZJzGUD1e5kzTXER7JkwWovW1U4wECxaKFQ76C58Hr 2+SrumJI8HBeUsvDn+kSbqTpSHGqjgYVWXQQ/09JhxKBxfbgTFip2hoiRNB9SHgxekdA RsFw== X-Gm-Message-State: AAQBX9fAyrhIt3U8wc6KzLCpCtPv0W0Yp58RgnRs4fAfaH7B+kk50opt AITDbASpBRH9o8VdvA/DWRqxA4MYEZTJTC/AAiCcTQ== X-Google-Smtp-Source: AKy350a1XV31KOR4wEfIaNKHNd1hyUSjNWZ6Pd/T6z/0lR/L1YHYp4d6O4GZK6BZfoO5CuxDb38+z8Ze3FDVbVkupYQ= X-Received: by 2002:adf:db4b:0:b0:2ce:ac97:6f51 with SMTP id f11-20020adfdb4b000000b002ceac976f51mr1710591wrj.13.1679908104363; Mon, 27 Mar 2023 02:08:24 -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: From: =?UTF-8?Q?Christoph_M=C3=BCllner?= Date: Mon, 27 Mar 2023 11:08:12 +0200 Message-ID: Subject: Re: [RFC PATCH v2 2/2] RISC-V: Add support for the Zfa extension To: Kito Cheng Cc: Jan Beulich , 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=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,JMQ_SPF_NEUTRAL,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, Mar 27, 2023 at 10:53=E2=80=AFAM Kito Cheng = wrote: > > 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-Pr= actices/Hexadecimal-floating-point-numbers-in-C99 Ok, got it. Thanks! > > > 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.87= 5", > > > + "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", "na= n", > > > +}; > > > > 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 prefe= r > > 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