Source: intelrdfpmath
Version: 2.0u3-1
Severity: normal
Tags: patch

Dear Maintainer,

See:
https://buildd.debian.org/status/fetch.php?pkg=intelrdfpmath&arch=hppa&ver=2.0u3-1&stamp=1716291702&raw=0

The attached patch fixes the build of intelrdfpmath on hppa, at least
with checking disabled.  Test results appear similar to armhf.

The most important aspect of the patch is to use a 64-bit word size.
Otherwise, one hits broken code.

The changes to dpml_ux_trig.c and dpml_ux_cbrt.c aren't necessary to
fix build but they fix issues noticed in testing.

Please review and install the attached patch if it's okay.  There might
be changes in it that will help mips.

Regards,
Dave Anglin

-- System Information:
Debian Release: 13.0
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 6.12.30-dirty (SMP w/4 CPU threads)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_CA:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
--- ./LIBRARY/float128/architecture.h.save      2025-05-25 19:52:29.293072282 
-0400
+++ ./LIBRARY/float128/architecture.h   2025-05-26 16:15:21.552693286 -0400
@@ -196,22 +196,32 @@
 
 #      define BITS_PER_FLOAT  32
 #      define BITS_PER_DOUBLE 64
+#ifdef __hpux__
 #      define BITS_PER_LONG_DOUBLE 128
+else
+#      define BITS_PER_LONG_DOUBLE 64
+#endif
 
 #      define INT_8  signed char
 #      define INT_16 signed short
 #      define INT_32 signed int
-#      undef  INT_64
+#      define INT_64 signed long long
 #      undef  INT_128
 #      define U_INT_8  unsigned char
 #      define U_INT_16 unsigned short
 #      define U_INT_32 unsigned int
-#      undef  U_INT_64
+#      define U_INT_64 unsigned long long
 #      undef  U_INT_128
 
-#      define WORD      INT_32
-#      define U_WORD  U_INT_32
-#      define BITS_PER_WORD 32
+#if 0
+#          define WORD      INT_32
+#          define U_WORD  U_INT_32
+#          define BITS_PER_WORD 32
+#else
+#          define WORD      INT_64
+#          define U_WORD  U_INT_64
+#          define BITS_PER_WORD 64
+#endif
 
 #      define HALF_WORD      INT_16
 #      define U_HALF_WORD  U_INT_16
--- ./LIBRARY/float128/dpml_exception.h.save    2025-05-26 16:26:29.672087429 
-0400
+++ ./LIBRARY/float128/dpml_exception.h 2025-05-26 16:26:53.770354019 -0400
@@ -331,7 +331,7 @@
 #      define PROCESS_DENORMS 1
 #      define DPML_EXCEPTION_HANDLER DPML_EXCEPTION_NAME
 #      define EXCEPTION_ARGUMENTS( error_code ) error_code
-#      define PLATFORM_SPECIFIC_HEADER_FILE "hppa_exception.c"
+//#    define PLATFORM_SPECIFIC_HEADER_FILE "hppa_exception.c"
 
 #   elif ARCHITECTURE == ix86
 #      define PROCESS_DENORMS 1
--- ./LIBRARY/float128/dpml_ux_cbrt.c.save      2025-05-25 19:37:09.758843976 
-0400
+++ ./LIBRARY/float128/dpml_ux_cbrt.c   2025-05-25 19:41:13.276554432 -0400
@@ -132,8 +132,7 @@
 #   if (BITS_PER_UX_FRACTION_DIGIT_TYPE == 32)
 
         tmp_digit = G_UX_2nd_MSD(&unpacked_argument);
-        u.F_LO_WORD = (msd << (BITS_PER_UX_FRACTION_DIGIT_TYPE - D_EXP_WIDTH))
-                       | (lsd >> D_EXP_WIDTH);
+        u.F_LO_WORD = (msd << (BITS_PER_UX_FRACTION_DIGIT_TYPE - D_EXP_WIDTH));
 
 #   endif
 
--- ./LIBRARY/float128/dpml_ux_trig.c.save      2025-05-25 23:19:04.845713245 
-0400
+++ ./LIBRARY/float128/dpml_ux_trig.c   2025-05-25 23:19:25.744946491 -0400
@@ -360,7 +360,7 @@
 
                 current_digit = G_UX_FRACTION_DIGIT(argument, 1);
                 P_UX_FRACTION_DIGIT(argument, 1,
-                        (current_digit << cnt) | ( tmpt_digit >> w_tmp));
+                        (current_digit << cnt) | ( tmp_digit >> w_tmp));
 
 #           endif
 
--- ./LIBRARY/float128/ix86_macros.h.save       2025-05-26 10:41:02.184690626 
-0400
+++ ./LIBRARY/float128/ix86_macros.h    2025-05-26 10:43:47.249524388 -0400
@@ -402,6 +402,7 @@
 
 #define BITS_PER_DIGIT       64
 
+#define MAKE_MASK(width,pos) ((((U_INT_64)1 << (width)) - 1) << (pos))
 #define __LO(x)        ((x) & MAKE_MASK( BITS_PER_DIGIT / 2, 0 ))
 #define __HI(x)        (((x)) >> ( BITS_PER_DIGIT / 2 ))
 
--- ./LIBRARY/makefile.iml_head.save    2025-05-25 19:16:40.331172297 -0400
+++ ./LIBRARY/makefile.iml_head 2025-05-26 10:29:40.514118600 -0400
@@ -177,7 +177,7 @@
 # returned
 # 
==============================================================================
 
-__INDICES__ = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+__INDICES__ = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
 
 GetIndex = $(strip $(word 1,$(if $(word $(words $(__INDICES__)),$2), \
                $(error "List too large. Adjust __INDICES__"), \
@@ -344,9 +344,9 @@
     endif
 endif
 
-ARCH_ALIAS := x86  ia64 EM64T x86_64 i686 amd64 Intel64 sun4u arm  aarch64 
powerpc64le riscv64 s390x loongarch64
-ARCH_LIST  := IA32 IA64 EFI2  EFI2   IA32 EFI2  EFI2    EFI2  IA32 EFI2    
EFI2        EFI2    S390X EFI2
-ARCH_TYPE  := IA32 IA64 EFI2  EFI2   IA32 EFI2  EFI2    EFI2  IA32 EFI2    
EFI2        EFI2    S390X EFI2
+ARCH_ALIAS := x86  ia64 EM64T x86_64 i686 amd64 Intel64 sun4u arm  aarch64 
powerpc64le riscv64 s390x loongarch64 hppa
+ARCH_LIST  := IA32 IA64 EFI2  EFI2   IA32 EFI2  EFI2    EFI2  IA32 EFI2    
EFI2        EFI2    S390X EFI2 IA32
+ARCH_TYPE  := IA32 IA64 EFI2  EFI2   IA32 EFI2  EFI2    EFI2  IA32 EFI2    
EFI2        EFI2    S390X EFI2 IA32
 ARCH_TYPES := IA32 IA64 EFI2 S390X
 
 UARCH_LIST := SSE GSSE LRB LRB2

Reply via email to