[PATCH v2 21/32] mpi: Sync the VAX longlong.h with GCC.
Matt Turner
mattst88 at gmail.com
Wed Nov 25 21:19:58 CET 2026
* mpi/longlong.h [__vax__] (umul_ppmm): Use "=r" for the emul
destination, as GCC does. Use GCC's text for the rest of the block.
--
Take the VAX block from GCC's copy of longlong.h. GCC's umul_ppmm
has used "=r" for the 64-bit emul result since it was added; libgcrypt
used "=g". The rest is whitespace and joining the add_ssaaaa and
sub_ddmmss asm strings with "\n\t".
Signed-off-by: Matt Turner <mattst88 at gmail.com>
---
mpi/longlong.h | 66 +++++++++++++++++++++++++++++-----------------------------
1 file changed, 33 insertions(+), 33 deletions(-)
diff --git a/mpi/longlong.h b/mpi/longlong.h
index c8514a2d..41f2c0fb 100644
--- a/mpi/longlong.h
+++ b/mpi/longlong.h
@@ -1243,47 +1243,47 @@ extern USItype __udiv_qrnnd (USItype *, USItype, USItype, USItype);
************** VAX ******************
***************************************/
#if defined (__vax__) && W_TYPE_SIZE == 32
-# define add_ssaaaa(sh, sl, ah, al, bh, bl) \
- __asm__ ("addl2 %5,%1\n" \
- "adwc %3,%0" \
- : "=g" __ll_check_output (USItype, sh), \
- "=&g" __ll_check_output (USItype, sl) \
- : "%0" ((USItype)(ah)), \
- "g" ((USItype)(bh)), \
- "%1" ((USItype)(al)), \
- "g" ((USItype)(bl)))
-# define sub_ddmmss(sh, sl, ah, al, bh, bl) \
- __asm__ ("subl2 %5,%1\n" \
- "sbwc %3,%0" \
- : "=g" __ll_check_output (USItype, sh), \
- "=&g" __ll_check_output (USItype, sl) \
- : "0" ((USItype)(ah)), \
- "g" ((USItype)(bh)), \
- "1" ((USItype)(al)), \
- "g" ((USItype)(bl)))
-# define umul_ppmm(xh, xl, m0, m1) \
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("addl2 %5,%1\n\tadwc %3,%0" \
+ : "=g" __ll_check_output (USItype, sh), \
+ "=&g" __ll_check_output (USItype, sl) \
+ : "%0" ((USItype) (ah)), \
+ "g" ((USItype) (bh)), \
+ "%1" ((USItype) (al)), \
+ "g" ((USItype) (bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("subl2 %5,%1\n\tsbwc %3,%0" \
+ : "=g" __ll_check_output (USItype, sh), \
+ "=&g" __ll_check_output (USItype, sl) \
+ : "0" ((USItype) (ah)), \
+ "g" ((USItype) (bh)), \
+ "1" ((USItype) (al)), \
+ "g" ((USItype) (bl)))
+#define umul_ppmm(xh, xl, m0, m1) \
do { \
- union {UDItype __ll; \
- struct {USItype __l, __h;} __i; \
- } __xx; \
+ union { \
+ UDItype __ll; \
+ struct {USItype __l, __h;} __i; \
+ } __xx; \
USItype __m0 = (m0), __m1 = (m1); \
- __asm__ ("emul %1,%2,$0,%0" \
- : "=g" (__xx.__ll) \
- : "g" (__m0), \
- "g" (__m1)); \
- (xh) = __xx.__i.__h; (xl) = __xx.__i.__l; \
+ __asm__ ("emul %1,%2,$0,%0" \
+ : "=r" (__xx.__ll) \
+ : "g" (__m0), \
+ "g" (__m1)); \
+ (xh) = __xx.__i.__h; \
+ (xl) = __xx.__i.__l; \
(xh) += ((((SItype) __m0 >> 31) & __m1) \
- + (((SItype) __m1 >> 31) & __m0)); \
+ + (((SItype) __m1 >> 31) & __m0)); \
} while (0)
-# define sdiv_qrnnd(q, r, n1, n0, d) \
+#define sdiv_qrnnd(q, r, n1, n0, d) \
do { \
- union {DItype __ll; \
+ union {DItype __ll; \
struct {SItype __l, __h;} __i; \
} __xx; \
__xx.__i.__h = (n1); __xx.__i.__l = (n0); \
- __asm__ ("ediv %3,%2,%0,%1" \
- : "=g" (q), "=g" (r) \
- : "g" (__xx.__ll), "g" (d)); \
+ __asm__ ("ediv %3,%2,%0,%1" \
+ : "=g" (q), "=g" (r) \
+ : "g" (__xx.__ll), "g" (d)); \
} while (0)
#endif /* __vax__ */
--
2.56.1
More information about the Gcrypt-devel
mailing list