[PATCH v2 01/32] mpi: Remove longlong.h support for CPUs GCC no longer has.

Matt Turner mattst88 at gmail.com
Wed Nov 25 21:19:38 CET 2026


* mpi/longlong.h [__a29k__, _AM29K, __clipper__, __gmicro__, __i860__,
__ns32000__, __pyr__, __z8000__]: Remove.

--

GCC has no port for any of these, so nothing can build or test their
blocks.  GCC removed them from its copy of longlong.h too: all but
NS32000 and Z8000 in commit cbf2f4797d9, whose ChangeLog entry reads
"longlong.h: Delete code for __a29k__, _AM29K, __clipper__, __gmicro__,
__i860__, __NeXT__ and __pyr__.", NS32000 in commit e0c634b1658
("longlong.h: Remove ns32k support."), and Z8000 in commit e42b0e5dc1d
("include: Remove Z8000 support from longlong.h").  Remove them rather
than convert their asm output casts for clang.

The NS32000 block does not compile anyway: count_trailing_zeros has no
backslash after "do {", so the macro ends there and the rest of its
body is left at file scope.  GCC fixed the same bug in its copy in
commit 6e2e5b6a7eb before removing the block.

Signed-off-by: Matt Turner <mattst88 at gmail.com>
---
 mpi/longlong.h | 248 ---------------------------------------------------------
 1 file changed, 248 deletions(-)

diff --git a/mpi/longlong.h b/mpi/longlong.h
index 453f2704..712c83e5 100644
--- a/mpi/longlong.h
+++ b/mpi/longlong.h
@@ -126,55 +126,6 @@ SPDX-License-Identifier: LGPL-2.1-or-later
  ****  Begin CPU Specific Versions  ****
  ***************************************/
 
-/***************************************
- **************  A29K  *****************
- ***************************************/
-#if (defined (__a29k__) || defined (_AM29K)) && W_TYPE_SIZE == 32
-# define add_ssaaaa(sh, sl, ah, al, bh, bl) \
-  __asm__ ("add %1,%4,%5\n"   \
-           "addc %0,%2,%3"                                              \
-	   : "=r" ((USItype)(sh)),                                      \
-	    "=&r" ((USItype)(sl))                                       \
-	   : "%r" ((USItype)(ah)),                                      \
-	     "rI" ((USItype)(bh)),                                      \
-	     "%r" ((USItype)(al)),                                      \
-	     "rI" ((USItype)(bl)))
-# define sub_ddmmss(sh, sl, ah, al, bh, bl) \
-  __asm__ ("sub %1,%4,%5\n"                                             \
-	   "subc %0,%2,%3"                                              \
-	   : "=r" ((USItype)(sh)),                                      \
-	     "=&r" ((USItype)(sl))                                      \
-	   : "r" ((USItype)(ah)),                                       \
-	     "rI" ((USItype)(bh)),                                      \
-	     "r" ((USItype)(al)),                                       \
-	     "rI" ((USItype)(bl)))
-# define umul_ppmm(xh, xl, m0, m1) \
-  do {									\
-    USItype __m0 = (m0), __m1 = (m1);					\
-    __asm__ ("multiplu %0,%1,%2"                                        \
-	     : "=r" ((USItype)(xl))                                     \
-	     : "r" (__m0),                                              \
-	       "r" (__m1));                                             \
-    __asm__ ("multmu %0,%1,%2"                                          \
-	     : "=r" ((USItype)(xh))                                     \
-	     : "r" (__m0),                                              \
-	       "r" (__m1));                                             \
-  } while (0)
-# define udiv_qrnnd(q, r, n1, n0, d) \
-  __asm__ ("dividu %0,%3,%4"                                            \
-	   : "=r" ((USItype)(q)),                                       \
-	     "=q" ((USItype)(r))                                        \
-	   : "1" ((USItype)(n1)),                                       \
-	     "r" ((USItype)(n0)),                                       \
-	     "r" ((USItype)(d)))
-# define count_leading_zeros(count, x) \
-    __asm__ ("clz %0,%1"                                                \
-	     : "=r" ((USItype)(count))                                  \
-	     : "r" ((USItype)(x)))
-# define COUNT_LEADING_ZEROS_0 32
-#endif /* __a29k__ */
-
-
 #if defined (__alpha) && W_TYPE_SIZE == 64
 # define umul_ppmm(ph, pl, m0, m1) \
   do {									\
@@ -326,81 +277,6 @@ extern UDItype __udiv_qrnnd (UDItype *, UDItype, UDItype, UDItype);
   } while (0)
 #endif /* __aarch64__ */
 
