[RFC,v1,12/16] RISC-V: Regenerate ULPs of RISC-V

Message ID 6af6b96dabc6f8434575e4518cf8a8655d6e7125.1561177967.git.alistair.francis@wdc.com
State New, archived
Headers

Commit Message

Alistair Francis June 22, 2019, 4:37 a.m. UTC
  From: Zong Li <zongbox@gmail.com>

Use the regen-ulp to generate the ulp files of rvd and nofpu. The RV32
and RV64 use the same ulps.

2018-11-29  Zong Li  <zong@andestech.com>

	* sysdeps/riscv/nofpu/libm-test-ulps: Regenerate.
	* sysdeps/riscv/rvd/libm-test-ulps: New file.
	* sysdeps/riscv/rvd/libm-test-ulps-name: New file.
	* sysdeps/riscv/rv64/rvd/libm-test-ulps: Remove file.
	* sysdeps/riscv/rv64/rvd/libm-test-ulps-name: Remove file.
---
 ChangeLog                                     | 18 ++++++
 sysdeps/riscv/nofpu/libm-test-ulps            | 16 +++---
 sysdeps/riscv/{rv64 => }/rvd/libm-test-ulps   | 56 +++++++++----------
 .../riscv/{rv64 => }/rvd/libm-test-ulps-name  |  0
 4 files changed, 54 insertions(+), 36 deletions(-)
 rename sysdeps/riscv/{rv64 => }/rvd/libm-test-ulps (98%)
 rename sysdeps/riscv/{rv64 => }/rvd/libm-test-ulps-name (100%)
  

Comments

Joseph Myers July 24, 2019, 8:06 p.m. UTC | #1
On Fri, 21 Jun 2019, Alistair Francis wrote:

> From: Zong Li <zongbox@gmail.com>
> 
> Use the regen-ulp to generate the ulp files of rvd and nofpu. The RV32
> and RV64 use the same ulps.

I'm afraid you need more explanation of some of the changes.

> diff --git a/sysdeps/riscv/nofpu/libm-test-ulps b/sysdeps/riscv/nofpu/libm-test-ulps
> index 700772a5bf..102144a428 100644
> --- a/sysdeps/riscv/nofpu/libm-test-ulps
> +++ b/sysdeps/riscv/nofpu/libm-test-ulps
> @@ -532,16 +532,16 @@ double: 1
>  float: 1
>  idouble: 1
>  ifloat: 1
> -ildouble: 1
> -ldouble: 1
> +ildouble: 8
> +ldouble: 8
>  
>  Function: Imaginary part of "catan":
>  double: 1
>  float: 1
>  idouble: 1
>  ifloat: 1
> -ildouble: 1
> -ldouble: 1
> +ildouble: 4
> +ldouble: 4

Other architectures using binary128 long double don't have such large ULPs 
here.  You need to explain why you're getting larger ULPs for RV32.  
Likewise for the other ULPs increases.  If necessary, trace execution of 
the functions both on RV32 and on some other architecture (e.g. AArch64, 
or x86_64 for the _Float128 functions) to determine exactly where it 
diverges.

Maybe there is some relevant soft-fp bug, beyond the one that was fixed by

commit ff48ea6787526d7e669af93ce2681b911d39675c
Author: Zong Li <zong@andestech.com>
Date:   Thu Nov 1 17:34:39 2018 +0000

    soft-fp: Use temporary variable in FP_FRAC_SUB_3/FP_FRAC_SUB_4

(of course you need to make sure the GCC you use has that fix in libgcc as 
well)?
  

Patch

diff --git a/ChangeLog b/ChangeLog
index 26aa28ed4e..8dd0ed727b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -33,6 +33,24 @@ 
 	* sysdeps/riscv/rv32/rvd/s_lround.c: Likewise.
 	* sysdeps/riscv/rv32/rvf/s_lrintf.c: Likewise.
 	* sysdeps/riscv/rv32/rvf/s_lroundf.c: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/ldconfig.h (LD_SO_ABI): Support rv32.
