1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 .file "round_Xsig.S"
20
21 #include "fpu_asm.h"
22
23
24 .text
25
26 .align 2,144
27 .globl _round_Xsig
28
29 _round_Xsig:
30 pushl %ebp
31 movl %esp,%ebp
32 pushl %ebx
33 pushl %ebx
34 pushl %esi
35
36 movl PARAM1,%esi
37
38 movl 8(%esi),%edx
39 movl 4(%esi),%ebx
40 movl (%esi),%eax
41
42 movl $0,-4(%ebp)
43
44 orl %edx,%edx
45 js L_round
46 jnz L_shift_1
47
48 movl %ebx,%edx
49 movl %eax,%ebx
50 xorl %eax,%eax
51 movl $-32,-4(%ebp)
52
53
54 L_shift_1:
55 bsrl %edx,%ecx
56 subl $31,%ecx
57 negl %ecx
58 subl %ecx,-4(%ebp)
59 shld %cl,%ebx,%edx
60 shld %cl,%eax,%ebx
61 shl %cl,%eax
62
63 L_round:
64 testl $0x80000000,%eax
65 jz L_exit
66
67 addl $1,%ebx
68 adcl $0,%edx
69 jnz L_exit
70
71 movl $0x80000000,%edx
72 incl -4(%ebp)
73
74 L_exit:
75 movl %edx,8(%esi)
76 movl %ebx,4(%esi)
77 movl %eax,(%esi)
78
79 movl -4(%ebp),%eax
80
81 popl %esi
82 popl %ebx
83 leave
84 ret
85
86
87
88
89 .align 2,144
90 .globl _norm_Xsig
91
92 _norm_Xsig:
93 pushl %ebp
94 movl %esp,%ebp
95 pushl %ebx
96 pushl %ebx
97 pushl %esi
98
99 movl PARAM1,%esi
100
101 movl 8(%esi),%edx
102 movl 4(%esi),%ebx
103 movl (%esi),%eax
104
105 movl $0,-4(%ebp)
106
107 orl %edx,%edx
108 js L_n_exit
109 jnz L_n_shift_1
110
111 movl %ebx,%edx
112 movl %eax,%ebx
113 xorl %eax,%eax
114 movl $-32,-4(%ebp)
115
116 orl %edx,%edx
117 js L_n_exit
118 jnz L_n_shift_1
119
120 movl %ebx,%edx
121 movl %eax,%ebx
122 xorl %eax,%eax
123 addl $-32,-4(%ebp)
124 jmp L_n_exit
125
126
127
128 L_n_shift_1:
129 bsrl %edx,%ecx
130 subl $31,%ecx
131 negl %ecx
132 subl %ecx,-4(%ebp)
133 shld %cl,%ebx,%edx
134 shld %cl,%eax,%ebx
135 shl %cl,%eax
136
137 L_n_exit:
138 movl %edx,8(%esi)
139 movl %ebx,4(%esi)
140 movl %eax,(%esi)
141
142 movl -4(%ebp),%eax
143
144 popl %esi
145 popl %ebx
146 leave
147 ret
148