Lines Matching +full:compare +full:- +full:and +full:- +full:swap
5 | input values X and Y. The entry point sREM computes the floating
6 | point (IEEE) REM of the input values X and Y.
9 | -----
10 | Double-extended value Y is pointed to by address in register
11 | A0. Double-extended value X is located in -12(A0). The values
12 | of X and Y are both nonzero and finite; although either or both
14 | and infinities are handled elsewhere.
17 | ------
21 | ---------
23 | Step 1. Save and strip signs of X and Y: signX := sign(X),
28 | Step 2. Set L := expo(X)-expo(Y), k := 0, Q := 0.
32 | R := 2^(-L)X, j := L.
37 | 3.2 If R > Y, then { R := R - Y, Q := Q + 1}
39 | 3.4 k := k + 1, j := j - 1, Q := 2Q, R := 2R. Go to
42 | Step 4. At this point, R = X - QY = MOD(X,Y). Set
52 | then { Q := Q + 1, signX := -signX }.
56 | Step 7. If Last_Subtract = true, R := R - Y.
58 | Step 8. Return signQ, last 7 bits of Q, and R as required.
60 | Step 9. At this point, R = 2^(-j)*X - Q Y = Y. Thus,
62 | R := 0. Return signQ, last 7 bits of Q, and R.
109 |..Save sign of X and Y
110 moveml %d2-%d7,-(%a7) | ...save data registers
156 movew -12(%a0),%d0
163 movel -8(%a0),%d1
164 movel -4(%a0),%d2 | ...(D0,D1,D2) is |X|
204 subl %d3,%d0 | ...L := expo(X)-expo(Y)
206 clrl %d6 | ...D6 := carry <- 0
219 |..At this point R = 2^(-L)X; Q = 0; k = 0; and k+j = L
227 cmpl %d4,%d1 | ...compare hi(R) and hi(Y)
229 cmpl %d5,%d2 | ...compare lo(R) and lo(Y)
236 |..use the borrow of the previous compare
241 |..and Y < (D1,D2) < 2Y. Either way, perform R - Y
242 subl %d5,%d2 | ...lo(R) - lo(Y)
243 subxl %d4,%d1 | ...hi(R) - hi(Y)
248 |..At this point, Carry=0, R < Y. R = 2^(k-L)X - QY; k+j = L; j >= 0.
257 subql #1,%d0 | ...j := j - 1
258 |..At this point, R=(Carry,D1,D2) = 2^(k-L)X - QY, j+k=L, j >= 0, R < 2Y.
263 |..k = L, j = 0, Carry = 0, R = (D1,D2) = X - QY, R < Y.
369 orl %d6,%d3 | ...sign and bits of Q
370 swap %d3
378 moveml (%a7)+,%d2-%d7
391 |..R = 2^(-j)X - Q Y = Y, thus R = 0 and quotient = 2^j (Q+1)
414 |..Q is odd, Q := Q + 1, signX := -signX