public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] manual: Avoid name collision in libm ULP table [BZ #28956]
@ 2022-04-05  9:46 Tom Coldrick
  2022-04-05 11:16 ` Adhemerval Zanella
  2022-04-05 13:29 ` Florian Weimer
  0 siblings, 2 replies; 5+ messages in thread
From: Tom Coldrick @ 2022-04-05  9:46 UTC (permalink / raw)
  To: libc-alpha; +Cc: Tom Coldrick

The 32-bit and 64-bit variants of RISC-V share the same name - "RISC-V"
- when generating the libm error table for the info pages. This
collision, and the way how the table is generated, mean that the values
in the final table for "RISC-V" may be either for the 32- or 64-bit
variant, with no indication as to which.

As an additional side-effect, this makes the build non-reproducible, as
the error table generated is dependent upon the host filesystem
implementation.

To solve this issue, the libm-test-ulps-name files for both variants
have been modified to include their word size, so as to remove the
collision and provide more accurate information in the table.

An alternative proposed was to merge the two variants' ULP values into a
single file, but this would mean that information about error values is
lost, as the two variants are not identical. Some differences are
considerable, notably the values for the exp() function are large.
---
 sysdeps/riscv/rv32/rvd/libm-test-ulps-name | 2 +-
 sysdeps/riscv/rv64/rvd/libm-test-ulps-name | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sysdeps/riscv/rv32/rvd/libm-test-ulps-name b/sysdeps/riscv/rv32/rvd/libm-test-ulps-name
index 827fcdca19..6d2816082e 100644
--- a/sysdeps/riscv/rv32/rvd/libm-test-ulps-name
+++ b/sysdeps/riscv/rv32/rvd/libm-test-ulps-name
@@ -1 +1 @@
-RISC-V
+RISC-V 32-bit
diff --git a/sysdeps/riscv/rv64/rvd/libm-test-ulps-name b/sysdeps/riscv/rv64/rvd/libm-test-ulps-name
index 827fcdca19..9cb50380df 100644
--- a/sysdeps/riscv/rv64/rvd/libm-test-ulps-name
+++ b/sysdeps/riscv/rv64/rvd/libm-test-ulps-name
@@ -1 +1 @@
-RISC-V
+RISC-V 64-bit
-- 
2.35.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] manual: Avoid name collision in libm ULP table [BZ #28956]
  2022-04-05  9:46 [PATCH] manual: Avoid name collision in libm ULP table [BZ #28956] Tom Coldrick
@ 2022-04-05 11:16 ` Adhemerval Zanella
  2022-04-11 15:46   ` Carlos O'Donell
  2022-04-05 13:29 ` Florian Weimer
  1 sibling, 1 reply; 5+ messages in thread
From: Adhemerval Zanella @ 2022-04-05 11:16 UTC (permalink / raw)
  To: Tom Coldrick, libc-alpha



On 05/04/2022 06:46, Tom Coldrick via Libc-alpha wrote:
> The 32-bit and 64-bit variants of RISC-V share the same name - "RISC-V"
> - when generating the libm error table for the info pages. This
> collision, and the way how the table is generated, mean that the values
> in the final table for "RISC-V" may be either for the 32- or 64-bit
> variant, with no indication as to which.
> 
> As an additional side-effect, this makes the build non-reproducible, as
> the error table generated is dependent upon the host filesystem
> implementation.
> 
> To solve this issue, the libm-test-ulps-name files for both variants
> have been modified to include their word size, so as to remove the
> collision and provide more accurate information in the table.
> 
> An alternative proposed was to merge the two variants' ULP values into a
> single file, but this would mean that information about error values is
> lost, as the two variants are not identical. Some differences are
> considerable, notably the values for the exp() function are large.

Path looks ok, but is there any expectation that RV64 and RV32 hardware
floating-point implementation or compiler generate code to have different
precision? Otherwise it would be simple to just use one ulp tests file.

> ---
>  sysdeps/riscv/rv32/rvd/libm-test-ulps-name | 2 +-
>  sysdeps/riscv/rv64/rvd/libm-test-ulps-name | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sysdeps/riscv/rv32/rvd/libm-test-ulps-name b/sysdeps/riscv/rv32/rvd/libm-test-ulps-name
> index 827fcdca19..6d2816082e 100644
> --- a/sysdeps/riscv/rv32/rvd/libm-test-ulps-name
> +++ b/sysdeps/riscv/rv32/rvd/libm-test-ulps-name
> @@ -1 +1 @@
> -RISC-V
> +RISC-V 32-bit
> diff --git a/sysdeps/riscv/rv64/rvd/libm-test-ulps-name b/sysdeps/riscv/rv64/rvd/libm-test-ulps-name
> index 827fcdca19..9cb50380df 100644
> --- a/sysdeps/riscv/rv64/rvd/libm-test-ulps-name
> +++ b/sysdeps/riscv/rv64/rvd/libm-test-ulps-name
> @@ -1 +1 @@
> -RISC-V
> +RISC-V 64-bit

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] manual: Avoid name collision in libm ULP table [BZ #28956]
  2022-04-05  9:46 [PATCH] manual: Avoid name collision in libm ULP table [BZ #28956] Tom Coldrick
  2022-04-05 11:16 ` Adhemerval Zanella
@ 2022-04-05 13:29 ` Florian Weimer
  2022-04-05 15:25   ` Andreas Schwab
  1 sibling, 1 reply; 5+ messages in thread
From: Florian Weimer @ 2022-04-05 13:29 UTC (permalink / raw)
  To: Tom Coldrick via Libc-alpha; +Cc: Tom Coldrick

Sorry, why does this say “manual:”?  Shouldn't it be ”math:”?

Thanks,
Florian


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] manual: Avoid name collision in libm ULP table [BZ #28956]
  2022-04-05 13:29 ` Florian Weimer
@ 2022-04-05 15:25   ` Andreas Schwab
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Schwab @ 2022-04-05 15:25 UTC (permalink / raw)
  To: Florian Weimer via Libc-alpha; +Cc: Florian Weimer, Tom Coldrick

On Apr 05 2022, Florian Weimer via Libc-alpha wrote:

> Sorry, why does this say “manual:”?  Shouldn't it be ”math:”?

While the file is read by math/gen-libm-test.py, it is only used for
generating the ULPs table in the manual.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] manual: Avoid name collision in libm ULP table [BZ #28956]
  2022-04-05 11:16 ` Adhemerval Zanella
@ 2022-04-11 15:46   ` Carlos O'Donell
  0 siblings, 0 replies; 5+ messages in thread
From: Carlos O'Donell @ 2022-04-11 15:46 UTC (permalink / raw)
  To: Adhemerval Zanella, Tom Coldrick, libc-alpha

On 4/5/22 07:16, Adhemerval Zanella via Libc-alpha wrote:
> 
> 
> On 05/04/2022 06:46, Tom Coldrick via Libc-alpha wrote:
>> The 32-bit and 64-bit variants of RISC-V share the same name - "RISC-V"
>> - when generating the libm error table for the info pages. This
>> collision, and the way how the table is generated, mean that the values
>> in the final table for "RISC-V" may be either for the 32- or 64-bit
>> variant, with no indication as to which.
>>
>> As an additional side-effect, this makes the build non-reproducible, as
>> the error table generated is dependent upon the host filesystem
>> implementation.
>>
>> To solve this issue, the libm-test-ulps-name files for both variants
>> have been modified to include their word size, so as to remove the
>> collision and provide more accurate information in the table.
>>
>> An alternative proposed was to merge the two variants' ULP values into a
>> single file, but this would mean that information about error values is
>> lost, as the two variants are not identical. Some differences are
>> considerable, notably the values for the exp() function are large.
> 
> Path looks ok, but is there any expectation that RV64 and RV32 hardware
> floating-point implementation or compiler generate code to have different
> precision? Otherwise it would be simple to just use one ulp tests file.

That is a good question, but it could be handled with a distinct patch to remove the files
if the maintainers consider that the right direction to take.

Overall this patch looks correct to me also and I've pushed it as trivial in that it makes
the manual more correct.

I tested the patch on x86_64 with make pdf and the table looks good and disambiguates the
results.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-04-11 15:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-05  9:46 [PATCH] manual: Avoid name collision in libm ULP table [BZ #28956] Tom Coldrick
2022-04-05 11:16 ` Adhemerval Zanella
2022-04-11 15:46   ` Carlos O'Donell
2022-04-05 13:29 ` Florian Weimer
2022-04-05 15:25   ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).