-/***************************************
- **************  CLIPPER  **************
- ***************************************/
-#if defined (__clipper__) && W_TYPE_SIZE == 32
-# define umul_ppmm(w1, w0, u, v) \
-  ({union {UDItype __ll;						\
-	   struct {USItype __l, __h;} __i;				\
-	  } __xx;							\
-  __asm__ ("mulwux %2,%0"                                               \
-	   : "=r" (__xx.__ll)                                           \
-	   : "%0" ((USItype)(u)),                                       \
-	     "r" ((USItype)(v)));                                       \
-  (w1) = __xx.__i.__h; (w0) = __xx.__i.__l;})
-# define smul_ppmm(w1, w0, u, v) \
-  ({union {DItype __ll; 						\
-	   struct {SItype __l, __h;} __i;				\
-	  } __xx;							\
-  __asm__ ("mulwx %2,%0"                                                \
-	   : "=r" (__xx.__ll)                                           \
-	   : "%0" ((SItype)(u)),                                        \
-	     "r" ((SItype)(v)));                                        \
-  (w1) = __xx.__i.__h; (w0) = __xx.__i.__l;})
-# define __umulsidi3(u, v) \
-  ({UDItype __w;							\
-    __asm__ ("mulwux %2,%0"                                             \
-	     : "=r" (__w)                                               \
-	     : "%0" ((USItype)(u)),                                     \
-	       "r" ((USItype)(v)));                                     \
-    __w; })
-#endif /* __clipper__ */
-
-
-/***************************************
- **************  GMICRO  ***************
- ***************************************/
-#if defined (__gmicro__) && W_TYPE_SIZE == 32
-# define add_ssaaaa(sh, sl, ah, al, bh, bl) \
-  __asm__ ("add.w %5,%1\n"                                              \
-	   "addx %3,%0"                                                 \
-	   : "=g" ((USItype)(sh)),                                      \
-	     "=&g" ((USItype)(sl))                                      \
-	   : "%0" ((USItype)(ah)),                                      \
-	     "g" ((USItype)(bh)),                                       \
-	     "%1" ((USItype)(al)),                                      \
-	     "g" ((USItype)(bl)))
-# define sub_ddmmss(sh, sl, ah, al, bh, bl) \
-  __asm__ ("sub.w %5,%1\n"                                              \
-	   "subx %3,%0"                                                 \
-	   : "=g" ((USItype)(sh)),                                      \
-	     "=&g" ((USItype)(sl))                                      \
-	   : "0" ((USItype)(ah)),                                       \
-	     "g" ((USItype)(bh)),                                       \
-	     "1" ((USItype)(al)),                                       \
-	     "g" ((USItype)(bl)))
-# define umul_ppmm(ph, pl, m0, m1) \
-  __asm__ ("mulx %3,%0,%1"                                              \
-	   : "=g" ((USItype)(ph)),                                      \
-	     "=r" ((USItype)(pl))                                       \
-	   : "%0" ((USItype)(m0)),                                      \
-	     "g" ((USItype)(m1)))
-# define udiv_qrnnd(q, r, nh, nl, d) \
-  __asm__ ("divx %4,%0,%1"                                              \
-	   : "=g" ((USItype)(q)),                                       \
-	     "=r" ((USItype)(r))                                        \
-	   : "1" ((USItype)(nh)),                                       \
-	     "0" ((USItype)(nl)),                                       \
-	     "g" ((USItype)(d)))
-# define count_leading_zeros(count, x) \
-  __asm__ ("bsch/1 %1,%0"                                               \
-	   : "=g" (count)                                               \
-	   : "g" ((USItype)(x)),                                        \
-	     "0" ((USItype)0))
-#endif
-
-
 /***************************************
  **************  HPPA  *****************
  ***************************************/
