]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/powerpc/kernel/misc_32.S
[PATCH] powerpc: Merge signal.h
[karo-tx-linux.git] / arch / powerpc / kernel / misc_32.S
index 0b0e908b50652bee6a9471349e49953f9d4ff771..3bedb532aed92c271c6cdd6b1698071d3ed5e30e 100644 (file)
@@ -35,6 +35,33 @@ _GLOBAL(__delay)
 1:     bdnz    1b
        blr
 
+/*
+ * This returns the high 64 bits of the product of two 64-bit numbers.
+ */
+_GLOBAL(mulhdu)
+       cmpwi   r6,0
+       cmpwi   cr1,r3,0
+       mr      r10,r4
+       mulhwu  r4,r4,r5
+       beq     1f
+       mulhwu  r0,r10,r6
+       mullw   r7,r10,r5
+       addc    r7,r0,r7
+       addze   r4,r4
+1:     beqlr   cr1             /* all done if high part of A is 0 */
+       mr      r10,r3
+       mullw   r9,r3,r5
+       mulhwu  r3,r3,r5
+       beq     2f
+       mullw   r0,r10,r6
+       mulhwu  r8,r10,r6
+       addc    r7,r0,r7
+       adde    r4,r4,r8
+       addze   r3,r3
+2:     addc    r4,r4,r9
+       addze   r3,r3
+       blr
+
 /*
  * Returns (address we're running at) - (address we were linked at)
  * for use before the text and data are mapped to KERNELBASE.
@@ -965,33 +992,6 @@ _GLOBAL(_get_SP)
        mr      r3,r1           /* Close enough */
        blr
 
-/*
- * These are used in the alignment trap handler when emulating
- * single-precision loads and stores.
- * We restore and save the fpscr so the task gets the same result
- * and exceptions as if the cpu had performed the load or store.
- */
-
-#ifdef CONFIG_PPC_FPU
-_GLOBAL(cvt_fd)
-       lfd     0,-4(r5)        /* load up fpscr value */
-       mtfsf   0xff,0
-       lfs     0,0(r3)
-       stfd    0,0(r4)
-       mffs    0               /* save new fpscr value */
-       stfd    0,-4(r5)
-       blr
-
-_GLOBAL(cvt_df)
-       lfd     0,-4(r5)        /* load up fpscr value */
-       mtfsf   0xff,0
-       lfd     0,0(r3)
-       stfs    0,0(r4)
-       mffs    0               /* save new fpscr value */
-       stfd    0,-4(r5)
-       blr
-#endif
-
 /*
  * Create a kernel thread
  *   kernel_thread(fn, arg, flags)