OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 // the doubles t.a ... t.f. | 283 // the doubles t.a ... t.f. |
284 MacroAssembler assm(NULL, 0); | 284 MacroAssembler assm(NULL, 0); |
285 Label L, C; | 285 Label L, C; |
286 | 286 |
287 if (Isolate::Current()->cpu_features()->IsSupported(FPU)) { | 287 if (Isolate::Current()->cpu_features()->IsSupported(FPU)) { |
288 CpuFeatures::Scope scope(FPU); | 288 CpuFeatures::Scope scope(FPU); |
289 | 289 |
290 __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, a)) ); | 290 __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, a)) ); |
291 __ ldc1(f6, MemOperand(a0, OFFSET_OF(T, b)) ); | 291 __ ldc1(f6, MemOperand(a0, OFFSET_OF(T, b)) ); |
292 __ add_d(f8, f4, f6); | 292 __ add_d(f8, f4, f6); |
293 __ sdc1(f8, MemOperand(a0, OFFSET_OF(T, c)) ); // c = a + b. | 293 __ sdc1(f8, MemOperand(a0, OFFSET_OF(T, c)) ); // c = a + b. |
294 | 294 |
295 __ mov_d(f10, f8); // c | 295 __ mov_d(f10, f8); // c |
296 __ neg_d(f12, f6); // -b | 296 __ neg_d(f12, f6); // -b |
297 __ sub_d(f10, f10, f12); | 297 __ sub_d(f10, f10, f12); |
298 __ sdc1(f10, MemOperand(a0, OFFSET_OF(T, d)) ); // d = c - (-b). | 298 __ sdc1(f10, MemOperand(a0, OFFSET_OF(T, d)) ); // d = c - (-b). |
299 | 299 |
300 __ sdc1(f4, MemOperand(a0, OFFSET_OF(T, b)) ); // b = a. | 300 __ sdc1(f4, MemOperand(a0, OFFSET_OF(T, b)) ); // b = a. |
301 | 301 |
302 __ li(t0, 120); | 302 __ li(t0, 120); |
303 __ mtc1(t0, f14); | 303 __ mtc1(t0, f14); |
304 __ cvt_d_w(f14, f14); // f14 = 120.0. | 304 __ cvt_d_w(f14, f14); // f14 = 120.0. |
305 __ mul_d(f10, f10, f14); | 305 __ mul_d(f10, f10, f14); |
306 __ sdc1(f10, MemOperand(a0, OFFSET_OF(T, e)) ); // e = d * 120 = 1.8066e16
. | 306 __ sdc1(f10, MemOperand(a0, OFFSET_OF(T, e)) ); // e = d * 120 = 1.8066e16. |
307 | 307 |
308 __ div_d(f12, f10, f4); | 308 __ div_d(f12, f10, f4); |
309 __ sdc1(f12, MemOperand(a0, OFFSET_OF(T, f)) ); // f = e / a = 120.44. | 309 __ sdc1(f12, MemOperand(a0, OFFSET_OF(T, f)) ); // f = e / a = 120.44. |
310 | 310 |
311 __ sqrt_d(f14, f12); | 311 __ sqrt_d(f14, f12); |
312 __ sdc1(f14, MemOperand(a0, OFFSET_OF(T, g)) ); | 312 __ sdc1(f14, MemOperand(a0, OFFSET_OF(T, g)) ); |
313 // g = sqrt(f) = 10.97451593465515908537 | 313 // g = sqrt(f) = 10.97451593465515908537 |
314 | 314 |
315 __ jr(ra); | 315 __ jr(ra); |
316 __ nop(); | 316 __ nop(); |
317 | 317 |
318 CodeDesc desc; | 318 CodeDesc desc; |
319 assm.GetCode(&desc); | 319 assm.GetCode(&desc); |
(...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1302 CHECK_EQ(0, GET_FPU_ERR(t.cvt_err2_out)); | 1302 CHECK_EQ(0, GET_FPU_ERR(t.cvt_err2_out)); |
1303 // Invalid operation. | 1303 // Invalid operation. |
1304 CHECK_EQ(16, GET_FPU_ERR(t.cvt_err3_out)); | 1304 CHECK_EQ(16, GET_FPU_ERR(t.cvt_err3_out)); |
1305 CHECK_EQ(16, GET_FPU_ERR(t.cvt_err4_out)); | 1305 CHECK_EQ(16, GET_FPU_ERR(t.cvt_err4_out)); |
1306 CHECK_EQ(kFPUInvalidResult, t.cvt_invalid_result); | 1306 CHECK_EQ(kFPUInvalidResult, t.cvt_invalid_result); |
1307 } | 1307 } |
1308 } | 1308 } |
1309 | 1309 |
1310 | 1310 |
1311 #undef __ | 1311 #undef __ |
OLD | NEW |