@@ -640,16 +516,6 @@ extern USItype __udiv_qrnnd (USItype *, USItype, USItype, USItype);
 #endif /* __x86_64 */
 
 
-/***************************************
- **************  I860  *****************
- ***************************************/
-#if defined (__i860__) && W_TYPE_SIZE == 32
-# define rshift_rhlc(r,h,l,c) \
-  __asm__ ("shr %3,r0,r0\n"  \
-           "shrd %1,%2,%0"   \
-	   "=r" (r) : "r" (h), "r" (l), "rn" (c))
-#endif /* i860 */
-
 /***************************************
  **************  I960  *****************
  ***************************************/
@@ -938,46 +804,6 @@ typedef unsigned int UTItype __attribute__ ((mode (TI)));
 #endif /* __mips__ */
 
 
-/***************************************
- **************  32000	****************
- ***************************************/
-#if defined (__ns32000__) && W_TYPE_SIZE == 32
-# define umul_ppmm(w1, w0, u, v) \
-  ({union {UDItype __ll;						\
-	   struct {USItype __l, __h;} __i;				\
-	  } __xx;							\
-  __asm__ ("meid %2,%0"                                                 \
-	   : "=g" (__xx.__ll)                                           \
-	   : "%0" ((USItype)(u)),                                       \
-	     "g" ((USItype)(v)));                                       \
-  (w1) = __xx.__i.__h; (w0) = __xx.__i.__l;})
-# define __umulsidi3(u, v) \
-  ({UDItype __w;							\
-    __asm__ ("meid %2,%0"                                               \
-	     : "=g" (__w)                                               \
-	     : "%0" ((USItype)(u)),                                     \
-	       "g" ((USItype)(v)));                                     \
-    __w; })
-# define udiv_qrnnd(q, r, n1, n0, d) \
-  ({union {UDItype __ll;						\
-	   struct {USItype __l, __h;} __i;				\
-	  } __xx;							\
-  __xx.__i.__h = (n1); __xx.__i.__l = (n0);				\
-  __asm__ ("deid %2,%0"                                                 \
-	   : "=g" (__xx.__ll)                                           \
-	   : "0" (__xx.__ll),                                           \
-	     "g" ((USItype)(d)));                                       \
-  (r) = __xx.__i.__l; (q) = __xx.__i.__h; })
-# define count_trailing_zeros(count,x) \
-  do {
-    __asm__ ("ffsd      %2,%0"                                          \
-	     : "=r" ((USItype) (count))                                 \
-	     : "0" ((USItype) 0),                                       \
-	       "r" ((USItype) (x)));                                    \
-  } while (0)
-#endif /* __ns32000__ */
-
-
 /***************************************
  **************  PPC  ******************
  ***************************************/
@@ -1113,42 +939,6 @@ typedef unsigned int UTItype __attribute__ ((mode (TI)));
 # define UDIV_TIME 120 /* ??? */
 #endif /* 64-bit PowerPC.  */
 
