Rev 1787 | Rev 2071 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1787 | Rev 1877 | ||
---|---|---|---|
Line 24... | Line 24... | ||
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | */ |
27 | */ |
28 | 28 | ||
29 | /** @addtogroup ia64 |
29 | /** @addtogroup ia64 |
30 | * @{ |
30 | * @{ |
31 | */ |
31 | */ |
32 | /** @file |
32 | /** @file |
33 | * |
33 | * |
34 | */ |
34 | */ |
35 | 35 | ||
36 | #include <fpu_context.h> |
36 | #include <fpu_context.h> |
37 | #include <arch/register.h> |
37 | #include <arch/register.h> |
38 | #include <print.h> |
38 | #include <print.h> |
39 | 39 | ||
40 | 40 | void fpu_context_save(fpu_context_t *fctx) |
|
41 | void fpu_context_save(fpu_context_t *fctx){ |
41 | { |
42 | 42 | asm volatile ( |
|
43 | asm volatile( |
43 | "stf.spill [%0] = f32, 0x80\n" |
44 | 44 | "stf.spill [%1] = f33, 0x80\n" |
|
45 | "stf.spill [%0]=f32,0x80\n" |
45 | "stf.spill [%2] = f34, 0x80\n" |
46 | "stf.spill [%1]=f33,0x80\n" |
46 | "stf.spill [%3] = f35, 0x80\n" |
47 | "stf.spill [%2]=f34,0x80\n" |
47 | "stf.spill [%4] = f36, 0x80\n" |
48 | "stf.spill [%3]=f35,0x80\n" |
48 | "stf.spill [%5] = f37, 0x80\n" |
49 | "stf.spill [%4]=f36,0x80\n" |
49 | "stf.spill [%6] = f38, 0x80\n" |
50 | "stf.spill [%5]=f37,0x80\n" |
50 | "stf.spill [%7] = f39, 0x80\n;;" |
51 | "stf.spill [%6]=f38,0x80\n" |
51 | |
52 | "stf.spill [%7]=f39,0x80\n;;" |
52 | "stf.spill [%0] = f40, 0x80\n" |
53 | 53 | "stf.spill [%1] = f41, 0x80\n" |
|
54 | "stf.spill [%0]=f40,0x80\n" |
54 | "stf.spill [%2] = f42, 0x80\n" |
55 | "stf.spill [%1]=f41,0x80\n" |
55 | "stf.spill [%3] = f43, 0x80\n" |
56 | "stf.spill [%2]=f42,0x80\n" |
56 | "stf.spill [%4] = f44, 0x80\n" |
57 | "stf.spill [%3]=f43,0x80\n" |
57 | "stf.spill [%5] = f45, 0x80\n" |
58 | "stf.spill [%4]=f44,0x80\n" |
58 | "stf.spill [%6] = f46, 0x80\n" |
59 | "stf.spill [%5]=f45,0x80\n" |
59 | "stf.spill [%7] = f47, 0x80\n;;" |
60 | "stf.spill [%6]=f46,0x80\n" |
60 | |
61 | "stf.spill [%7]=f47,0x80\n;;" |
61 | "stf.spill [%0] = f48, 0x80\n" |
62 | 62 | "stf.spill [%1] = f49, 0x80\n" |
|
63 | "stf.spill [%0]=f48,0x80\n" |
63 | "stf.spill [%2] = f50, 0x80\n" |
64 | "stf.spill [%1]=f49,0x80\n" |
64 | "stf.spill [%3] = f51, 0x80\n" |
65 | "stf.spill [%2]=f50,0x80\n" |
65 | "stf.spill [%4] = f52, 0x80\n" |
66 | "stf.spill [%3]=f51,0x80\n" |
66 | "stf.spill [%5] = f53, 0x80\n" |
67 | "stf.spill [%4]=f52,0x80\n" |
67 | "stf.spill [%6] = f54, 0x80\n" |
68 | "stf.spill [%5]=f53,0x80\n" |
68 | "stf.spill [%7] = f55, 0x80\n;;" |
69 | "stf.spill [%6]=f54,0x80\n" |
69 | |
70 | "stf.spill [%7]=f55,0x80\n;;" |
70 | "stf.spill [%0] = f56, 0x80\n" |
71 | 71 | "stf.spill [%1] = f57, 0x80\n" |
|
72 | "stf.spill [%0]=f56,0x80\n" |
72 | "stf.spill [%2] = f58, 0x80\n" |
73 | "stf.spill [%1]=f57,0x80\n" |
73 | "stf.spill [%3] = f59, 0x80\n" |
74 | "stf.spill [%2]=f58,0x80\n" |
74 | "stf.spill [%4] = f60, 0x80\n" |
75 | "stf.spill [%3]=f59,0x80\n" |
75 | "stf.spill [%5] = f61, 0x80\n" |
76 | "stf.spill [%4]=f60,0x80\n" |
76 | "stf.spill [%6] = f62, 0x80\n" |
77 | "stf.spill [%5]=f61,0x80\n" |
77 | "stf.spill [%7] = f63, 0x80\n;;" |
78 | "stf.spill [%6]=f62,0x80\n" |
78 | |
79 | "stf.spill [%7]=f63,0x80\n;;" |
79 | "stf.spill [%0] = f64, 0x80\n" |
80 | 80 | "stf.spill [%1] = f65, 0x80\n" |
|
81 | "stf.spill [%0]=f64,0x80\n" |
81 | "stf.spill [%2] = f66, 0x80\n" |
82 | "stf.spill [%1]=f65,0x80\n" |
82 | "stf.spill [%3] = f67, 0x80\n" |
83 | "stf.spill [%2]=f66,0x80\n" |
83 | "stf.spill [%4] = f68, 0x80\n" |
84 | "stf.spill [%3]=f67,0x80\n" |
84 | "stf.spill [%5] = f69, 0x80\n" |
85 | "stf.spill [%4]=f68,0x80\n" |
85 | "stf.spill [%6] = f70, 0x80\n" |
86 | "stf.spill [%5]=f69,0x80\n" |
86 | "stf.spill [%7] = f71, 0x80\n;;" |
87 | "stf.spill [%6]=f70,0x80\n" |
87 | |
88 | "stf.spill [%7]=f71,0x80\n;;" |
88 | "stf.spill [%0] = f72, 0x80\n" |
89 | 89 | "stf.spill [%1] = f73, 0x80\n" |
|
90 | "stf.spill [%0]=f72,0x80\n" |
90 | "stf.spill [%2] = f74, 0x80\n" |
91 | "stf.spill [%1]=f73,0x80\n" |
91 | "stf.spill [%3] = f75, 0x80\n" |
92 | "stf.spill [%2]=f74,0x80\n" |
92 | "stf.spill [%4] = f76, 0x80\n" |
93 | "stf.spill [%3]=f75,0x80\n" |
93 | "stf.spill [%5] = f77, 0x80\n" |
94 | "stf.spill [%4]=f76,0x80\n" |
94 | "stf.spill [%6] = f78, 0x80\n" |
95 | "stf.spill [%5]=f77,0x80\n" |
95 | "stf.spill [%7] = f79, 0x80\n;;" |
96 | "stf.spill [%6]=f78,0x80\n" |
96 | |
97 | "stf.spill [%7]=f79,0x80\n;;" |
97 | "stf.spill [%0] = f80, 0x80\n" |
98 | 98 | "stf.spill [%1] = f81, 0x80\n" |
|
99 | "stf.spill [%0]=f80,0x80\n" |
99 | "stf.spill [%2] = f82, 0x80\n" |
100 | "stf.spill [%1]=f81,0x80\n" |
100 | "stf.spill [%3] = f83, 0x80\n" |
101 | "stf.spill [%2]=f82,0x80\n" |
101 | "stf.spill [%4] = f84, 0x80\n" |
102 | "stf.spill [%3]=f83,0x80\n" |
102 | "stf.spill [%5] = f85, 0x80\n" |
103 | "stf.spill [%4]=f84,0x80\n" |
103 | "stf.spill [%6] = f86, 0x80\n" |
104 | "stf.spill [%5]=f85,0x80\n" |
104 | "stf.spill [%7] = f87, 0x80\n;;" |
105 | "stf.spill [%6]=f86,0x80\n" |
105 | |
106 | "stf.spill [%7]=f87,0x80\n;;" |
106 | "stf.spill [%0] = f88, 0x80\n" |
107 | 107 | "stf.spill [%1] = f89, 0x80\n" |
|
108 | "stf.spill [%0]=f88,0x80\n" |
108 | "stf.spill [%2] = f90, 0x80\n" |
109 | "stf.spill [%1]=f89,0x80\n" |
109 | "stf.spill [%3] = f91, 0x80\n" |
110 | "stf.spill [%2]=f90,0x80\n" |
110 | "stf.spill [%4] = f92, 0x80\n" |
111 | "stf.spill [%3]=f91,0x80\n" |
111 | "stf.spill [%5] = f93, 0x80\n" |
112 | "stf.spill [%4]=f92,0x80\n" |
112 | "stf.spill [%6] = f94, 0x80\n" |
113 | "stf.spill [%5]=f93,0x80\n" |
113 | "stf.spill [%7] = f95, 0x80\n;;" |
114 | "stf.spill [%6]=f94,0x80\n" |
114 | |
115 | "stf.spill [%7]=f95,0x80\n;;" |
115 | "stf.spill [%0] = f96, 0x80\n" |
116 | 116 | "stf.spill [%1] = f97, 0x80\n" |
|
117 | 117 | "stf.spill [%2] = f98, 0x80\n" |
|
118 | "stf.spill [%0]=f96,0x80\n" |
118 | "stf.spill [%3] = f99, 0x80\n" |
119 | "stf.spill [%1]=f97,0x80\n" |
119 | "stf.spill [%4] = f100, 0x80\n" |
120 | "stf.spill [%2]=f98,0x80\n" |
120 | "stf.spill [%5] = f101, 0x80\n" |
121 | "stf.spill [%3]=f99,0x80\n" |
121 | "stf.spill [%6] = f102, 0x80\n" |
122 | "stf.spill [%4]=f100,0x80\n" |
122 | "stf.spill [%7] = f103, 0x80\n;;" |
123 | "stf.spill [%5]=f101,0x80\n" |
123 | |
124 | "stf.spill [%6]=f102,0x80\n" |
124 | "stf.spill [%0] = f104, 0x80\n" |
125 | "stf.spill [%7]=f103,0x80\n;;" |
125 | "stf.spill [%1] = f105, 0x80\n" |
126 | 126 | "stf.spill [%2] = f106, 0x80\n" |
|
127 | "stf.spill [%0]=f104,0x80\n" |
127 | "stf.spill [%3] = f107, 0x80\n" |
128 | "stf.spill [%1]=f105,0x80\n" |
128 | "stf.spill [%4] = f108, 0x80\n" |
129 | "stf.spill [%2]=f106,0x80\n" |
129 | "stf.spill [%5] = f109, 0x80\n" |
130 | "stf.spill [%3]=f107,0x80\n" |
130 | "stf.spill [%6] = f110, 0x80\n" |
131 | "stf.spill [%4]=f108,0x80\n" |
131 | "stf.spill [%7] = f111, 0x80\n;;" |
132 | "stf.spill [%5]=f109,0x80\n" |
132 | |
133 | "stf.spill [%6]=f110,0x80\n" |
133 | "stf.spill [%0] = f112, 0x80\n" |
134 | "stf.spill [%7]=f111,0x80\n;;" |
134 | "stf.spill [%1] = f113, 0x80\n" |
135 | 135 | "stf.spill [%2] = f114, 0x80\n" |
|
136 | "stf.spill [%0]=f112,0x80\n" |
136 | "stf.spill [%3] = f115, 0x80\n" |
137 | "stf.spill [%1]=f113,0x80\n" |
137 | "stf.spill [%4] = f116, 0x80\n" |
138 | "stf.spill [%2]=f114,0x80\n" |
138 | "stf.spill [%5] = f117, 0x80\n" |
139 | "stf.spill [%3]=f115,0x80\n" |
139 | "stf.spill [%6] = f118, 0x80\n" |
140 | "stf.spill [%4]=f116,0x80\n" |
140 | "stf.spill [%7] = f119, 0x80\n;;" |
141 | "stf.spill [%5]=f117,0x80\n" |
141 | |
142 | "stf.spill [%6]=f118,0x80\n" |
142 | "stf.spill [%0] = f120, 0x80\n" |
143 | "stf.spill [%7]=f119,0x80\n;;" |
143 | "stf.spill [%1] = f121, 0x80\n" |
144 | 144 | "stf.spill [%2] = f122, 0x80\n" |
|
145 | "stf.spill [%0]=f120,0x80\n" |
145 | "stf.spill [%3] = f123, 0x80\n" |
146 | "stf.spill [%1]=f121,0x80\n" |
146 | "stf.spill [%4] = f124, 0x80\n" |
147 | "stf.spill [%2]=f122,0x80\n" |
147 | "stf.spill [%5] = f125, 0x80\n" |
148 | "stf.spill [%3]=f123,0x80\n" |
148 | "stf.spill [%6] = f126, 0x80\n" |
149 | "stf.spill [%4]=f124,0x80\n" |
149 | "stf.spill [%7] = f127, 0x80\n;;" |
150 | "stf.spill [%5]=f125,0x80\n" |
150 | |
151 | "stf.spill [%6]=f126,0x80\n" |
151 | : |
152 | "stf.spill [%7]=f127,0x80\n;;" |
152 | : "r" (&((fctx->fr)[0])), "r" (&((fctx->fr)[1])), "r" (&((fctx->fr)[2])), "r" (&((fctx->fr)[3])), |
153 | 153 | "r" (&((fctx->fr)[4])), "r" (&((fctx->fr)[5])), "r" (&((fctx->fr)[6])), "r" (&((fctx->fr)[7])) |
|
154 | 154 | ); |
|
155 | : |
- | |
156 | :"r" (&((fctx->fr)[0])),"r" (&((fctx->fr)[1])),"r" (&((fctx->fr)[2])),"r" (&((fctx->fr)[3])), |
- | |
157 | "r" (&((fctx->fr)[4])),"r" (&((fctx->fr)[5])),"r" (&((fctx->fr)[6])),"r" (&((fctx->fr)[7])) |
- | |
158 | ); |
- | |
159 | 155 | ||
160 | } |
156 | } |
161 | 157 | ||
162 | - | ||
163 | void fpu_context_restore(fpu_context_t *fctx) |
158 | void fpu_context_restore(fpu_context_t *fctx) |
164 | { |
159 | { |
165 | 160 | asm volatile ( |
|
166 | asm volatile( |
161 | "ldf.fill f32 = [%0], 0x80\n" |
167 | "ldf.fill f32=[%0],0x80\n" |
162 | "ldf.fill f33 = [%1], 0x80\n" |
168 | "ldf.fill f33=[%1],0x80\n" |
163 | "ldf.fill f34 = [%2], 0x80\n" |
169 | "ldf.fill f34=[%2],0x80\n" |
164 | "ldf.fill f35 = [%3], 0x80\n" |
170 | "ldf.fill f35=[%3],0x80\n" |
165 | "ldf.fill f36 = [%4], 0x80\n" |
171 | "ldf.fill f36=[%4],0x80\n" |
166 | "ldf.fill f37 = [%5], 0x80\n" |
172 | "ldf.fill f37=[%5],0x80\n" |
167 | "ldf.fill f38 = [%6], 0x80\n" |
173 | "ldf.fill f38=[%6],0x80\n" |
168 | "ldf.fill f39 = [%7], 0x80\n;;" |
174 | "ldf.fill f39=[%7],0x80\n;;" |
169 | |
175 | 170 | "ldf.fill f40 = [%0], 0x80\n" |
|
176 | "ldf.fill f40=[%0],0x80\n" |
171 | "ldf.fill f41 = [%1], 0x80\n" |
177 | "ldf.fill f41=[%1],0x80\n" |
172 | "ldf.fill f42 = [%2], 0x80\n" |
178 | "ldf.fill f42=[%2],0x80\n" |
173 | "ldf.fill f43 = [%3], 0x80\n" |
179 | "ldf.fill f43=[%3],0x80\n" |
174 | "ldf.fill f44 = [%4], 0x80\n" |
180 | "ldf.fill f44=[%4],0x80\n" |
175 | "ldf.fill f45 = [%5], 0x80\n" |
181 | "ldf.fill f45=[%5],0x80\n" |
176 | "ldf.fill f46 = [%6], 0x80\n" |
182 | "ldf.fill f46=[%6],0x80\n" |
177 | "ldf.fill f47 = [%7], 0x80\n;;" |
183 | "ldf.fill f47=[%7],0x80\n;;" |
178 | |
184 | 179 | "ldf.fill f48 = [%0], 0x80\n" |
|
185 | "ldf.fill f48=[%0],0x80\n" |
180 | "ldf.fill f49 = [%1], 0x80\n" |
186 | "ldf.fill f49=[%1],0x80\n" |
181 | "ldf.fill f50 = [%2], 0x80\n" |
187 | "ldf.fill f50=[%2],0x80\n" |
182 | "ldf.fill f51 = [%3], 0x80\n" |
188 | "ldf.fill f51=[%3],0x80\n" |
183 | "ldf.fill f52 = [%4], 0x80\n" |
189 | "ldf.fill f52=[%4],0x80\n" |
184 | "ldf.fill f53 = [%5], 0x80\n" |
190 | "ldf.fill f53=[%5],0x80\n" |
185 | "ldf.fill f54 = [%6], 0x80\n" |
191 | "ldf.fill f54=[%6],0x80\n" |
186 | "ldf.fill f55 = [%7], 0x80\n;;" |
192 | "ldf.fill f55=[%7],0x80\n;;" |
187 | |
193 | 188 | "ldf.fill f56 = [%0], 0x80\n" |
|
194 | "ldf.fill f56=[%0],0x80\n" |
189 | "ldf.fill f57 = [%1], 0x80\n" |
195 | "ldf.fill f57=[%1],0x80\n" |
190 | "ldf.fill f58 = [%2], 0x80\n" |
196 | "ldf.fill f58=[%2],0x80\n" |
191 | "ldf.fill f59 = [%3], 0x80\n" |
197 | "ldf.fill f59=[%3],0x80\n" |
192 | "ldf.fill f60 = [%4], 0x80\n" |
198 | "ldf.fill f60=[%4],0x80\n" |
193 | "ldf.fill f61 = [%5], 0x80\n" |
199 | "ldf.fill f61=[%5],0x80\n" |
194 | "ldf.fill f62 = [%6], 0x80\n" |
200 | "ldf.fill f62=[%6],0x80\n" |
195 | "ldf.fill f63 = [%7], 0x80\n;;" |
201 | "ldf.fill f63=[%7],0x80\n;;" |
196 | |
202 | 197 | "ldf.fill f64 = [%0], 0x80\n" |
|
203 | "ldf.fill f64=[%0],0x80\n" |
198 | "ldf.fill f65 = [%1], 0x80\n" |
204 | "ldf.fill f65=[%1],0x80\n" |
199 | "ldf.fill f66 = [%2], 0x80\n" |
205 | "ldf.fill f66=[%2],0x80\n" |
200 | "ldf.fill f67 = [%3], 0x80\n" |
206 | "ldf.fill f67=[%3],0x80\n" |
201 | "ldf.fill f68 = [%4], 0x80\n" |
207 | "ldf.fill f68=[%4],0x80\n" |
202 | "ldf.fill f69 = [%5], 0x80\n" |
208 | "ldf.fill f69=[%5],0x80\n" |
203 | "ldf.fill f70 = [%6], 0x80\n" |
209 | "ldf.fill f70=[%6],0x80\n" |
204 | "ldf.fill f71 = [%7], 0x80\n;;" |
210 | "ldf.fill f71=[%7],0x80\n;;" |
205 | |
211 | 206 | "ldf.fill f72 = [%0], 0x80\n" |
|
212 | "ldf.fill f72=[%0],0x80\n" |
207 | "ldf.fill f73 = [%1], 0x80\n" |
213 | "ldf.fill f73=[%1],0x80\n" |
208 | "ldf.fill f74 = [%2], 0x80\n" |
214 | "ldf.fill f74=[%2],0x80\n" |
209 | "ldf.fill f75 = [%3], 0x80\n" |
215 | "ldf.fill f75=[%3],0x80\n" |
210 | "ldf.fill f76 = [%4], 0x80\n" |
216 | "ldf.fill f76=[%4],0x80\n" |
211 | "ldf.fill f77 = [%5], 0x80\n" |
217 | "ldf.fill f77=[%5],0x80\n" |
212 | "ldf.fill f78 = [%6], 0x80\n" |
218 | "ldf.fill f78=[%6],0x80\n" |
213 | "ldf.fill f79 = [%7], 0x80\n;;" |
219 | "ldf.fill f79=[%7],0x80\n;;" |
214 | |
220 | 215 | "ldf.fill f80 = [%0], 0x80\n" |
|
221 | "ldf.fill f80=[%0],0x80\n" |
216 | "ldf.fill f81 = [%1], 0x80\n" |
222 | "ldf.fill f81=[%1],0x80\n" |
217 | "ldf.fill f82 = [%2], 0x80\n" |
223 | "ldf.fill f82=[%2],0x80\n" |
218 | "ldf.fill f83 = [%3], 0x80\n" |
224 | "ldf.fill f83=[%3],0x80\n" |
219 | "ldf.fill f84 = [%4], 0x80\n" |
225 | "ldf.fill f84=[%4],0x80\n" |
220 | "ldf.fill f85 = [%5], 0x80\n" |
226 | "ldf.fill f85=[%5],0x80\n" |
221 | "ldf.fill f86 = [%6], 0x80\n" |
227 | "ldf.fill f86=[%6],0x80\n" |
222 | "ldf.fill f87 = [%7], 0x80\n;;" |
228 | "ldf.fill f87=[%7],0x80\n;;" |
223 | |
229 | 224 | "ldf.fill f88 = [%0], 0x80\n" |
|
230 | "ldf.fill f88=[%0],0x80\n" |
225 | "ldf.fill f89 = [%1], 0x80\n" |
231 | "ldf.fill f89=[%1],0x80\n" |
226 | "ldf.fill f90 = [%2], 0x80\n" |
232 | "ldf.fill f90=[%2],0x80\n" |
227 | "ldf.fill f91 = [%3], 0x80\n" |
233 | "ldf.fill f91=[%3],0x80\n" |
228 | "ldf.fill f92 = [%4], 0x80\n" |
234 | "ldf.fill f92=[%4],0x80\n" |
229 | "ldf.fill f93 = [%5], 0x80\n" |
235 | "ldf.fill f93=[%5],0x80\n" |
230 | "ldf.fill f94 = [%6], 0x80\n" |
236 | "ldf.fill f94=[%6],0x80\n" |
231 | "ldf.fill f95 = [%7], 0x80\n;;" |
237 | "ldf.fill f95=[%7],0x80\n;;" |
232 | |
238 | 233 | "ldf.fill f96 = [%0], 0x80\n" |
|
239 | 234 | "ldf.fill f97 = [%1], 0x80\n" |
|
240 | "ldf.fill f96=[%0],0x80\n" |
235 | "ldf.fill f98 = [%2], 0x80\n" |
241 | "ldf.fill f97=[%1],0x80\n" |
236 | "ldf.fill f99 = [%3], 0x80\n" |
242 | "ldf.fill f98=[%2],0x80\n" |
237 | "ldf.fill f100 = [%4], 0x80\n" |
243 | "ldf.fill f99=[%3],0x80\n" |
238 | "ldf.fill f101 = [%5], 0x80\n" |
244 | "ldf.fill f100=[%4],0x80\n" |
239 | "ldf.fill f102 = [%6], 0x80\n" |
245 | "ldf.fill f101=[%5],0x80\n" |
240 | "ldf.fill f103 = [%7], 0x80\n;;" |
246 | "ldf.fill f102=[%6],0x80\n" |
241 | |
247 | "ldf.fill f103=[%7],0x80\n;;" |
242 | "ldf.fill f104 = [%0], 0x80\n" |
248 | 243 | "ldf.fill f105 = [%1], 0x80\n" |
|
249 | "ldf.fill f104=[%0],0x80\n" |
244 | "ldf.fill f106 = [%2], 0x80\n" |
250 | "ldf.fill f105=[%1],0x80\n" |
245 | "ldf.fill f107 = [%3], 0x80\n" |
251 | "ldf.fill f106=[%2],0x80\n" |
246 | "ldf.fill f108 = [%4], 0x80\n" |
252 | "ldf.fill f107=[%3],0x80\n" |
247 | "ldf.fill f109 = [%5], 0x80\n" |
253 | "ldf.fill f108=[%4],0x80\n" |
248 | "ldf.fill f110 = [%6], 0x80\n" |
254 | "ldf.fill f109=[%5],0x80\n" |
249 | "ldf.fill f111 = [%7], 0x80\n;;" |
255 | "ldf.fill f110=[%6],0x80\n" |
250 | |
256 | "ldf.fill f111=[%7],0x80\n;;" |
251 | "ldf.fill f112 = [%0], 0x80\n" |
257 | 252 | "ldf.fill f113 = [%1], 0x80\n" |
|
258 | "ldf.fill f112=[%0],0x80\n" |
253 | "ldf.fill f114 = [%2], 0x80\n" |
259 | "ldf.fill f113=[%1],0x80\n" |
254 | "ldf.fill f115 = [%3], 0x80\n" |
260 | "ldf.fill f114=[%2],0x80\n" |
255 | "ldf.fill f116 = [%4], 0x80\n" |
261 | "ldf.fill f115=[%3],0x80\n" |
256 | "ldf.fill f117 = [%5], 0x80\n" |
262 | "ldf.fill f116=[%4],0x80\n" |
257 | "ldf.fill f118 = [%6], 0x80\n" |
263 | "ldf.fill f117=[%5],0x80\n" |
258 | "ldf.fill f119 = [%7], 0x80\n;;" |
264 | "ldf.fill f118=[%6],0x80\n" |
259 | |
265 | "ldf.fill f119=[%7],0x80\n;;" |
260 | "ldf.fill f120 = [%0], 0x80\n" |
266 | 261 | "ldf.fill f121 = [%1], 0x80\n" |
|
267 | "ldf.fill f120=[%0],0x80\n" |
262 | "ldf.fill f122 = [%2], 0x80\n" |
268 | "ldf.fill f121=[%1],0x80\n" |
263 | "ldf.fill f123 = [%3], 0x80\n" |
269 | "ldf.fill f122=[%2],0x80\n" |
264 | "ldf.fill f124 = [%4], 0x80\n" |
270 | "ldf.fill f123=[%3],0x80\n" |
265 | "ldf.fill f125 = [%5], 0x80\n" |
271 | "ldf.fill f124=[%4],0x80\n" |
266 | "ldf.fill f126 = [%6], 0x80\n" |
272 | "ldf.fill f125=[%5],0x80\n" |
267 | "ldf.fill f127 = [%7], 0x80\n;;" |
273 | "ldf.fill f126=[%6],0x80\n" |
268 | |
274 | "ldf.fill f127=[%7],0x80\n;;" |
269 | : |
275 | 270 | : "r" (&((fctx->fr)[0])), "r" (&((fctx->fr)[1])), "r" (&((fctx->fr)[2])), "r" (&((fctx->fr)[3])), |
|
276 | 271 | "r" (&((fctx->fr)[4])), "r" (&((fctx->fr)[5])), "r" (&((fctx->fr)[6])), "r" (&((fctx->fr)[7])) |
|
277 | : |
272 | ); |
278 | :"r" (&((fctx->fr)[0])),"r" (&((fctx->fr)[1])),"r" (&((fctx->fr)[2])),"r" (&((fctx->fr)[3])), |
- | |
279 | "r" (&((fctx->fr)[4])),"r" (&((fctx->fr)[5])),"r" (&((fctx->fr)[6])),"r" (&((fctx->fr)[7])) |
- | |
280 | ); |
- | |
281 | } |
273 | } |
282 | 274 | ||
283 | void fpu_enable(void) |
275 | void fpu_enable(void) |
284 | { |
276 | { |
285 | uint64_t a = 0 ; |
277 | uint64_t a = 0 ; |
286 | asm volatile( |
- | |
287 | "rsm %0;;" |
- | |
288 | "srlz.i\n" |
- | |
289 | "srlz.d;;\n" |
- | |
290 | : |
- | |
291 | :"i" (PSR_DFH_MASK) |
- | |
292 | ); |
- | |
293 | asm volatile |
- | |
294 | ( |
- | |
295 | "mov %0=ar.fpsr;;\n" |
- | |
296 | "or %0=%0,%1;;\n" |
- | |
297 | "mov ar.fpsr=%0;;\n" |
- | |
298 | : "+r" (a) |
- | |
299 | : "r" (0x38) |
- | |
300 | ); |
- | |
301 | 278 | ||
- | 279 | asm volatile ( |
|
- | 280 | "rsm %0 ;;" |
|
- | 281 | "srlz.i\n" |
|
- | 282 | "srlz.d ;;\n" |
|
- | 283 | : |
|
- | 284 | : "i" (PSR_DFH_MASK) |
|
- | 285 | ); |
|
- | 286 | ||
- | 287 | asm volatile ( |
|
- | 288 | "mov %0 = ar.fpsr ;;\n" |
|
- | 289 | "or %0 = %0,%1 ;;\n" |
|
- | 290 | "mov ar.fpsr = %0 ;;\n" |
|
- | 291 | : "+r" (a) |
|
- | 292 | : "r" (0x38) |
|
- | 293 | ); |
|
302 | } |
294 | } |
303 | 295 | ||
304 | void fpu_disable(void) |
296 | void fpu_disable(void) |
305 | { |
297 | { |
- | 298 | uint64_t a = 0 ; |
|
306 | 299 | ||
307 | uint64_t a = 0 ; |
- | |
308 | asm volatile( |
300 | asm volatile ( |
309 | "ssm %0;;\n" |
301 | "ssm %0 ;;\n" |
310 | "srlz.i\n" |
302 | "srlz.i\n" |
311 | "srlz.d;;\n" |
303 | "srlz.d ;;\n" |
312 | : |
304 | : |
313 | :"i" (PSR_DFH_MASK) |
305 | : "i" (PSR_DFH_MASK) |
314 | ); |
306 | ); |
- | 307 | ||
315 | asm volatile |
308 | asm volatile ( |
316 | ( |
- | |
317 | "mov %0=ar.fpsr;;\n" |
309 | "mov %0 = ar.fpsr ;;\n" |
318 | "or %0=%0,%1;;\n" |
310 | "or %0 = %0,%1 ;;\n" |
319 | "mov ar.fpsr=%0;;\n" |
311 | "mov ar.fpsr = %0 ;;\n" |
320 | : "+r" (a) |
312 | : "+r" (a) |
321 | : "r" (0x38) |
313 | : "r" (0x38) |
322 | ); |
314 | ); |
323 | - | ||
324 | } |
315 | } |
325 | 316 | ||
326 | void fpu_init(void) |
317 | void fpu_init(void) |
327 | { |
318 | { |
328 | uint64_t a = 0 ; |
319 | uint64_t a = 0 ; |
329 | asm volatile |
- | |
330 | ( |
- | |
331 | "mov %0=ar.fpsr;;\n" |
- | |
332 | "or %0=%0,%1;;\n" |
- | |
333 | "mov ar.fpsr=%0;;\n" |
- | |
334 | : "+r" (a) |
- | |
335 | : "r" (0x38) |
- | |
336 | ); |
- | |
337 | - | ||
338 | asm volatile( |
- | |
339 | "mov f2=f0\n" |
- | |
340 | "mov f3=f0\n" |
- | |
341 | "mov f4=f0\n" |
- | |
342 | "mov f5=f0\n" |
- | |
343 | "mov f6=f0\n" |
- | |
344 | "mov f7=f0\n" |
- | |
345 | "mov f8=f0\n" |
- | |
346 | "mov f9=f0\n" |
- | |
347 | - | ||
348 | "mov f10=f0\n" |
- | |
349 | "mov f11=f0\n" |
- | |
350 | "mov f12=f0\n" |
- | |
351 | "mov f13=f0\n" |
- | |
352 | "mov f14=f0\n" |
- | |
353 | "mov f15=f0\n" |
- | |
354 | "mov f16=f0\n" |
- | |
355 | "mov f17=f0\n" |
- | |
356 | "mov f18=f0\n" |
- | |
357 | "mov f19=f0\n" |
- | |
358 | - | ||
359 | "mov f20=f0\n" |
- | |
360 | "mov f21=f0\n" |
- | |
361 | "mov f22=f0\n" |
- | |
362 | "mov f23=f0\n" |
- | |
363 | "mov f24=f0\n" |
- | |
364 | "mov f25=f0\n" |
- | |
365 | "mov f26=f0\n" |
- | |
366 | "mov f27=f0\n" |
- | |
367 | "mov f28=f0\n" |
- | |
368 | "mov f29=f0\n" |
- | |
369 | - | ||
370 | "mov f30=f0\n" |
- | |
371 | "mov f31=f0\n" |
- | |
372 | "mov f32=f0\n" |
- | |
373 | "mov f33=f0\n" |
- | |
374 | "mov f34=f0\n" |
- | |
375 | "mov f35=f0\n" |
- | |
376 | "mov f36=f0\n" |
- | |
377 | "mov f37=f0\n" |
- | |
378 | "mov f38=f0\n" |
- | |
379 | "mov f39=f0\n" |
- | |
380 | - | ||
381 | "mov f40=f0\n" |
- | |
382 | "mov f41=f0\n" |
- | |
383 | "mov f42=f0\n" |
- | |
384 | "mov f43=f0\n" |
- | |
385 | "mov f44=f0\n" |
- | |
386 | "mov f45=f0\n" |
- | |
387 | "mov f46=f0\n" |
- | |
388 | "mov f47=f0\n" |
- | |
389 | "mov f48=f0\n" |
- | |
390 | "mov f49=f0\n" |
- | |
391 | - | ||
392 | "mov f50=f0\n" |
- | |
393 | "mov f51=f0\n" |
- | |
394 | "mov f52=f0\n" |
- | |
395 | "mov f53=f0\n" |
- | |
396 | "mov f54=f0\n" |
- | |
397 | "mov f55=f0\n" |
- | |
398 | "mov f56=f0\n" |
- | |
399 | "mov f57=f0\n" |
- | |
400 | "mov f58=f0\n" |
- | |
401 | "mov f59=f0\n" |
- | |
402 | - | ||
403 | "mov f60=f0\n" |
- | |
404 | "mov f61=f0\n" |
- | |
405 | "mov f62=f0\n" |
- | |
406 | "mov f63=f0\n" |
- | |
407 | "mov f64=f0\n" |
- | |
408 | "mov f65=f0\n" |
- | |
409 | "mov f66=f0\n" |
- | |
410 | "mov f67=f0\n" |
- | |
411 | "mov f68=f0\n" |
- | |
412 | "mov f69=f0\n" |
- | |
413 | - | ||
414 | "mov f70=f0\n" |
- | |
415 | "mov f71=f0\n" |
- | |
416 | "mov f72=f0\n" |
- | |
417 | "mov f73=f0\n" |
- | |
418 | "mov f74=f0\n" |
- | |
419 | "mov f75=f0\n" |
- | |
420 | "mov f76=f0\n" |
- | |
421 | "mov f77=f0\n" |
- | |
422 | "mov f78=f0\n" |
- | |
423 | "mov f79=f0\n" |
- | |
424 | - | ||
425 | "mov f80=f0\n" |
- | |
426 | "mov f81=f0\n" |
- | |
427 | "mov f82=f0\n" |
- | |
428 | "mov f83=f0\n" |
- | |
429 | "mov f84=f0\n" |
- | |
430 | "mov f85=f0\n" |
- | |
431 | "mov f86=f0\n" |
- | |
432 | "mov f87=f0\n" |
- | |
433 | "mov f88=f0\n" |
- | |
434 | "mov f89=f0\n" |
- | |
435 | - | ||
436 | "mov f90=f0\n" |
- | |
437 | "mov f91=f0\n" |
- | |
438 | "mov f92=f0\n" |
- | |
439 | "mov f93=f0\n" |
- | |
440 | "mov f94=f0\n" |
- | |
441 | "mov f95=f0\n" |
- | |
442 | "mov f96=f0\n" |
- | |
443 | "mov f97=f0\n" |
- | |
444 | "mov f98=f0\n" |
- | |
445 | "mov f99=f0\n" |
- | |
446 | - | ||
447 | "mov f100=f0\n" |
- | |
448 | "mov f101=f0\n" |
- | |
449 | "mov f102=f0\n" |
- | |
450 | "mov f103=f0\n" |
- | |
451 | "mov f104=f0\n" |
- | |
452 | "mov f105=f0\n" |
- | |
453 | "mov f106=f0\n" |
- | |
454 | "mov f107=f0\n" |
- | |
455 | "mov f108=f0\n" |
- | |
456 | "mov f109=f0\n" |
- | |
457 | - | ||
458 | "mov f110=f0\n" |
- | |
459 | "mov f111=f0\n" |
- | |
460 | "mov f112=f0\n" |
- | |
461 | "mov f113=f0\n" |
- | |
462 | "mov f114=f0\n" |
- | |
463 | "mov f115=f0\n" |
- | |
464 | "mov f116=f0\n" |
- | |
465 | "mov f117=f0\n" |
- | |
466 | "mov f118=f0\n" |
- | |
467 | "mov f119=f0\n" |
- | |
468 | - | ||
469 | "mov f120=f0\n" |
- | |
470 | "mov f121=f0\n" |
- | |
471 | "mov f122=f0\n" |
- | |
472 | "mov f123=f0\n" |
- | |
473 | "mov f124=f0\n" |
- | |
474 | "mov f125=f0\n" |
- | |
475 | "mov f126=f0\n" |
- | |
476 | "mov f127=f0\n" |
- | |
477 | 320 | ||
- | 321 | asm volatile ( |
|
- | 322 | "mov %0 = ar.fpsr ;;\n" |
|
- | 323 | "or %0 = %0,%1 ;;\n" |
|
- | 324 | "mov ar.fpsr = %0 ;;\n" |
|
- | 325 | : "+r" (a) |
|
- | 326 | : "r" (0x38) |
|
- | 327 | ); |
|
- | 328 | ||
- | 329 | asm volatile ( |
|
- | 330 | "mov f2 = f0\n" |
|
- | 331 | "mov f3 = f0\n" |
|
- | 332 | "mov f4 = f0\n" |
|
- | 333 | "mov f5 = f0\n" |
|
- | 334 | "mov f6 = f0\n" |
|
- | 335 | "mov f7 = f0\n" |
|
- | 336 | "mov f8 = f0\n" |
|
- | 337 | "mov f9 = f0\n" |
|
- | 338 | ||
- | 339 | "mov f10 = f0\n" |
|
- | 340 | "mov f11 = f0\n" |
|
- | 341 | "mov f12 = f0\n" |
|
- | 342 | "mov f13 = f0\n" |
|
- | 343 | "mov f14 = f0\n" |
|
- | 344 | "mov f15 = f0\n" |
|
- | 345 | "mov f16 = f0\n" |
|
- | 346 | "mov f17 = f0\n" |
|
- | 347 | "mov f18 = f0\n" |
|
- | 348 | "mov f19 = f0\n" |
|
- | 349 | ||
- | 350 | "mov f20 = f0\n" |
|
- | 351 | "mov f21 = f0\n" |
|
- | 352 | "mov f22 = f0\n" |
|
- | 353 | "mov f23 = f0\n" |
|
- | 354 | "mov f24 = f0\n" |
|
- | 355 | "mov f25 = f0\n" |
|
- | 356 | "mov f26 = f0\n" |
|
- | 357 | "mov f27 = f0\n" |
|
- | 358 | "mov f28 = f0\n" |
|
- | 359 | "mov f29 = f0\n" |
|
- | 360 | ||
- | 361 | "mov f30 = f0\n" |
|
- | 362 | "mov f31 = f0\n" |
|
- | 363 | "mov f32 = f0\n" |
|
- | 364 | "mov f33 = f0\n" |
|
- | 365 | "mov f34 = f0\n" |
|
- | 366 | "mov f35 = f0\n" |
|
- | 367 | "mov f36 = f0\n" |
|
- | 368 | "mov f37 = f0\n" |
|
- | 369 | "mov f38 = f0\n" |
|
- | 370 | "mov f39 = f0\n" |
|
- | 371 | ||
- | 372 | "mov f40 = f0\n" |
|
- | 373 | "mov f41 = f0\n" |
|
- | 374 | "mov f42 = f0\n" |
|
- | 375 | "mov f43 = f0\n" |
|
- | 376 | "mov f44 = f0\n" |
|
- | 377 | "mov f45 = f0\n" |
|
- | 378 | "mov f46 = f0\n" |
|
- | 379 | "mov f47 = f0\n" |
|
- | 380 | "mov f48 = f0\n" |
|
- | 381 | "mov f49 = f0\n" |
|
- | 382 | ||
- | 383 | "mov f50 = f0\n" |
|
- | 384 | "mov f51 = f0\n" |
|
- | 385 | "mov f52 = f0\n" |
|
- | 386 | "mov f53 = f0\n" |
|
- | 387 | "mov f54 = f0\n" |
|
- | 388 | "mov f55 = f0\n" |
|
- | 389 | "mov f56 = f0\n" |
|
- | 390 | "mov f57 = f0\n" |
|
- | 391 | "mov f58 = f0\n" |
|
- | 392 | "mov f59 = f0\n" |
|
- | 393 | ||
- | 394 | "mov f60 = f0\n" |
|
- | 395 | "mov f61 = f0\n" |
|
- | 396 | "mov f62 = f0\n" |
|
- | 397 | "mov f63 = f0\n" |
|
- | 398 | "mov f64 = f0\n" |
|
- | 399 | "mov f65 = f0\n" |
|
- | 400 | "mov f66 = f0\n" |
|
- | 401 | "mov f67 = f0\n" |
|
- | 402 | "mov f68 = f0\n" |
|
- | 403 | "mov f69 = f0\n" |
|
- | 404 | ||
- | 405 | "mov f70 = f0\n" |
|
- | 406 | "mov f71 = f0\n" |
|
- | 407 | "mov f72 = f0\n" |
|
- | 408 | "mov f73 = f0\n" |
|
- | 409 | "mov f74 = f0\n" |
|
- | 410 | "mov f75 = f0\n" |
|
- | 411 | "mov f76 = f0\n" |
|
- | 412 | "mov f77 = f0\n" |
|
- | 413 | "mov f78 = f0\n" |
|
- | 414 | "mov f79 = f0\n" |
|
- | 415 | ||
- | 416 | "mov f80 = f0\n" |
|
- | 417 | "mov f81 = f0\n" |
|
- | 418 | "mov f82 = f0\n" |
|
- | 419 | "mov f83 = f0\n" |
|
- | 420 | "mov f84 = f0\n" |
|
- | 421 | "mov f85 = f0\n" |
|
- | 422 | "mov f86 = f0\n" |
|
- | 423 | "mov f87 = f0\n" |
|
- | 424 | "mov f88 = f0\n" |
|
- | 425 | "mov f89 = f0\n" |
|
- | 426 | ||
- | 427 | "mov f90 = f0\n" |
|
- | 428 | "mov f91 = f0\n" |
|
- | 429 | "mov f92 = f0\n" |
|
- | 430 | "mov f93 = f0\n" |
|
- | 431 | "mov f94 = f0\n" |
|
- | 432 | "mov f95 = f0\n" |
|
- | 433 | "mov f96 = f0\n" |
|
- | 434 | "mov f97 = f0\n" |
|
- | 435 | "mov f98 = f0\n" |
|
- | 436 | "mov f99 = f0\n" |
|
- | 437 | ||
- | 438 | "mov f100 = f0\n" |
|
- | 439 | "mov f101 = f0\n" |
|
- | 440 | "mov f102 = f0\n" |
|
- | 441 | "mov f103 = f0\n" |
|
- | 442 | "mov f104 = f0\n" |
|
- | 443 | "mov f105 = f0\n" |
|
- | 444 | "mov f106 = f0\n" |
|
- | 445 | "mov f107 = f0\n" |
|
- | 446 | "mov f108 = f0\n" |
|
- | 447 | "mov f109 = f0\n" |
|
- | 448 | ||
- | 449 | "mov f110 = f0\n" |
|
- | 450 | "mov f111 = f0\n" |
|
- | 451 | "mov f112 = f0\n" |
|
- | 452 | "mov f113 = f0\n" |
|
- | 453 | "mov f114 = f0\n" |
|
- | 454 | "mov f115 = f0\n" |
|
- | 455 | "mov f116 = f0\n" |
|
- | 456 | "mov f117 = f0\n" |
|
- | 457 | "mov f118 = f0\n" |
|
- | 458 | "mov f119 = f0\n" |
|
- | 459 | ||
- | 460 | "mov f120 = f0\n" |
|
- | 461 | "mov f121 = f0\n" |
|
- | 462 | "mov f122 = f0\n" |
|
- | 463 | "mov f123 = f0\n" |
|
- | 464 | "mov f124 = f0\n" |
|
- | 465 | "mov f125 = f0\n" |
|
- | 466 | "mov f126 = f0\n" |
|
- | 467 | "mov f127 = f0\n" |
|
478 | ); |
468 | ); |
479 | 469 | ||
480 | } |
470 | } |
481 | 471 | ||
482 | - | ||
483 | /** @} |
472 | /** @} |
484 | */ |
473 | */ |
485 | - |