1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*---------------------------------------------------------------------------+
5 | Copyright (C) 1992,1993,1994,1995 |
6 | W. Metzenthen, 22 Parker St, Ormond, Vic 3163, |
7 | Australia. E-mail billm@jacobi.maths.monash.edu.au |
9 | Normalize and round a 12 byte quantity. |
11 | int round_Xsig(Xsig *n) |
13 | Normalize a 12 byte quantity. |
15 | int norm_Xsig(Xsig *n) |
17 | Each function returns the size of the shift (nr of bits). |
19 +---------------------------------------------------------------------------*/
29 pushl %ebx /* Reserve some space */
41 orl %edx,%edx /* ms bits */
42 js L_round /* Already normalized */
43 jnz L_shift_1 /* Shift left 1 - 31 bits */
50 /* We need to shift left by 1 - 31 bits */
52 bsrl %edx,%ecx /* get the required shift in %ecx */
61 testl $0x80000000,%eax
89 pushl %ebx /* Reserve some space */
101 orl %edx,%edx /* ms bits */
102 js L_n_exit /* Already normalized */
103 jnz L_n_shift_1 /* Shift left 1 - 31 bits */
110 orl %edx,%edx /* ms bits */
111 js L_n_exit /* Normalized now */
112 jnz L_n_shift_1 /* Shift left 1 - 31 bits */
118 jmp L_n_exit /* Might not be normalized,
119 but shift no more. */
121 /* We need to shift left by 1 - 31 bits */
123 bsrl %edx,%ecx /* get the required shift in %ecx */