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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 typedef struct { | 225 typedef struct { |
226 double a; | 226 double a; |
227 double b; | 227 double b; |
228 double c; | 228 double c; |
229 double d; | 229 double d; |
230 double e; | 230 double e; |
231 double f; | 231 double f; |
232 double g; | 232 double g; |
233 double h; | 233 double h; |
234 int i; | 234 int i; |
| 235 double m; |
| 236 double n; |
235 float x; | 237 float x; |
236 float y; | 238 float y; |
237 } T; | 239 } T; |
238 T t; | 240 T t; |
239 | 241 |
240 // Create a function that accepts &t, and loads, manipulates, and stores | 242 // Create a function that accepts &t, and loads, manipulates, and stores |
241 // the doubles and floats. | 243 // the doubles and floats. |
242 Assembler assm(NULL, 0); | 244 Assembler assm(NULL, 0); |
243 Label L, C; | 245 Label L, C; |
244 | 246 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 __ vstr(d4, r4, OFFSET_OF(T, f)); | 292 __ vstr(d4, r4, OFFSET_OF(T, f)); |
291 | 293 |
292 // Test vabs. | 294 // Test vabs. |
293 __ vldr(d1, r4, OFFSET_OF(T, g)); | 295 __ vldr(d1, r4, OFFSET_OF(T, g)); |
294 __ vabs(d0, d1); | 296 __ vabs(d0, d1); |
295 __ vstr(d0, r4, OFFSET_OF(T, g)); | 297 __ vstr(d0, r4, OFFSET_OF(T, g)); |
296 __ vldr(d2, r4, OFFSET_OF(T, h)); | 298 __ vldr(d2, r4, OFFSET_OF(T, h)); |
297 __ vabs(d0, d2); | 299 __ vabs(d0, d2); |
298 __ vstr(d0, r4, OFFSET_OF(T, h)); | 300 __ vstr(d0, r4, OFFSET_OF(T, h)); |
299 | 301 |
| 302 // Test vneg. |
| 303 __ vldr(d1, r4, OFFSET_OF(T, m)); |
| 304 __ vneg(d0, d1); |
| 305 __ vstr(d0, r4, OFFSET_OF(T, m)); |
| 306 __ vldr(d1, r4, OFFSET_OF(T, n)); |
| 307 __ vneg(d0, d1); |
| 308 __ vstr(d0, r4, OFFSET_OF(T, n)); |
| 309 |
300 __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); | 310 __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); |
301 | 311 |
302 CodeDesc desc; | 312 CodeDesc desc; |
303 assm.GetCode(&desc); | 313 assm.GetCode(&desc); |
304 Object* code = Heap::CreateCode( | 314 Object* code = Heap::CreateCode( |
305 desc, | 315 desc, |
306 Code::ComputeFlags(Code::STUB), | 316 Code::ComputeFlags(Code::STUB), |
307 Handle<Object>(Heap::undefined_value()))->ToObjectChecked(); | 317 Handle<Object>(Heap::undefined_value()))->ToObjectChecked(); |
308 CHECK(code->IsCode()); | 318 CHECK(code->IsCode()); |
309 #ifdef DEBUG | 319 #ifdef DEBUG |
310 Code::cast(code)->Print(); | 320 Code::cast(code)->Print(); |
311 #endif | 321 #endif |
312 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry()); | 322 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry()); |
313 t.a = 1.5; | 323 t.a = 1.5; |
314 t.b = 2.75; | 324 t.b = 2.75; |
315 t.c = 17.17; | 325 t.c = 17.17; |
316 t.d = 0.0; | 326 t.d = 0.0; |
317 t.e = 0.0; | 327 t.e = 0.0; |
318 t.f = 0.0; | 328 t.f = 0.0; |
319 t.g = -2718.2818; | 329 t.g = -2718.2818; |
320 t.h = 31415926.5; | 330 t.h = 31415926.5; |
321 t.i = 0; | 331 t.i = 0; |
| 332 t.m = -2718.2818; |
| 333 t.n = 123.456; |
322 t.x = 4.5; | 334 t.x = 4.5; |
323 t.y = 9.0; | 335 t.y = 9.0; |
324 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); | 336 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); |
325 USE(dummy); | 337 USE(dummy); |
326 CHECK_EQ(4.5, t.y); | 338 CHECK_EQ(4.5, t.y); |
327 CHECK_EQ(9.0, t.x); | 339 CHECK_EQ(9.0, t.x); |
| 340 CHECK_EQ(-123.456, t.n); |
| 341 CHECK_EQ(2718.2818, t.m); |
328 CHECK_EQ(2, t.i); | 342 CHECK_EQ(2, t.i); |
329 CHECK_EQ(2718.2818, t.g); | 343 CHECK_EQ(2718.2818, t.g); |
330 CHECK_EQ(31415926.5, t.h); | 344 CHECK_EQ(31415926.5, t.h); |
331 CHECK_EQ(42.0, t.f); | 345 CHECK_EQ(42.0, t.f); |
332 CHECK_EQ(1.0, t.e); | 346 CHECK_EQ(1.0, t.e); |
333 CHECK_EQ(1.000000059604644775390625, t.d); | 347 CHECK_EQ(1.000000059604644775390625, t.d); |
334 CHECK_EQ(4.25, t.c); | 348 CHECK_EQ(4.25, t.c); |
335 CHECK_EQ(4.25, t.b); | 349 CHECK_EQ(4.25, t.b); |
336 CHECK_EQ(1.5, t.a); | 350 CHECK_EQ(1.5, t.a); |
337 } | 351 } |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 TestRoundingMode(u32_f64, RN, static_cast<double>(kMaxInt), kMaxInt); | 602 TestRoundingMode(u32_f64, RN, static_cast<double>(kMaxInt), kMaxInt); |
589 TestRoundingMode(u32_f64, RN, (kMaxInt + 0.49), kMaxInt); | 603 TestRoundingMode(u32_f64, RN, (kMaxInt + 0.49), kMaxInt); |
590 TestRoundingMode(u32_f64, RN, (kMaxInt + 0.5), | 604 TestRoundingMode(u32_f64, RN, (kMaxInt + 0.5), |
591 static_cast<uint32_t>(kMaxInt) + 1); | 605 static_cast<uint32_t>(kMaxInt) + 1); |
592 TestRoundingMode(u32_f64, RN, (kMaxUInt + 0.49), kMaxUInt); | 606 TestRoundingMode(u32_f64, RN, (kMaxUInt + 0.49), kMaxUInt); |
593 TestRoundingMode(u32_f64, RN, (kMaxUInt + 0.5), kMaxUInt, true); | 607 TestRoundingMode(u32_f64, RN, (kMaxUInt + 0.5), kMaxUInt, true); |
594 TestRoundingMode(u32_f64, RN, (kMaxUInt + 1.0), kMaxUInt, true); | 608 TestRoundingMode(u32_f64, RN, (kMaxUInt + 1.0), kMaxUInt, true); |
595 } | 609 } |
596 | 610 |
597 #undef __ | 611 #undef __ |
OLD | NEW |