* Copyright (c) 1992 The Regents of the University of California.
* %sccs.include.redist.c%
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid
[] = "@(#)muldi3.c 5.3 (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */
long a
[2], b
[2], c
[2][2];
bmul (a
, b
, c
, sizeof a
, sizeof b
);
unsigned short *a
, *b
, *c
;
for (i
= m
+ n
, d
= c
; i
-- > 0; *d
++ = 0)
for (j
= little_end (n
); is_not_msd (j
, n
); j
= next_msd (j
))
unsigned short *c1
= c
+ j
+ little_end (2);
for (i
= little_end (m
); is_not_msd (i
, m
); i
= next_msd (i
))
/* Widen before arithmetic to avoid loss of high bits. */
acc
+= (unsigned long) a
[i
] * b
[j
] + c1
[i
];