OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 j; |
235 double m; | 236 double m; |
236 double n; | 237 double n; |
237 float x; | 238 float x; |
238 float y; | 239 float y; |
239 } T; | 240 } T; |
240 T t; | 241 T t; |
241 | 242 |
242 // Create a function that accepts &t, and loads, manipulates, and stores | 243 // Create a function that accepts &t, and loads, manipulates, and stores |
243 // the doubles and floats. | 244 // the doubles and floats. |
244 Assembler assm(isolate, NULL, 0); | 245 Assembler assm(isolate, NULL, 0); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 __ vmov(d4, 2.0); | 288 __ vmov(d4, 2.0); |
288 __ vcvt_s32_f64(s31, d4); | 289 __ vcvt_s32_f64(s31, d4); |
289 __ vstr(s31, r4, OFFSET_OF(T, i)); | 290 __ vstr(s31, r4, OFFSET_OF(T, i)); |
290 | 291 |
291 // Convert from integer to floating point. | 292 // Convert from integer to floating point. |
292 __ mov(lr, Operand(42)); | 293 __ mov(lr, Operand(42)); |
293 __ vmov(s31, lr); | 294 __ vmov(s31, lr); |
294 __ vcvt_f64_s32(d4, s31); | 295 __ vcvt_f64_s32(d4, s31); |
295 __ vstr(d4, r4, OFFSET_OF(T, f)); | 296 __ vstr(d4, r4, OFFSET_OF(T, f)); |
296 | 297 |
| 298 // Convert from fixed point to floating point. |
| 299 __ mov(lr, Operand(1234)); |
| 300 __ vmov(s8, lr); |
| 301 __ vcvt_f64_s32(d4, 1); |
| 302 __ vstr(d4, r4, OFFSET_OF(T, j)); |
| 303 |
297 // Test vabs. | 304 // Test vabs. |
298 __ vldr(d1, r4, OFFSET_OF(T, g)); | 305 __ vldr(d1, r4, OFFSET_OF(T, g)); |
299 __ vabs(d0, d1); | 306 __ vabs(d0, d1); |
300 __ vstr(d0, r4, OFFSET_OF(T, g)); | 307 __ vstr(d0, r4, OFFSET_OF(T, g)); |
301 __ vldr(d2, r4, OFFSET_OF(T, h)); | 308 __ vldr(d2, r4, OFFSET_OF(T, h)); |
302 __ vabs(d0, d2); | 309 __ vabs(d0, d2); |
303 __ vstr(d0, r4, OFFSET_OF(T, h)); | 310 __ vstr(d0, r4, OFFSET_OF(T, h)); |
304 | 311 |
305 // Test vneg. | 312 // Test vneg. |
306 __ vldr(d1, r4, OFFSET_OF(T, m)); | 313 __ vldr(d1, r4, OFFSET_OF(T, m)); |
(...skipping 18 matching lines...) Expand all Loading... |
325 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry()); | 332 F3 f = FUNCTION_CAST<F3>(Code::cast(code)->entry()); |
326 t.a = 1.5; | 333 t.a = 1.5; |
327 t.b = 2.75; | 334 t.b = 2.75; |
328 t.c = 17.17; | 335 t.c = 17.17; |
329 t.d = 0.0; | 336 t.d = 0.0; |
330 t.e = 0.0; | 337 t.e = 0.0; |
331 t.f = 0.0; | 338 t.f = 0.0; |
332 t.g = -2718.2818; | 339 t.g = -2718.2818; |
333 t.h = 31415926.5; | 340 t.h = 31415926.5; |
334 t.i = 0; | 341 t.i = 0; |
| 342 t.j = 0; |
335 t.m = -2718.2818; | 343 t.m = -2718.2818; |
336 t.n = 123.456; | 344 t.n = 123.456; |
337 t.x = 4.5; | 345 t.x = 4.5; |
338 t.y = 9.0; | 346 t.y = 9.0; |
339 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); | 347 Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0); |
340 USE(dummy); | 348 USE(dummy); |
341 CHECK_EQ(4.5, t.y); | 349 CHECK_EQ(4.5, t.y); |
342 CHECK_EQ(9.0, t.x); | 350 CHECK_EQ(9.0, t.x); |
343 CHECK_EQ(-123.456, t.n); | 351 CHECK_EQ(-123.456, t.n); |
344 CHECK_EQ(2718.2818, t.m); | 352 CHECK_EQ(2718.2818, t.m); |
345 CHECK_EQ(2, t.i); | 353 CHECK_EQ(2, t.i); |
346 CHECK_EQ(2718.2818, t.g); | 354 CHECK_EQ(2718.2818, t.g); |
347 CHECK_EQ(31415926.5, t.h); | 355 CHECK_EQ(31415926.5, t.h); |
| 356 CHECK_EQ(617.0, t.j); |
348 CHECK_EQ(42.0, t.f); | 357 CHECK_EQ(42.0, t.f); |
349 CHECK_EQ(1.0, t.e); | 358 CHECK_EQ(1.0, t.e); |
350 CHECK_EQ(1.000000059604644775390625, t.d); | 359 CHECK_EQ(1.000000059604644775390625, t.d); |
351 CHECK_EQ(4.25, t.c); | 360 CHECK_EQ(4.25, t.c); |
352 CHECK_EQ(-4.1875, t.b); | 361 CHECK_EQ(-4.1875, t.b); |
353 CHECK_EQ(1.5, t.a); | 362 CHECK_EQ(1.5, t.a); |
354 } | 363 } |
355 } | 364 } |
356 | 365 |
357 | 366 |
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1215 CHECK_EQ(kArmNanLower32, BitCast<int64_t>(t.add_result) & 0xffffffffu); | 1224 CHECK_EQ(kArmNanLower32, BitCast<int64_t>(t.add_result) & 0xffffffffu); |
1216 CHECK_EQ(kArmNanUpper32, (BitCast<int64_t>(t.sub_result) >> 32) & 0x7fffffff); | 1225 CHECK_EQ(kArmNanUpper32, (BitCast<int64_t>(t.sub_result) >> 32) & 0x7fffffff); |
1217 CHECK_EQ(kArmNanLower32, BitCast<int64_t>(t.sub_result) & 0xffffffffu); | 1226 CHECK_EQ(kArmNanLower32, BitCast<int64_t>(t.sub_result) & 0xffffffffu); |
1218 CHECK_EQ(kArmNanUpper32, (BitCast<int64_t>(t.mul_result) >> 32) & 0x7fffffff); | 1227 CHECK_EQ(kArmNanUpper32, (BitCast<int64_t>(t.mul_result) >> 32) & 0x7fffffff); |
1219 CHECK_EQ(kArmNanLower32, BitCast<int64_t>(t.mul_result) & 0xffffffffu); | 1228 CHECK_EQ(kArmNanLower32, BitCast<int64_t>(t.mul_result) & 0xffffffffu); |
1220 CHECK_EQ(kArmNanUpper32, (BitCast<int64_t>(t.div_result) >> 32) & 0x7fffffff); | 1229 CHECK_EQ(kArmNanUpper32, (BitCast<int64_t>(t.div_result) >> 32) & 0x7fffffff); |
1221 CHECK_EQ(kArmNanLower32, BitCast<int64_t>(t.div_result) & 0xffffffffu); | 1230 CHECK_EQ(kArmNanLower32, BitCast<int64_t>(t.div_result) & 0xffffffffu); |
1222 } | 1231 } |
1223 | 1232 |
1224 #undef __ | 1233 #undef __ |
OLD | NEW |