+	* sysdeps/unix/sysv/linux/riscv/dl-cache.h (add_system_dir): Add
+	libraries path for rv32.
+	* sysdeps/riscv/bits/wordsize.h: Supprt rv32.
+	* sysdeps/riscv/nptl/bits/pthreadtypes-arch.h: Likewise.
+	* sysdeps/riscv/sfp-machine.h: Likewise.
+	* sysdeps/riscv/sys/asm.h: Likewise.
+	* sysdeps/unix/sysv/linux/riscv/rv32/jmp_buf-macros.h: New file.
+	* sysdeps/unix/sysv/linux/riscv/rv32/lockf64.c: Likewise.
+	* sysdeps/riscv/rv32/rvd/s_lrint.c: New file.
+	* sysdeps/riscv/rv32/rvd/s_lround.c: Likewise.
+	* sysdeps/riscv/rv32/rvf/s_lrintf.c: Likewise.
+	* sysdeps/riscv/rv32/rvf/s_lroundf.c: Likewise.
+	* sysdeps/riscv/nofpu/libm-test-ulps: Regenerate.
+	* sysdeps/riscv/rvd/libm-test-ulps: New file.
+	* sysdeps/riscv/rvd/libm-test-ulps-name: New file.
+	* sysdeps/riscv/rv64/rvd/libm-test-ulps: Remove file.
+	* sysdeps/riscv/rv64/rvd/libm-test-ulps-name: Remove file.
 
 2019-06-20  Dmitry V. Levin  <ldv@altlinux.org>
 	    Florian Weimer  <fweimer@redhat.com>
diff --git a/sysdeps/riscv/nofpu/libm-test-ulps b/sysdeps/riscv/nofpu/libm-test-ulps
index 700772a5bf..102144a428 100644
--- a/sysdeps/riscv/nofpu/libm-test-ulps
+++ b/sysdeps/riscv/nofpu/libm-test-ulps
@@ -532,16 +532,16 @@  double: 1
 float: 1
 idouble: 1
 ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 8
+ldouble: 8
 
 Function: Imaginary part of "catan":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 4
+ldouble: 4
 
 Function: Real part of "catan_downward":
 double: 1
@@ -596,16 +596,16 @@  double: 1
 float: 1
 idouble: 1
 ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 4
+ldouble: 4
 
 Function: Imaginary part of "catanh":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 8
+ldouble: 8
 
 Function: Real part of "catanh_downward":
 double: 2
diff --git a/sysdeps/riscv/rv64/rvd/libm-test-ulps b/sysdeps/riscv/rvd/libm-test-ulps
similarity index 98%
rename from sysdeps/riscv/rv64/rvd/libm-test-ulps
rename to sysdeps/riscv/rvd/libm-test-ulps
index 971373d87d..aff168f7bd 100644
--- a/sysdeps/riscv/rv64/rvd/libm-test-ulps
+++ b/sysdeps/riscv/rvd/libm-test-ulps
@@ -532,56 +532,56 @@  double: 1
 float: 1
 idouble: 1
 ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 8
+ldouble: 8
 
 Function: Imaginary part of "catan":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 4
+ldouble: 4
 
 Function: Real part of "catan_downward":
 double: 1
 float: 2
 idouble: 1
 ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 9
+ldouble: 9
 
 Function: Imaginary part of "catan_downward":
 double: 2
 float: 2
 idouble: 2
 ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
 
 Function: Real part of "catan_towardzero":
 double: 1
 float: 2
 idouble: 1
 ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 9
+ldouble: 9
 
 Function: Imaginary part of "catan_towardzero":
 double: 2
 float: 2
 idouble: 2
 ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
 
 Function: Real part of "catan_upward":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
-ildouble: 2
-ldouble: 2
+ildouble: 8
+ldouble: 8
 
 Function: Imaginary part of "catan_upward":
 double: 2
@@ -596,48 +596,48 @@  double: 1
 float: 1
 idouble: 1
 ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 4
+ldouble: 4
 
 Function: Imaginary part of "catanh":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 8
+ldouble: 8
 
 Function: Real part of "catanh_downward":
 double: 2
 float: 2
 idouble: 2
 ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
 
 Function: Imaginary part of "catanh_downward":
 double: 1
 float: 2
 idouble: 1
 ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 9
+ldouble: 9
 
 Function: Real part of "catanh_towardzero":
 double: 2
 float: 2
 idouble: 2
 ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 3
+ldouble: 3
 
 Function: Imaginary part of "catanh_towardzero":
 double: 1
 float: 2
 idouble: 1
 ifloat: 2
-ildouble: 2
-ldouble: 2
+ildouble: 9
+ldouble: 9
 
 Function: Real part of "catanh_upward":
 double: 4
@@ -652,8 +652,8 @@  double: 1
 float: 1
 idouble: 1
 ifloat: 1
-ildouble: 2
-ldouble: 2
+ildouble: 8
+ldouble: 8
 
 Function: "cbrt":
 double: 3
diff --git a/sysdeps/riscv/rv64/rvd/libm-test-ulps-name b/sysdeps/riscv/rvd/libm-test-ulps-name
similarity index 100%
rename from sysdeps/riscv/rv64/rvd/libm-test-ulps-name
rename to sysdeps/riscv/rvd/libm-test-ulps-name