-/***************************************
- **************  PYR  ******************
- ***************************************/
-#if defined (__pyr__) && W_TYPE_SIZE == 32
-# define add_ssaaaa(sh, sl, ah, al, bh, bl) \
-  __asm__ ("addw        %5,%1 \n" \
-	   "addwc	%3,%0"                                          \
-	   : "=r" ((USItype)(sh)),                                      \
-	     "=&r" ((USItype)(sl))                                      \
-	   : "%0" ((USItype)(ah)),                                      \
-	     "g" ((USItype)(bh)),                                       \
-	     "%1" ((USItype)(al)),                                      \
-	     "g" ((USItype)(bl)))
-# define sub_ddmmss(sh, sl, ah, al, bh, bl) \
-  __asm__ ("subw        %5,%1 \n" \
-	   "subwb	%3,%0"                                          \
-	   : "=r" ((USItype)(sh)),                                      \
-	     "=&r" ((USItype)(sl))                                      \
-	   : "0" ((USItype)(ah)),                                       \
-	     "g" ((USItype)(bh)),                                       \
-	     "1" ((USItype)(al)),                                       \
-	     "g" ((USItype)(bl)))
-/* This insn works on Pyramids with AP, XP, or MI CPUs, but not with SP.  */
-# define umul_ppmm(w1, w0, u, v) \
-  ({union {UDItype __ll;						\
-	   struct {USItype __h, __l;} __i;				\
-	  } __xx;							\
-  __asm__ ("movw %1,%R0 \n" \
-	   "uemul %2,%0"                                                \
-	   : "=&r" (__xx.__ll)                                          \
-	   : "g" ((USItype) (u)),                                       \
-	     "g" ((USItype)(v)));                                       \
-  (w1) = __xx.__i.__h; (w0) = __xx.__i.__l;})
-#endif /* __pyr__ */
-
-
 /***************************************
  **************  RT/ROMP  **************
  ***************************************/
@@ -1470,44 +1260,6 @@ extern USItype __udiv_qrnnd (USItype *, USItype, USItype, USItype);
 #endif /* __vax__ */
 
 
-/***************************************
- **************  Z8000	****************
- ***************************************/
-#if defined (__z8000__) && W_TYPE_SIZE == 16
-# define add_ssaaaa(sh, sl, ah, al, bh, bl) \
-  __asm__ ("add %H1,%H5\n\tadc  %H0,%H3"                                \
-	   : "=r" ((unsigned int)(sh)),                                 \
-	     "=&r" ((unsigned int)(sl))                                 \
-	   : "%0" ((unsigned int)(ah)),                                 \
-	     "r" ((unsigned int)(bh)),                                  \
-	     "%1" ((unsigned int)(al)),                                 \
-	     "rQR" ((unsigned int)(bl)))
-# define sub_ddmmss(sh, sl, ah, al, bh, bl) \
-  __asm__ ("sub %H1,%H5\n\tsbc  %H0,%H3"                                \
-	   : "=r" ((unsigned int)(sh)),                                 \
-	     "=&r" ((unsigned int)(sl))                                 \
-	   : "0" ((unsigned int)(ah)),                                  \
-	     "r" ((unsigned int)(bh)),                                  \
-	     "1" ((unsigned int)(al)),                                  \
-	     "rQR" ((unsigned int)(bl)))
-# define umul_ppmm(xh, xl, m0, m1) \
-  do {									\
-    union {long int __ll;						\
-	   struct {unsigned int __h, __l;} __i; 			\
-	  } __xx;							\
-    unsigned int __m0 = (m0), __m1 = (m1);				\
-    __asm__ ("mult      %S0,%H3"                                        \
-	     : "=r" (__xx.__i.__h),                                     \
-	       "=r" (__xx.__i.__l)                                      \
-	     : "%1" (__m0),                                             \
-	       "rQR" (__m1));                                           \
-    (xh) = __xx.__i.__h; (xl) = __xx.__i.__l;				\
-    (xh) += ((((signed int) __m0 >> 15) & __m1) 			\
-	     + (((signed int) __m1 >> 15) & __m0));			\
-  } while (0)
-#endif /* __z8000__ */
-
-
 /***************************************
  *********** s390x/zSeries  ************
  ***************************************/

-- 
2.56.1



More information about the Gcrypt-devel mailing list