1 /*---------------------------------------------------------------------------+
4 | Copyright (C) 1992,1993,1994,1995 |
5 | W. Metzenthen, 22 Parker St, Ormond, Vic 3163, |
6 | Australia. E-mail billm@jacobi.maths.monash.edu.au |
8 | Normalize and round a 12 byte quantity. |
10 | int round_Xsig(Xsig *n) |
12 | Normalize a 12 byte quantity. |
14 | int norm_Xsig(Xsig *n) |
16 | Each function returns the size of the shift (nr of bits). |
18 +---------------------------------------------------------------------------*/
28 pushl %ebx /* Reserve some space */
40 orl %edx,%edx /* ms bits */
41 js L_round /* Already normalized */
42 jnz L_shift_1 /* Shift left 1 - 31 bits */
49 /* We need to shift left by 1 - 31 bits */
51 bsrl %edx,%ecx /* get the required shift in %ecx */
60 testl $0x80000000,%eax
88 pushl %ebx /* Reserve some space */
100 orl %edx,%edx /* ms bits */
101 js L_n_exit /* Already normalized */
102 jnz L_n_shift_1 /* Shift left 1 - 31 bits */
109 orl %edx,%edx /* ms bits */
110 js L_n_exit /* Normalized now */
111 jnz L_n_shift_1 /* Shift left 1 - 31 bits */
117 jmp L_n_exit /* Might not be normalized,
118 but shift no more. */
120 /* We need to shift left by 1 - 31 bits */
122 bsrl %edx,%ecx /* get the required shift in %ecx */