source: trunk/minix/lib/ack/float/shifter.s@ 10

Last change on this file since 10 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 1.4 KB
Line 
1.sect .text; .sect .rom; .sect .data; .sect .bss
2.extern .b64_sft
3.sect .text
4.b64_sft:
5push ebp
6mov ebp,esp
7push esi
8push edi
9mov esi,8(ebp)
10mov edi,12(ebp)
11! kill cc
12test edi,edi
13jle I1_4
14cmp edi,63
15jle I1_7
16mov 4(esi),0
17mov (esi),0
18jmp I1_1
19I1_7:
20cmp edi,32
21jl I1_10
22mov edx,(esi)
23mov 4(esi),edx
24mov (esi),0
25sub edi,32
26I1_10:
27! kill cc
28test edi,edi
29jle I1_1
30mov ecx,edi
31mov edx,4(esi)
32shr edx,cl
33mov 4(esi),edx
34cmp (esi),0
35je I1_1
36mov edx,32
37sub edx,edi
38mov ecx,edx
39mov edx,(esi)
40sal edx,cl
41or 4(esi),edx
42mov ecx,edi
43mov edx,(esi)
44shr edx,cl
45mov (esi),edx
46jmp I1_1
47I1_4:
48neg edi
49! kill cc
50test edi,edi
51jle I1_1
52cmp edi,63
53jle I1_22
54mov 4(esi),0
55mov (esi),0
56jmp I1_1
57I1_22:
58cmp edi,32
59jl I1_25
60mov edx,4(esi)
61mov (esi),edx
62mov 4(esi),0
63sub edi,32
64I1_25:
65! kill cc
66test edi,edi
67jle I1_1
68mov ecx,edi
69mov edx,(esi)
70sal edx,cl
71mov (esi),edx
72cmp 4(esi),0
73je I1_1
74mov edx,32
75sub edx,edi
76mov ecx,edx
77mov edx,4(esi)
78shr edx,cl
79or (esi),edx
80mov ecx,edi
81mov edx,4(esi)
82sal edx,cl
83mov 4(esi),edx
84I1_1:
85pop edi
86pop esi
87leave
88ret
89.extern .b64_lsft
90.b64_lsft:
91push ebp
92mov ebp,esp
93push esi
94mov esi,8(ebp)
95sal (esi),1
96test 4(esi),-2147483648
97je I2_4
98or (esi),1
99I2_4:
100mov edx,4(esi)
101sal edx,1
102mov 4(esi),edx
103pop esi
104leave
105ret
106.extern .b64_rsft
107.b64_rsft:
108push ebp
109mov ebp,esp
110push esi
111mov esi,8(ebp)
112mov edx,4(esi)
113shr edx,1
114mov 4(esi),edx
115mov edx,(esi)
116testb dl,1
117je I3_4
118or 4(esi),-2147483648
119I3_4:
120shr (esi),1
121pop esi
122leave
123ret
Note: See TracBrowser for help on using the repository browser.