blob: 0dcace96e4e7ef3c0b103868f93f6c9672e2e340 [file] [log] [blame]
Robin Getz96f10502009-09-24 14:11:24 +00001/*
2 * Copyright 2007 Analog Devices Inc.
3 *
Sonic Zhangde450832012-05-17 14:45:27 +08004 * Licensed under the Clear BSD license or the GPL-2 (or later)
Robin Getz96f10502009-09-24 14:11:24 +00005 */
6
Bryan Wu1394f032007-05-06 14:50:22 -07007.align 2
8.global ___umulsi3_highpart;
9.type ___umulsi3_highpart, STT_FUNC;
10
11#ifdef CONFIG_ARITHMETIC_OPS_L1
12.section .l1.text
13#else
14.text
15#endif
16
17___umulsi3_highpart:
18 R2 = R1.H * R0.H, R3 = R1.L * R0.H (FU);
19 R0 = R1.L * R0.L, R1 = R1.H * R0.L (FU);
20 R0 >>= 16;
21 /* Unsigned multiplication has the nice property that we can
22 ignore carry on this first addition. */
23 R0 = R0 + R3;
24 R0 = R0 + R1;
25 cc = ac0;
26 R1 = cc;
27 R1 = PACK(R1.l,R0.h);
28 R0 = R1 + R2;
29 RTS;
Mike Frysinger51be24c2007-06-11 15:31:30 +080030
31.size ___umulsi3_highpart, .-___umulsi3_highpart