diff options
Diffstat (limited to 'arch/powerpc/kernel/misc_32.S')
-rw-r--r-- | arch/powerpc/kernel/misc_32.S | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S index 0b0e908b5065..303229b090b8 100644 --- a/arch/powerpc/kernel/misc_32.S +++ b/arch/powerpc/kernel/misc_32.S | |||
@@ -36,6 +36,33 @@ _GLOBAL(__delay) | |||
36 | blr | 36 | blr |
37 | 37 | ||
38 | /* | 38 | /* |
39 | * This returns the high 64 bits of the product of two 64-bit numbers. | ||
40 | */ | ||
41 | _GLOBAL(mulhdu) | ||
42 | cmpwi r6,0 | ||
43 | cmpwi cr1,r3,0 | ||
44 | mr r10,r4 | ||
45 | mulhwu r4,r4,r5 | ||
46 | beq 1f | ||
47 | mulhwu r0,r10,r6 | ||
48 | mullw r7,r10,r5 | ||
49 | addc r7,r0,r7 | ||
50 | addze r4,r4 | ||
51 | 1: beqlr cr1 /* all done if high part of A is 0 */ | ||
52 | mr r10,r3 | ||
53 | mullw r9,r3,r5 | ||
54 | mulhwu r3,r3,r5 | ||
55 | beq 2f | ||
56 | mullw r0,r10,r6 | ||
57 | mulhwu r8,r10,r6 | ||
58 | addc r7,r0,r7 | ||
59 | adde r4,r4,r8 | ||
60 | addze r3,r3 | ||
61 | 2: addc r4,r4,r9 | ||
62 | addze r3,r3 | ||
63 | blr | ||
64 | |||
65 | /* | ||
39 | * Returns (address we're running at) - (address we were linked at) | 66 | * Returns (address we're running at) - (address we were linked at) |
40 | * for use before the text and data are mapped to KERNELBASE. | 67 | * for use before the text and data are mapped to KERNELBASE. |
41 | */ | 68 | */ |