Lines Matching +full:0 +full:- +full:32
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Divide a 64-bit unsigned number by a 32-bit unsigned number.
4 * This routine assumes that the top 32 bits of the dividend are
5 * non-zero to start with.
7 * the 64-bit quotient, and r4 contains the divisor.
16 lwz r5,0(r3) # get the dividend into r5/r6
19 li r7,0
20 li r8,0
26 1: mr r11,r5 # here dividend.hi != 0
27 andis. r0,r5,0xc000
30 li r10,-1 # to make it < 2^32, and shifting
48 divwu r0,r6,r4 # perform the remaining 32-bit division
52 4: stw r7,0(r3) # return the quotient in *r3
60 * Updated to be valid for shift counts from 0 to 63 inclusive.
61 * -- Gabriel
73 subfic r6,r5,32
74 srw r4,r4,r5 # LSW = count > 31 ? 0 : LSW >> count
75 addi r7,r5,32 # could be xori, or addi with -32
76 slw r6,r3,r6 # t1 = count > 31 ? 0 : MSW << (32-count)
77 rlwinm r8,r7,0,32 # t3 = (count < 32) ? 32 : 0
78 sraw r7,r3,r7 # t2 = MSW >> (count-32)
80 slw r7,r7,r8 # t2 = (count < 32) ? 0 : t2
87 subfic r6,r5,32
88 slw r3,r3,r5 # MSW = count > 31 ? 0 : MSW << count
89 addi r7,r5,32 # could be xori, or addi with -32
90 srw r6,r4,r6 # t1 = count > 31 ? 0 : LSW >> (32-count)
91 slw r7,r4,r7 # t2 = count < 32 ? 0 : LSW << (count-32)
99 subfic r6,r5,32
100 srw r4,r4,r5 # LSW = count > 31 ? 0 : LSW >> count
101 addi r7,r5,32 # could be xori, or addi with -32
102 slw r6,r3,r6 # t1 = count > 31 ? 0 : MSW << (32-count)
103 srw r7,r3,r7 # t2 = count < 32 ? 0 : MSW >> (count-32)