44 using namespace v8::internal;
95 #if 0 // TODO(all): enable.
98 static void InitializeVM() {
107 #define BUF_SIZE 8192
108 #define SETUP() SETUP_SIZE(BUF_SIZE)
111 CcTest::InitializeVM(); \
116 #define SETUP_SIZE(buf_size) \
117 Isolate* isolate = Isolate::Current(); \
118 HandleScope scope(isolate); \
119 ASSERT(isolate != NULL); \
120 byte* buf = new byte[buf_size]; \
121 MacroAssembler masm(isolate, buf, buf_size); \
122 Decoder<DispatchingDecoderVisitor>* decoder = \
123 new Decoder<DispatchingDecoderVisitor>(); \
124 Simulator simulator(decoder); \
125 PrintDisassembler* pdis = NULL; \
143 simulator.ResetState();
145 #define START_AFTER_RESET() \
146 __ SetStackPointer(csp); \
147 __ PushCalleeSavedRegisters(); \
148 __ Debug("Start test.", __LINE__, TRACE_ENABLE | LOG_ALL);
155 simulator.RunFrom(reinterpret_cast<Instruction*>(buf))
158 __ Debug("End test.", __LINE__, TRACE_DISABLE | LOG_ALL); \
160 __ PopCalleeSavedRegisters(); \
168 #else // ifdef USE_SIMULATOR.
170 #define SETUP_SIZE(buf_size) \
171 Isolate* isolate = Isolate::Current(); \
172 HandleScope scope(isolate); \
173 ASSERT(isolate != NULL); \
174 byte* buf = new byte[buf_size]; \
175 MacroAssembler masm(isolate, buf, buf_size); \
182 #define START_AFTER_RESET() \
183 __ SetStackPointer(csp); \
184 __ PushCalleeSavedRegisters();
191 CPU::FlushICache(buf, masm.SizeOfGeneratedCode()); \
193 void (*test_function)(void); \
194 memcpy(&test_function, &buf, sizeof(buf)); \
200 __ PopCalleeSavedRegisters(); \
207 #endif // ifdef USE_SIMULATOR.
209 #define ASSERT_EQUAL_NZCV(expected) \
210 CHECK(EqualNzcv(expected, core.flags_nzcv()))
212 #define ASSERT_EQUAL_REGISTERS(expected) \
213 CHECK(EqualRegisters(&expected, &core))
215 #define ASSERT_EQUAL_32(expected, result) \
216 CHECK(Equal32(static_cast<uint32_t>(expected), &core, result))
218 #define ASSERT_EQUAL_FP32(expected, result) \
219 CHECK(EqualFP32(expected, &core, result))
221 #define ASSERT_EQUAL_64(expected, result) \
222 CHECK(Equal64(expected, &core, result))
224 #define ASSERT_EQUAL_FP64(expected, result) \
225 CHECK(EqualFP64(expected, &core, result))
228 #define ASSERT_LITERAL_POOL_SIZE(expected) \
229 CHECK((expected) == (__ LiteralPoolSize()))
231 #define ASSERT_LITERAL_POOL_SIZE(expected) \
338 __ Mov(x0, 0xffffffffffffffffL);
339 __ Mov(x1, 0xffffffffffffffffL);
340 __ Mov(x2, 0xffffffffffffffffL);
341 __ Mov(x3, 0xffffffffffffffffL);
343 __ Mov(x0, 0x0123456789abcdefL);
345 __ movz(x1, 0xabcdL << 16);
346 __ movk(x2, 0xabcdL << 32);
347 __ movn(x3, 0xabcdL << 48);
349 __ Mov(x4, 0x0123456789abcdefL);
356 __ Mov(x7, 0x0123456789abcdefL);
358 __ Mov(x8, 0x0123456789abcdefL);
360 __ Mov(x9, 0x0123456789abcdefL);
362 __ Mov(x10, 0x0123456789abcdefL);
419 __ Mov(w0, 0xffffffffL);
420 __ Mov(w1, 0xffff1234L);
421 __ Mov(w2, 0x1234ffffL);
422 __ Mov(w3, 0x00000000L);
423 __ Mov(w4, 0x00001234L);
424 __ Mov(w5, 0x12340000L);
425 __ Mov(w6, 0x12345678L);
447 __ Mov(x0, 0xffffffffffffffffL);
448 __ Mov(x1, 0xffffffffffff1234L);
449 __ Mov(x2, 0xffffffff12345678L);
450 __ Mov(x3, 0xffff1234ffff5678L);
451 __ Mov(x4, 0x1234ffffffff5678L);
452 __ Mov(x5, 0x1234ffff5678ffffL);
453 __ Mov(x6, 0x12345678ffffffffL);
454 __ Mov(x7, 0x1234ffffffffffffL);
455 __ Mov(x8, 0x123456789abcffffL);
456 __ Mov(x9, 0x12345678ffff9abcL);
457 __ Mov(x10, 0x1234ffff56789abcL);
458 __ Mov(x11, 0xffff123456789abcL);
459 __ Mov(x12, 0x0000000000000000L);
460 __ Mov(x13, 0x0000000000001234L);
461 __ Mov(x14, 0x0000000012345678L);
462 __ Mov(x15, 0x0000123400005678L);
463 __ Mov(x18, 0x1234000000005678L);
464 __ Mov(x19, 0x1234000056780000L);
465 __ Mov(x20, 0x1234567800000000L);
466 __ Mov(x21, 0x1234000000000000L);
467 __ Mov(x22, 0x123456789abc0000L);
468 __ Mov(x23, 0x1234567800009abcL);
469 __ Mov(x24, 0x1234000056789abcL);
470 __ Mov(x25, 0x0000123456789abcL);
471 __ Mov(x26, 0x123456789abcdef0L);
472 __ Mov(x27, 0xffff000000000001L);
473 __ Mov(x28, 0x8000ffff00000000L);
515 __ Mov(x1, 0xf00000ff);
526 __ Orr(x11, x0,
Operand(0xf0000000f0000000L));
552 __ Mov(x1, 0x8000000080008080UL);
584 __ Mov(x1, 0xf0f0f0f0f0f0f0f0UL);
586 __ Orr(x10, x0,
Operand(0x1234567890abcdefUL));
607 __ Mov(x1, 0xf00000ff);
618 __ Orn(x11, x0,
Operand(0xffff0000ffffL));
644 __ Mov(x1, 0x8000000080008081UL);
676 __ Mov(x1, 0xf00000ff);
712 __ Mov(x0, 0xffffffffffffffffUL);
713 __ Mov(x1, 0x8000000080008081UL);
744 __ Mov(x1, 0xf00000ff);
755 __ Mov(x1, 0xf00000ff);
765 __ Mov(x0, 0x8000000000000000L);
766 __ Mov(x1, 0x00000001);
786 __ Mov(x0, 0xff000000);
805 __ Mov(x1, 0xf00000ff);
823 __ Mov(x0, 0xffffff);
853 __ Mov(x0, 0xffffffffffffffffUL);
854 __ Mov(x1, 0x8000000080008081UL);
895 __ Mov(x0, 0xffffffff);
905 __ Mov(x0, 0x8000000000000000L);
906 __ Mov(x1, 0x00000001);
916 __ Mov(x0, 0xffffffffffffffffL);
917 __ Bics(x0, x0,
Operand(0x7fffffffffffffffL));
926 __ Mov(w0, 0xffff0000);
945 __ Mov(x1, 0xf00000ff);
956 __ Eor(x11, x0,
Operand(0xff00ff00ff00ff00L));
981 __ Mov(x0, 0x1111111111111111UL);
982 __ Mov(x1, 0x8000000080008081UL);
1014 __ Mov(x1, 0xf00000ff);
1025 __ Eon(x11, x0,
Operand(0x0000100000001000L));
1050 __ Mov(x0, 0x1111111111111111UL);
1051 __ Mov(x1, 0x8000000080008081UL);
1084 __ Mov(x18, 0xffffffff);
1085 __ Mov(x19, 0xffffffffffffffffUL);
1087 __ Mul(w0, w16, w16);
1088 __ Mul(w1, w16, w17);
1089 __ Mul(w2, w17, w18);
1090 __ Mul(w3, w18, w19);
1091 __ Mul(x4, x16, x16);
1092 __ Mul(x5, x17, x18);
1093 __ Mul(x6, x18, x19);
1094 __ Mul(x7, x19, x19);
1095 __ Smull(x8, w17, w18);
1096 __ Smull(x9, w18, w18);
1097 __ Smull(x10, w19, w19);
1098 __ Mneg(w11, w16, w16);
1099 __ Mneg(w12, w16, w17);
1100 __ Mneg(w13, w17, w18);
1101 __ Mneg(w14, w18, w19);
1102 __ Mneg(x20, x16, x16);
1103 __ Mneg(x21, x17, x18);
1104 __ Mneg(x22, x18, x19);
1105 __ Mneg(x23, x19, x19);
1134 static void SmullHelper(int64_t expected, int64_t a, int64_t b) {
1139 __ Smull(x2, w0, w1);
1149 SmullHelper(0, 0, 0);
1150 SmullHelper(1, 1, 1);
1151 SmullHelper(-1, -1, 1);
1152 SmullHelper(1, -1, -1);
1153 SmullHelper(0xffffffff80000000, 0x80000000, 1);
1154 SmullHelper(0x0000000080000000, 0x00010000, 0x00008000);
1165 __ Mov(x18, 0xffffffff);
1166 __ Mov(x19, 0xffffffffffffffffUL);
1168 __ Madd(w0, w16, w16, w16);
1169 __ Madd(w1, w16, w16, w17);
1170 __ Madd(w2, w16, w16, w18);
1171 __ Madd(w3, w16, w16, w19);
1172 __ Madd(w4, w16, w17, w17);
1173 __ Madd(w5, w17, w17, w18);
1174 __ Madd(w6, w17, w17, w19);
1175 __ Madd(w7, w17, w18, w16);
1176 __ Madd(w8, w17, w18, w18);
1177 __ Madd(w9, w18, w18, w17);
1178 __ Madd(w10, w18, w19, w18);
1179 __ Madd(w11, w19, w19, w19);
1181 __ Madd(x12, x16, x16, x16);
1182 __ Madd(x13, x16, x16, x17);
1183 __ Madd(x14, x16, x16, x18);
1184 __ Madd(x15, x16, x16, x19);
1185 __ Madd(x20, x16, x17, x17);
1186 __ Madd(x21, x17, x17, x18);
1187 __ Madd(x22, x17, x17, x19);
1188 __ Madd(x23, x17, x18, x16);
1189 __ Madd(x24, x17, x18, x18);
1190 __ Madd(x25, x18, x18, x17);
1191 __ Madd(x26, x18, x19, x18);
1192 __ Madd(x27, x19, x19, x19);
1235 __ Mov(x18, 0xffffffff);
1236 __ Mov(x19, 0xffffffffffffffffUL);
1238 __ Msub(w0, w16, w16, w16);
1239 __ Msub(w1, w16, w16, w17);
1240 __ Msub(w2, w16, w16, w18);
1241 __ Msub(w3, w16, w16, w19);
1242 __ Msub(w4, w16, w17, w17);
1243 __ Msub(w5, w17, w17, w18);
1244 __ Msub(w6, w17, w17, w19);
1245 __ Msub(w7, w17, w18, w16);
1246 __ Msub(w8, w17, w18, w18);
1247 __ Msub(w9, w18, w18, w17);
1248 __ Msub(w10, w18, w19, w18);
1249 __ Msub(w11, w19, w19, w19);
1251 __ Msub(x12, x16, x16, x16);
1252 __ Msub(x13, x16, x16, x17);
1253 __ Msub(x14, x16, x16, x18);
1254 __ Msub(x15, x16, x16, x19);
1255 __ Msub(x20, x16, x17, x17);
1256 __ Msub(x21, x17, x17, x18);
1257 __ Msub(x22, x17, x17, x19);
1258 __ Msub(x23, x17, x18, x16);
1259 __ Msub(x24, x17, x18, x18);
1260 __ Msub(x25, x18, x18, x17);
1261 __ Msub(x26, x18, x19, x18);
1262 __ Msub(x27, x19, x19, x19);
1305 __ Mov(x22, 0x0000000100000000L);
1306 __ Mov(x23, 0x12345678);
1307 __ Mov(x24, 0x0123456789abcdefL);
1308 __ Mov(x25, 0x0000000200000000L);
1309 __ Mov(x26, 0x8000000000000000UL);
1310 __ Mov(x27, 0xffffffffffffffffUL);
1311 __ Mov(x28, 0x5555555555555555UL);
1312 __ Mov(x29, 0xaaaaaaaaaaaaaaaaUL);
1314 __ Smulh(x0, x20, x24);
1315 __ Smulh(x1, x21, x24);
1316 __ Smulh(x2, x22, x23);
1317 __ Smulh(x3, x22, x24);
1318 __ Smulh(x4, x24, x25);
1319 __ Smulh(x5, x23, x27);
1320 __ Smulh(x6, x26, x26);
1321 __ Smulh(x7, x26, x27);
1322 __ Smulh(x8, x27, x27);
1323 __ Smulh(x9, x28, x28);
1324 __ Smulh(x10, x28, x29);
1325 __ Smulh(x11, x29, x29);
1353 __ Mov(x18, 0xffffffff);
1354 __ Mov(x19, 0xffffffffffffffffUL);
1356 __ Mov(x21, 0x200000000UL);
1358 __ Smaddl(x9, w17, w18, x20);
1359 __ Smaddl(x10, w18, w18, x20);
1360 __ Smaddl(x11, w19, w19, x20);
1361 __ Smaddl(x12, w19, w19, x21);
1362 __ Umaddl(x13, w17, w18, x20);
1363 __ Umaddl(x14, w18, w18, x20);
1364 __ Umaddl(x15, w19, w19, x20);
1365 __ Umaddl(x22, w19, w19, x21);
1389 __ Mov(x18, 0xffffffff);
1390 __ Mov(x19, 0xffffffffffffffffUL);
1392 __ Mov(x21, 0x200000000UL);
1394 __ Smsubl(x9, w17, w18, x20);
1395 __ Smsubl(x10, w18, w18, x20);
1396 __ Smsubl(x11, w19, w19, x20);
1397 __ Smsubl(x12, w19, w19, x21);
1398 __ Umsubl(x13, w17, w18, x20);
1399 __ Umsubl(x14, w18, w18, x20);
1400 __ Umsubl(x15, w19, w19, x20);
1401 __ Umsubl(x22, w19, w19, x21);
1425 __ Mov(x17, 0xffffffff);
1426 __ Mov(x18, 0xffffffffffffffffUL);
1427 __ Mov(x19, 0x80000000);
1428 __ Mov(x20, 0x8000000000000000UL);
1431 __ Udiv(w0, w16, w16);
1432 __ Udiv(w1, w17, w16);
1433 __ Sdiv(w2, w16, w16);
1434 __ Sdiv(w3, w16, w17);
1435 __ Sdiv(w4, w17, w18);
1437 __ Udiv(x5, x16, x16);
1438 __ Udiv(x6, x17, x18);
1439 __ Sdiv(x7, x16, x16);
1440 __ Sdiv(x8, x16, x17);
1441 __ Sdiv(x9, x17, x18);
1443 __ Udiv(w10, w19, w21);
1444 __ Sdiv(w11, w19, w21);
1445 __ Udiv(x12, x19, x21);
1446 __ Sdiv(x13, x19, x21);
1447 __ Udiv(x14, x20, x21);
1448 __ Sdiv(x15, x20, x21);
1450 __ Udiv(w22, w19, w17);
1451 __ Sdiv(w23, w19, w17);
1452 __ Udiv(x24, x20, x18);
1453 __ Sdiv(x25, x20, x18);
1455 __ Udiv(x26, x16, x21);
1456 __ Sdiv(x27, x16, x21);
1457 __ Udiv(x28, x18, x21);
1458 __ Sdiv(x29, x18, x21);
1461 __ Udiv(w18, w16, w17);
1462 __ Sdiv(w19, w16, w17);
1463 __ Udiv(x20, x16, x17);
1464 __ Sdiv(x21, x16, x17);
1507 __ Mov(x24, 0xfedcba9876543210UL);
1536 __ Mov(x24, 0x0008000000800000UL);
1537 __ Mov(x25, 0xff800000fff80000UL);
1576 Label label_1, label_2, label_3, label_4;
1647 Label label_1, label_2, label_3, label_4;
1651 __ Adr(x1, &label_3);
1653 __ Adr(x2, &label_1);
1654 __ Adr(x3, &label_1);
1655 __ Adr(x4, &label_1);
1665 __ Adr(x2, &label_3);
1667 __ Adr(x2, &label_4);
1671 __ Adr(x2, &label_3);
1672 __ Adr(x3, &label_3);
1673 __ Adr(x4, &label_3);
1674 __ Adr(x5, &label_2);
1698 __ Mov(x2, 0x8000000000000000L);
1784 Label fn1, after_fn1;
1797 __ Bind(&after_fn1);
1801 Label fn2, after_fn2;
1811 __ Bind(&after_fn2);
1870 __ Mov(x18, 0xffffffff00000000UL);
1910 __ Mov(x16, 0xaaaaaaaaaaaaaaaaUL);
1913 __ Tbz(w16, 0, &bz);
1920 __ Tbz(x16, 63, &bo);
1927 __ Tbnz(x16, 61, &nbz);
1934 __ Tbnz(w16, 2, &nbo);
1967 Label test_tbz, test_cbz, test_bcond;
1968 Label success_tbz, success_cbz, success_bcond;
1975 __ Bind(&success_tbz);
1976 __ Orr(x0, x0, 1 << 0);
1978 __ Bind(&success_cbz);
1979 __ Orr(x0, x0, 1 << 1);
1981 __ Bind(&success_bcond);
1982 __ Orr(x0, x0, 1 << 2);
2000 __ Tbz(x10, 7, &success_tbz);
2002 __ Cbz(x10, &success_cbz);
2003 __ Bind(&test_bcond);
2005 __ B(
eq, &success_bcond);
2041 Label test_tbz, test_cbz, test_bcond;
2042 Label success_tbz, success_cbz, success_bcond;
2049 __ Tbz(x10, 7, &success_tbz);
2051 __ Cbz(x10, &success_cbz);
2052 __ Bind(&test_bcond);
2054 __ B(
eq, &success_bcond);
2071 __ Bind(&success_tbz);
2072 __ Orr(x0, x0, 1 << 0);
2074 __ Bind(&success_cbz);
2075 __ Orr(x0, x0, 1 << 1);
2077 __ Bind(&success_bcond);
2078 __ Orr(x0, x0, 1 << 2);
2096 TEST(far_branch_veneer_link_chain) {
2116 Label skip, fail, done;
2117 Label test_tbz, test_cbz, test_bcond;
2118 Label success_tbz, success_cbz, success_bcond;
2127 __ B(&success_bcond);
2129 __ B(&success_bcond);
2134 __ Tbz(x10, 7, &success_tbz);
2136 __ Cbz(x10, &success_cbz);
2137 __ Bind(&test_bcond);
2139 __ B(
eq, &success_bcond);
2166 __ Bind(&success_tbz);
2167 __ Orr(x0, x0, 1 << 0);
2169 __ Bind(&success_cbz);
2170 __ Orr(x0, x0, 1 << 1);
2172 __ Bind(&success_bcond);
2173 __ Orr(x0, x0, 1 << 2);
2191 TEST(far_branch_veneer_broken_link_chain) {
2200 int inter_range = max_range / 2 + max_range / 10;
2206 Label skip, fail, done;
2207 Label test_1, test_2, test_3;
2231 __ Tbz(x10, 7, &far_target);
2246 __ Tbz(x10, 7, &far_target);
2259 __ Bind(&far_target);
2303 Label l1, l2, l3, l4, l5;
2342 uint64_t src[2] = {0xfedcba9876543210UL, 0x0123456789abcdefUL};
2343 uint64_t dst[5] = {0, 0, 0, 0, 0};
2344 uintptr_t src_base =
reinterpret_cast<uintptr_t
>(src);
2345 uintptr_t dst_base =
reinterpret_cast<uintptr_t
>(dst);
2348 __ Mov(x17, src_base);
2349 __ Mov(x18, dst_base);
2387 uintptr_t src_base =
reinterpret_cast<uintptr_t
>(src);
2388 uintptr_t dst_base =
reinterpret_cast<uintptr_t
>(dst);
2389 memset(src, 0xaa, 8192 *
sizeof(src[0]));
2390 memset(dst, 0xaa, 8192 *
sizeof(dst[0]));
2396 __ Mov(x22, src_base);
2397 __ Mov(x23, dst_base);
2398 __ Mov(x24, src_base);
2399 __ Mov(x25, dst_base);
2400 __ Mov(x26, src_base);
2401 __ Mov(x27, dst_base);
2434 uint64_t src[2] = {0xfedcba9876543210UL, 0x0123456789abcdefUL};
2435 uint64_t dst[6] = {0, 0, 0, 0, 0, 0};
2436 uintptr_t src_base =
reinterpret_cast<uintptr_t
>(src);
2437 uintptr_t dst_base =
reinterpret_cast<uintptr_t
>(dst);
2440 __ Mov(x17, src_base);
2441 __ Mov(x18, dst_base);
2442 __ Mov(x19, src_base);
2443 __ Mov(x20, dst_base);
2444 __ Mov(x21, src_base + 16);
2445 __ Mov(x22, dst_base + 40);
2446 __ Mov(x23, src_base);
2447 __ Mov(x24, dst_base);
2448 __ Mov(x25, src_base);
2449 __ Mov(x26, dst_base);
2493 uint64_t src[2] = {0xfedcba9876543210UL, 0x0123456789abcdefUL};
2494 uint64_t dst[6] = {0, 0, 0, 0, 0, 0};
2495 uintptr_t src_base =
reinterpret_cast<uintptr_t
>(src);
2496 uintptr_t dst_base =
reinterpret_cast<uintptr_t
>(dst);
2499 __ Mov(x17, src_base + 4);
2500 __ Mov(x18, dst_base + 12);
2501 __ Mov(x19, src_base + 8);
2502 __ Mov(x20, dst_base + 16);
2503 __ Mov(x21, src_base + 8);
2504 __ Mov(x22, dst_base + 32);
2505 __ Mov(x23, src_base + 1);
2506 __ Mov(x24, dst_base + 25);
2507 __ Mov(x25, src_base + 3);
2508 __ Mov(x26, dst_base + 41);
2552 uint32_t src[2] = {0x80008080, 0x7fff7f7f};
2553 uintptr_t src_base =
reinterpret_cast<uintptr_t
>(src);
2556 __ Mov(x24, src_base);
2590 uint32_t src[3] = {1, 2, 3};
2591 uint32_t dst[4] = {0, 0, 0, 0};
2592 uintptr_t src_base =
reinterpret_cast<uintptr_t
>(src);
2593 uintptr_t dst_base =
reinterpret_cast<uintptr_t
>(dst);
2596 __ Mov(x16, src_base);
2597 __ Mov(x17, dst_base);
2598 __ Mov(x18, src_base + 3 *
sizeof(src[0]));
2599 __ Mov(x19, dst_base + 3 *
sizeof(dst[0]));
2600 __ Mov(x20, dst_base + 4 *
sizeof(dst[0]));
2604 __ Mov(x27, 0xfffffffc);
2605 __ Mov(x28, 0xfffffffe);
2606 __ Mov(x29, 0xffffffff);
2638 float src[3] = {1.0, 2.0, 3.0};
2639 float dst[3] = {0.0, 0.0, 0.0};
2640 uintptr_t src_base =
reinterpret_cast<uintptr_t
>(src);
2641 uintptr_t dst_base =
reinterpret_cast<uintptr_t
>(dst);
2644 __ Mov(x17, src_base);
2645 __ Mov(x18, dst_base);
2646 __ Mov(x19, src_base);
2647 __ Mov(x20, dst_base);
2648 __ Mov(x21, src_base);
2649 __ Mov(x22, dst_base);
2681 double src[3] = {1.0, 2.0, 3.0};
2682 double dst[3] = {0.0, 0.0, 0.0};
2683 uintptr_t src_base =
reinterpret_cast<uintptr_t
>(src);
2684 uintptr_t dst_base =
reinterpret_cast<uintptr_t
>(dst);
2687 __ Mov(x17, src_base);
2688 __ Mov(x18, dst_base);
2689 __ Mov(x19, src_base);
2690 __ Mov(x20, dst_base);
2691 __ Mov(x21, src_base);
2692 __ Mov(x22, dst_base);
2724 float src[2] = {1.0, 2.0};
2725 float dst[3] = {0.0, 0.0, 0.0};
2726 uintptr_t src_base =
reinterpret_cast<uintptr_t
>(src);
2727 uintptr_t dst_base =
reinterpret_cast<uintptr_t
>(dst);
2730 __ Mov(x16, src_base);
2731 __ Mov(x17, dst_base);
2754 double src[2] = {1.0, 2.0};
2755 double dst[3] = {0.0, 0.0, 0.0};
2756 uintptr_t src_base =
reinterpret_cast<uintptr_t
>(src);
2757 uintptr_t dst_base =
reinterpret_cast<uintptr_t
>(dst);
2760 __ Mov(x16, src_base);
2761 __ Mov(x17, dst_base);
2784 uint64_t src[3] = {0x0011223344556677UL, 0x8899aabbccddeeffUL,
2785 0xffeeddccbbaa9988UL};
2786 uint64_t dst[7] = {0, 0, 0, 0, 0, 0, 0};
2787 uintptr_t src_base =
reinterpret_cast<uintptr_t
>(src);
2788 uintptr_t dst_base =
reinterpret_cast<uintptr_t
>(dst);
2791 __ Mov(x16, src_base);
2792 __ Mov(x17, dst_base);
2793 __ Mov(x18, src_base + 24);
2794 __ Mov(x19, dst_base + 56);
2839 uint64_t src[3] = {0x0011223344556677UL, 0x8899aabbccddeeffUL,
2840 0xffeeddccbbaa9988UL};
2841 uint64_t dst[7] = {0, 0, 0, 0, 0, 0, 0};
2842 uintptr_t src_base =
reinterpret_cast<uintptr_t
>(src);
2843 uintptr_t dst_base =
reinterpret_cast<uintptr_t
>(dst);
2846 __ Mov(x16, src_base);
2847 __ Mov(x17, dst_base);
2848 __ Mov(x18, src_base + 24);
2849 __ Mov(x19, dst_base + 56);
2894 uint64_t src[3] = {0x0011223344556677UL, 0x8899aabbccddeeffUL,
2895 0xffeeddccbbaa9988UL};
2896 uint64_t dst[5] = {0, 0, 0, 0, 0};
2897 uintptr_t src_base =
reinterpret_cast<uintptr_t
>(src);
2898 uintptr_t dst_base =
reinterpret_cast<uintptr_t
>(dst);
2901 __ Mov(x16, src_base);
2902 __ Mov(x17, dst_base);
2903 __ Mov(x18, dst_base + 16);
2949 uint64_t src[4] = {0x0011223344556677UL, 0x8899aabbccddeeffUL,
2950 0xffeeddccbbaa9988UL, 0x7766554433221100UL};
2951 uint64_t dst[5] = {0, 0, 0, 0, 0};
2952 uintptr_t src_base =
reinterpret_cast<uintptr_t
>(src);
2953 uintptr_t dst_base =
reinterpret_cast<uintptr_t
>(dst);
2956 __ Mov(x16, src_base);
2957 __ Mov(x17, dst_base);
2958 __ Mov(x18, dst_base + 16);
3004 uint32_t src[2] = {0x80000000, 0x7fffffff};
3005 uintptr_t src_base =
reinterpret_cast<uintptr_t
>(src);
3008 __ Mov(x24, src_base);
3025 int64_t src[2] = {0x0123456789abcdefUL, 0x0123456789abcdefUL};
3026 int64_t dst[5] = {0, 0, 0, 0, 0};
3027 uintptr_t src_base =
reinterpret_cast<uintptr_t
>(src);
3028 uintptr_t dst_base =
reinterpret_cast<uintptr_t
>(dst);
3031 __ Mov(x17, src_base);
3032 __ Mov(x18, dst_base);
3033 __ Mov(x19, src_base + 16);
3034 __ Mov(x20, dst_base + 32);
3035 __ Mov(x21, dst_base + 40);
3066 #if 0 // TODO(all) enable.
3073 __ Ldr(x2, 0x1234567890abcdefUL);
3074 __ Ldr(w3, 0xfedcba09);
3090 static void LdrLiteralRangeHelper(ptrdiff_t range_,
3091 LiteralPoolEmitOption option,
3096 Label label_1, label_2;
3098 size_t range =
static_cast<size_t>(range_);
3099 size_t code_size = 0;
3100 size_t pool_guard_size;
3102 if (option == NoJumpRequired) {
3104 pool_guard_size =
sizeof(
Instr);
3106 pool_guard_size = 0;
3111 __ EmitLiteralPool(JumpRequired);
3114 __ Ldr(x0, 0x1234567890abcdefUL);
3115 __ Ldr(w1, 0xfedcba09);
3120 code_size += 4 *
sizeof(
Instr);
3124 ASSERT((code_size + pool_guard_size) <= range);
3127 while ((code_size + pool_guard_size) < range) {
3129 code_size +=
sizeof(
Instr);
3133 if (option == NoJumpRequired) {
3135 code_size +=
sizeof(
Instr);
3138 ASSERT(code_size == range);
3142 __ CheckLiteralPool(option);
3151 __ EmitLiteralPool(JumpRequired);
3155 __ Ldr(x4, 0x34567890abcdef12UL);
3156 __ Ldr(w5, 0xdcba09fe);
3178 TEST(ldr_literal_range_1) {
3180 LdrLiteralRangeHelper(kRecommendedLiteralPoolRange,
3186 TEST(ldr_literal_range_2) {
3188 LdrLiteralRangeHelper(kRecommendedLiteralPoolRange-
sizeof(
Instr),
3194 TEST(ldr_literal_range_3) {
3196 LdrLiteralRangeHelper(2 * kRecommendedLiteralPoolRange,
3202 TEST(ldr_literal_range_4) {
3204 LdrLiteralRangeHelper(2 * kRecommendedLiteralPoolRange-
sizeof(
Instr),
3210 TEST(ldr_literal_range_5) {
3212 LdrLiteralRangeHelper(kLiteralPoolCheckInterval,
3218 TEST(ldr_literal_range_6) {
3220 LdrLiteralRangeHelper(kLiteralPoolCheckInterval-
sizeof(
Instr),
3233 __ Mov(x2, 0xffffffffffffffffL);
3234 __ Mov(x3, 0x8000000000000000L);
3291 __ Add(x10, x0,
Operand(0x1234567890abcdefUL));
3297 __ Sub(x20, x0,
Operand(0x1234567890abcdefUL));
3324 __ Mov(x1, 0x0123456789abcdefL);
3325 __ Mov(x2, 0xfedcba9876543210L);
3326 __ Mov(x3, 0xffffffffffffffffL);
3377 __ Mov(x1, 0x0123456789abcdefL);
3378 __ Mov(x2, 0xfedcba9876543210L);
3449 __ Mov(x2, 0x1122334455667788);
3450 __ Mov(w3, 0x11223344);
3453 __ Add(x10, x0, -42);
3454 __ Add(x11, x1, -687);
3455 __ Add(x12, x2, -0x88);
3457 __ Sub(x13, x0, -600);
3458 __ Sub(x14, x1, -313);
3459 __ Sub(x15, x2, -0x555);
3461 __ Add(w19, w3, -0x344);
3462 __ Add(w20, w4, -2000);
3464 __ Sub(w21, w3, -0xbc);
3465 __ Sub(w22, w4, -2000);
3501 __ Sub(x2, x2, xzr);
3502 CHECK_EQ(0,
__ SizeOfCodeGeneratedSince(&blob1));
3507 CHECK_NE(0,
__ SizeOfCodeGeneratedSince(&blob2));
3511 __ Sub(w3, w3, wzr);
3512 CHECK_NE(0,
__ SizeOfCodeGeneratedSince(&blob3));
3542 __ ClaimBySMI(xzr, 8);
3543 __ DropBySMI(xzr, 8);
3544 __ ClaimBySMI(xzr, 0);
3545 __ DropBySMI(xzr, 0);
3546 CHECK_EQ(0,
__ SizeOfCodeGeneratedSince(&start));
3561 __ Mov(x0, 0xf123456789abcdefL);
3612 __ Mov(x2, 0x0123456789abcdefL);
3613 __ Mov(x3, 0xfedcba9876543210L);
3614 __ Mov(x4, 0xffffffffffffffffL);
3676 __ Mov(x1, 0xffffffffffffffffL);
3689 __ Mov(x1, 0x8000000000000000L);
3702 __ Mov(x1, 0x07ffffffffffffffL);
3716 __ Mov(x1, 0xffffffffffffffffL);
3729 __ Mov(x1, 0xffffffffffffffffL);
3744 __ Sbcs(x10, x0,
Operand(0xffffffffffffffffL));
3753 __ Mov(w0, 0x7fffffff);
3767 __ Ngcs(x10, 0x7fffffffffffffffL);
3791 __ Ngcs(x10, 0x7fffffffffffffffL);
3813 __ Mov(x2, 0x0123456789abcdefL);
3860 __ Mov(x1, 0xffffffffffffffffL);
3871 __ Mov(x0, 0x7fffffffffffffffL);
3883 __ Mov(x0, 0x7fffffffffffffffL);
3907 __ Adc(x7, x0,
Operand(0x1234567890abcdefUL));
3909 __ Sbc(x9, x0,
Operand(0x1234567890abcdefUL));
3911 __ Ngc(x11,
Operand(0xffffffff00000000UL));
3917 __ Adc(x18, x0,
Operand(0x1234567890abcdefUL));
3919 __ Sbc(x20, x0,
Operand(0x1234567890abcdefUL));
3921 __ Ngc(x22,
Operand(0xffffffff00000000UL));
3951 __ Mov(x1, 0x1111111111111111L);
3991 __ Mov(x1, 0x1111111111111111L);
4001 __ Mov(w1, 0x11111111);
4010 __ Mov(x1, 0x1111111111111111L);
4019 __ Mov(w1, 0x11111111);
4029 __ Mov(x1, 0x7fffffffffffffffL);
4039 __ Mov(w1, 0x7fffffff);
4049 __ Mov(x1, 0xffffffffffffffffL);
4059 __ Mov(w1, 0xffffffff);
4100 __ Mov(x18, 0xf0000000);
4101 __ Mov(x19, 0xf000000010000000UL);
4102 __ Mov(x20, 0xf0000000f0000000UL);
4103 __ Mov(x21, 0x7800000078000000UL);
4104 __ Mov(x22, 0x3c0000003c000000UL);
4105 __ Mov(x23, 0x8000000780000000UL);
4106 __ Mov(x24, 0x0000000f00000000UL);
4107 __ Mov(x25, 0x00000003c0000000UL);
4108 __ Mov(x26, 0x8000000780000000UL);
4109 __ Mov(x27, 0xc0000003);
4158 __ Mov(x22, 0xffffffffffffffffUL);
4160 __ Mov(x24, 0xfffffffffffffffeUL);
4161 __ Mov(x25, 0xffff);
4162 __ Mov(x26, 0xffffffff);
4280 __ Mov(x22, 0xffffffffffffffffUL);
4282 __ Mov(x24, 0xfffffffffffffffeUL);
4323 __ Mov(x24, 0x0000000f0000000fUL);
4324 __ Mov(x25, 0x0000001f0000001fUL);
4329 __ Csel(w0, w24, w25,
eq);
4330 __ Csel(w1, w24, w25,
ne);
4331 __ Csinc(w2, w24, w25,
mi);
4332 __ Csinc(w3, w24, w25,
pl);
4334 __ csel(w13, w24, w25,
al);
4335 __ csel(x14, x24, x25,
nv);
4338 __ Csinv(x4, x24, x25,
gt);
4339 __ Csinv(x5, x24, x25,
le);
4340 __ Csneg(x6, x24, x25,
hs);
4341 __ Csneg(x7, x24, x25,
lo);
4345 __ Cinc(x10, x25,
ne);
4346 __ Cinv(x11, x24,
ne);
4347 __ Cneg(x12, x24,
ne);
4349 __ csel(w15, w24, w25,
al);
4350 __ csel(x18, x24, x25,
nv);
4355 __ CmovX(x26, x25,
ne);
4356 __ CmovX(x27, x25,
eq);
4393 __ Mov(x19, 0x80000000);
4394 __ Mov(x20, 0x8000000000000000UL);
4397 __ Csel(w0, w19, -2,
ne);
4398 __ Csel(w1, w19, -1,
ne);
4399 __ Csel(w2, w19, 0,
ne);
4400 __ Csel(w3, w19, 1,
ne);
4401 __ Csel(w4, w19, 2,
ne);
4404 __ Csel(w7, w19, 3,
eq);
4406 __ Csel(x8, x20, -2,
ne);
4407 __ Csel(x9, x20, -1,
ne);
4408 __ Csel(x10, x20, 0,
ne);
4409 __ Csel(x11, x20, 1,
ne);
4410 __ Csel(x12, x20, 2,
ne);
4413 __ Csel(x15, x20, 3,
eq);
4445 uint64_t value = 0x0123456789abcdefUL;
4446 int shift[] = {1, 3, 5, 9, 17, 33};
4450 __ Mov(w1, shift[0]);
4451 __ Mov(w2, shift[1]);
4452 __ Mov(w3, shift[2]);
4453 __ Mov(w4, shift[3]);
4454 __ Mov(w5, shift[4]);
4455 __ Mov(w6, shift[5]);
4457 __ lslv(x0, x0, xzr);
4459 __ Lsl(x16, x0, x1);
4460 __ Lsl(x17, x0, x2);
4461 __ Lsl(x18, x0, x3);
4462 __ Lsl(x19, x0, x4);
4463 __ Lsl(x20, x0, x5);
4464 __ Lsl(x21, x0, x6);
4466 __ Lsl(w22, w0, w1);
4467 __ Lsl(w23, w0, w2);
4468 __ Lsl(w24, w0, w3);
4469 __ Lsl(w25, w0, w4);
4470 __ Lsl(w26, w0, w5);
4471 __ Lsl(w27, w0, w6);
4498 uint64_t value = 0x0123456789abcdefUL;
4499 int shift[] = {1, 3, 5, 9, 17, 33};
4503 __ Mov(w1, shift[0]);
4504 __ Mov(w2, shift[1]);
4505 __ Mov(w3, shift[2]);
4506 __ Mov(w4, shift[3]);
4507 __ Mov(w5, shift[4]);
4508 __ Mov(w6, shift[5]);
4510 __ lsrv(x0, x0, xzr);
4512 __ Lsr(x16, x0, x1);
4513 __ Lsr(x17, x0, x2);
4514 __ Lsr(x18, x0, x3);
4515 __ Lsr(x19, x0, x4);
4516 __ Lsr(x20, x0, x5);
4517 __ Lsr(x21, x0, x6);
4519 __ Lsr(w22, w0, w1);
4520 __ Lsr(w23, w0, w2);
4521 __ Lsr(w24, w0, w3);
4522 __ Lsr(w25, w0, w4);
4523 __ Lsr(w26, w0, w5);
4524 __ Lsr(w27, w0, w6);
4537 value &= 0xffffffffUL;
4553 int64_t value = 0xfedcba98fedcba98UL;
4554 int shift[] = {1, 3, 5, 9, 17, 33};
4558 __ Mov(w1, shift[0]);
4559 __ Mov(w2, shift[1]);
4560 __ Mov(w3, shift[2]);
4561 __ Mov(w4, shift[3]);
4562 __ Mov(w5, shift[4]);
4563 __ Mov(w6, shift[5]);
4565 __ asrv(x0, x0, xzr);
4567 __ Asr(x16, x0, x1);
4568 __ Asr(x17, x0, x2);
4569 __ Asr(x18, x0, x3);
4570 __ Asr(x19, x0, x4);
4571 __ Asr(x20, x0, x5);
4572 __ Asr(x21, x0, x6);
4574 __ Asr(w22, w0, w1);
4575 __ Asr(w23, w0, w2);
4576 __ Asr(w24, w0, w3);
4577 __ Asr(w25, w0, w4);
4578 __ Asr(w26, w0, w5);
4579 __ Asr(w27, w0, w6);
4608 uint64_t value = 0x0123456789abcdefUL;
4609 int shift[] = {4, 8, 12, 16, 24, 36};
4613 __ Mov(w1, shift[0]);
4614 __ Mov(w2, shift[1]);
4615 __ Mov(w3, shift[2]);
4616 __ Mov(w4, shift[3]);
4617 __ Mov(w5, shift[4]);
4618 __ Mov(w6, shift[5]);
4620 __ rorv(x0, x0, xzr);
4622 __ Ror(x16, x0, x1);
4623 __ Ror(x17, x0, x2);
4624 __ Ror(x18, x0, x3);
4625 __ Ror(x19, x0, x4);
4626 __ Ror(x20, x0, x5);
4627 __ Ror(x21, x0, x6);
4629 __ Ror(w22, w0, w1);
4630 __ Ror(w23, w0, w2);
4631 __ Ror(w24, w0, w3);
4632 __ Ror(w25, w0, w4);
4633 __ Ror(w26, w0, w5);
4634 __ Ror(w27, w0, w6);
4662 __ Mov(x1, 0x0123456789abcdefL);
4664 __ Mov(x10, 0x8888888888888888L);
4665 __ Mov(x11, 0x8888888888888888L);
4666 __ Mov(x12, 0x8888888888888888L);
4667 __ Mov(x13, 0x8888888888888888L);
4668 __ Mov(w20, 0x88888888);
4669 __ Mov(w21, 0x88888888);
4671 __ bfm(x10, x1, 16, 31);
4672 __ bfm(x11, x1, 32, 15);
4674 __ bfm(w20, w1, 16, 23);
4675 __ bfm(w21, w1, 24, 15);
4678 __ Bfi(x12, x1, 16, 8);
4679 __ Bfxil(x13, x1, 16, 8);
4703 __ Mov(x1, 0x0123456789abcdefL);
4704 __ Mov(x2, 0xfedcba9876543210L);
4706 __ sbfm(x10, x1, 16, 31);
4707 __ sbfm(x11, x1, 32, 15);
4708 __ sbfm(x12, x1, 32, 47);
4709 __ sbfm(x13, x1, 48, 35);
4711 __ sbfm(w14, w1, 16, 23);
4712 __ sbfm(w15, w1, 24, 15);
4713 __ sbfm(w16, w2, 16, 23);
4714 __ sbfm(w17, w2, 24, 15);
4717 __ Asr(x18, x1, 32);
4718 __ Asr(x19, x2, 32);
4719 __ Sbfiz(x20, x1, 8, 16);
4720 __ Sbfiz(x21, x2, 8, 16);
4721 __ Sbfx(x22, x1, 8, 16);
4722 __ Sbfx(x23, x2, 8, 16);
4766 __ Mov(x1, 0x0123456789abcdefL);
4767 __ Mov(x2, 0xfedcba9876543210L);
4769 __ Mov(x10, 0x8888888888888888L);
4770 __ Mov(x11, 0x8888888888888888L);
4772 __ ubfm(x10, x1, 16, 31);
4773 __ ubfm(x11, x1, 32, 15);
4774 __ ubfm(x12, x1, 32, 47);
4775 __ ubfm(x13, x1, 48, 35);
4777 __ ubfm(w25, w1, 16, 23);
4778 __ ubfm(w26, w1, 24, 15);
4779 __ ubfm(w27, w2, 16, 23);
4780 __ ubfm(w28, w2, 24, 15);
4783 __ Lsl(x15, x1, 63);
4785 __ Lsr(x17, x1, 32);
4786 __ Ubfiz(x18, x1, 8, 16);
4787 __ Ubfx(x19, x1, 8, 16);
4823 __ Mov(x1, 0x0123456789abcdefL);
4824 __ Mov(x2, 0xfedcba9876543210L);
4826 __ Extr(w10, w1, w2, 0);
4827 __ Extr(w11, w1, w2, 1);
4828 __ Extr(x12, x2, x1, 2);
4831 __ Ror(w14, w2, 17);
4832 __ Ror(w15, w1, 31);
4834 __ Ror(x19, x1, 63);
4858 __ Fmov(
d22, -13.0);
4860 __ Fmov(
d2, 12.34567);
4863 __ Fmov(
s5, kFP32PositiveInfinity);
4864 __ Fmov(
d6, kFP64NegativeInfinity);
4895 __ Fmov(
d6, rawbits_to_double(0x0123456789abcdefL));
4918 __ Fmov(
s14, -0.0f);
4919 __ Fmov(
s15, kFP32PositiveInfinity);
4920 __ Fmov(
s16, kFP32NegativeInfinity);
4921 __ Fmov(
s17, 3.25f);
4926 __ Fmov(
d27, kFP64PositiveInfinity);
4927 __ Fmov(
d28, kFP64NegativeInfinity);
4975 __ Fmov(
s14, -0.0f);
4976 __ Fmov(
s15, kFP32PositiveInfinity);
4977 __ Fmov(
s16, kFP32NegativeInfinity);
4978 __ Fmov(
s17, 3.25f);
4983 __ Fmov(
d27, kFP64PositiveInfinity);
4984 __ Fmov(
d28, kFP64NegativeInfinity);
5032 __ Fmov(
s14, -0.0f);
5033 __ Fmov(
s15, kFP32PositiveInfinity);
5034 __ Fmov(
s16, kFP32NegativeInfinity);
5035 __ Fmov(
s17, 3.25f);
5038 __ Fmov(
s20, -2.0f);
5041 __ Fmov(
d27, kFP64PositiveInfinity);
5042 __ Fmov(
d28, kFP64NegativeInfinity);
5085 static void FmaddFmsubHelper(
double n,
double m,
double a,
5086 double fmadd,
double fmsub,
5087 double fnmadd,
double fnmsub) {
5119 FmaddFmsubHelper(1.0, 2.0, 3.0, 5.0, 1.0, -5.0, -1.0);
5120 FmaddFmsubHelper(-1.0, 2.0, 3.0, 1.0, 5.0, -1.0, -5.0);
5124 FmaddFmsubHelper(-0.0, +0.0, -0.0, -0.0, +0.0, +0.0, +0.0);
5125 FmaddFmsubHelper(+0.0, +0.0, -0.0, +0.0, -0.0, +0.0, +0.0);
5126 FmaddFmsubHelper(+0.0, +0.0, +0.0, +0.0, +0.0, -0.0, +0.0);
5127 FmaddFmsubHelper(-0.0, +0.0, +0.0, +0.0, +0.0, +0.0, -0.0);
5128 FmaddFmsubHelper(+0.0, -0.0, -0.0, -0.0, +0.0, +0.0, +0.0);
5129 FmaddFmsubHelper(-0.0, -0.0, -0.0, +0.0, -0.0, +0.0, +0.0);
5130 FmaddFmsubHelper(-0.0, -0.0, +0.0, +0.0, +0.0, -0.0, +0.0);
5131 FmaddFmsubHelper(+0.0, -0.0, +0.0, +0.0, +0.0, +0.0, -0.0);
5134 FmaddFmsubHelper(kFP64PositiveInfinity, 0.0, 42.0,
5135 kFP64DefaultNaN, kFP64DefaultNaN,
5136 kFP64DefaultNaN, kFP64DefaultNaN);
5137 FmaddFmsubHelper(0.0, kFP64PositiveInfinity, 42.0,
5138 kFP64DefaultNaN, kFP64DefaultNaN,
5139 kFP64DefaultNaN, kFP64DefaultNaN);
5140 FmaddFmsubHelper(kFP64PositiveInfinity, 1.0, kFP64PositiveInfinity,
5141 kFP64PositiveInfinity,
5143 kFP64NegativeInfinity,
5145 FmaddFmsubHelper(kFP64NegativeInfinity, 1.0, kFP64PositiveInfinity,
5147 kFP64PositiveInfinity,
5149 kFP64NegativeInfinity);
5153 static void FmaddFmsubHelper(
float n,
float m,
float a,
5154 float fmadd,
float fmsub,
5155 float fnmadd,
float fnmsub) {
5186 FmaddFmsubHelper(1.0f, 2.0f, 3.0f, 5.0f, 1.0f, -5.0f, -1.0f);
5187 FmaddFmsubHelper(-1.0f, 2.0f, 3.0f, 1.0f, 5.0f, -1.0f, -5.0f);
5191 FmaddFmsubHelper(-0.0f, +0.0f, -0.0f, -0.0f, +0.0f, +0.0f, +0.0f);
5192 FmaddFmsubHelper(+0.0f, +0.0f, -0.0f, +0.0f, -0.0f, +0.0f, +0.0f);
5193 FmaddFmsubHelper(+0.0f, +0.0f, +0.0f, +0.0f, +0.0f, -0.0f, +0.0f);
5194 FmaddFmsubHelper(-0.0f, +0.0f, +0.0f, +0.0f, +0.0f, +0.0f, -0.0f);
5195 FmaddFmsubHelper(+0.0f, -0.0f, -0.0f, -0.0f, +0.0f, +0.0f, +0.0f);
5196 FmaddFmsubHelper(-0.0f, -0.0f, -0.0f, +0.0f, -0.0f, +0.0f, +0.0f);
5197 FmaddFmsubHelper(-0.0f, -0.0f, +0.0f, +0.0f, +0.0f, -0.0f, +0.0f);
5198 FmaddFmsubHelper(+0.0f, -0.0f, +0.0f, +0.0f, +0.0f, +0.0f, -0.0f);
5201 FmaddFmsubHelper(kFP32PositiveInfinity, 0.0f, 42.0f,
5202 kFP32DefaultNaN, kFP32DefaultNaN,
5203 kFP32DefaultNaN, kFP32DefaultNaN);
5204 FmaddFmsubHelper(0.0f, kFP32PositiveInfinity, 42.0f,
5205 kFP32DefaultNaN, kFP32DefaultNaN,
5206 kFP32DefaultNaN, kFP32DefaultNaN);
5207 FmaddFmsubHelper(kFP32PositiveInfinity, 1.0f, kFP32PositiveInfinity,
5208 kFP32PositiveInfinity,
5210 kFP32NegativeInfinity,
5212 FmaddFmsubHelper(kFP32NegativeInfinity, 1.0f, kFP32PositiveInfinity,
5214 kFP32PositiveInfinity,
5216 kFP32NegativeInfinity);
5223 double s1 = rawbits_to_double(0x7ff5555511111111);
5224 double s2 = rawbits_to_double(0x7ff5555522222222);
5225 double sa = rawbits_to_double(0x7ff55555aaaaaaaa);
5226 double q1 = rawbits_to_double(0x7ffaaaaa11111111);
5227 double q2 = rawbits_to_double(0x7ffaaaaa22222222);
5228 double qa = rawbits_to_double(0x7ffaaaaaaaaaaaaa);
5237 double s1_proc = rawbits_to_double(0x7ffd555511111111);
5238 double s2_proc = rawbits_to_double(0x7ffd555522222222);
5239 double sa_proc = rawbits_to_double(0x7ffd5555aaaaaaaa);
5240 double q1_proc =
q1;
5241 double q2_proc =
q2;
5242 double qa_proc = qa;
5251 double s1_proc_neg = rawbits_to_double(0xfffd555511111111);
5252 double sa_proc_neg = rawbits_to_double(0xfffd5555aaaaaaaa);
5253 double q1_proc_neg = rawbits_to_double(0xfffaaaaa11111111);
5254 double qa_proc_neg = rawbits_to_double(0xfffaaaaaaaaaaaaa);
5261 FmaddFmsubHelper(q1, 0, 0, q1_proc, q1_proc_neg, q1_proc_neg, q1_proc);
5262 FmaddFmsubHelper(0, q2, 0, q2_proc, q2_proc, q2_proc, q2_proc);
5263 FmaddFmsubHelper(0, 0, qa, qa_proc, qa_proc, qa_proc_neg, qa_proc_neg);
5264 FmaddFmsubHelper(q1, q2, 0, q1_proc, q1_proc_neg, q1_proc_neg, q1_proc);
5265 FmaddFmsubHelper(0, q2, qa, qa_proc, qa_proc, qa_proc_neg, qa_proc_neg);
5266 FmaddFmsubHelper(q1, 0, qa, qa_proc, qa_proc, qa_proc_neg, qa_proc_neg);
5267 FmaddFmsubHelper(q1, q2, qa, qa_proc, qa_proc, qa_proc_neg, qa_proc_neg);
5270 FmaddFmsubHelper(s1, 0, 0, s1_proc, s1_proc_neg, s1_proc_neg, s1_proc);
5271 FmaddFmsubHelper(0, s2, 0, s2_proc, s2_proc, s2_proc, s2_proc);
5272 FmaddFmsubHelper(0, 0, sa, sa_proc, sa_proc, sa_proc_neg, sa_proc_neg);
5273 FmaddFmsubHelper(s1, s2, 0, s1_proc, s1_proc_neg, s1_proc_neg, s1_proc);
5274 FmaddFmsubHelper(0, s2, sa, sa_proc, sa_proc, sa_proc_neg, sa_proc_neg);
5275 FmaddFmsubHelper(s1, 0, sa, sa_proc, sa_proc, sa_proc_neg, sa_proc_neg);
5276 FmaddFmsubHelper(s1, s2, sa, sa_proc, sa_proc, sa_proc_neg, sa_proc_neg);
5279 FmaddFmsubHelper(s1, q2, qa, s1_proc, s1_proc_neg, s1_proc_neg, s1_proc);
5280 FmaddFmsubHelper(q1, s2, qa, s2_proc, s2_proc, s2_proc, s2_proc);
5281 FmaddFmsubHelper(q1, q2, sa, sa_proc, sa_proc, sa_proc_neg, sa_proc_neg);
5282 FmaddFmsubHelper(s1, s2, qa, s1_proc, s1_proc_neg, s1_proc_neg, s1_proc);
5283 FmaddFmsubHelper(q1, s2, sa, sa_proc, sa_proc, sa_proc_neg, sa_proc_neg);
5284 FmaddFmsubHelper(s1, q2, sa, sa_proc, sa_proc, sa_proc_neg, sa_proc_neg);
5285 FmaddFmsubHelper(s1, s2, sa, sa_proc, sa_proc, sa_proc_neg, sa_proc_neg);
5288 FmaddFmsubHelper(0, kFP64PositiveInfinity, qa,
5289 kFP64DefaultNaN, kFP64DefaultNaN,
5290 kFP64DefaultNaN, kFP64DefaultNaN);
5291 FmaddFmsubHelper(kFP64PositiveInfinity, 0, qa,
5292 kFP64DefaultNaN, kFP64DefaultNaN,
5293 kFP64DefaultNaN, kFP64DefaultNaN);
5294 FmaddFmsubHelper(0, kFP64NegativeInfinity, qa,
5295 kFP64DefaultNaN, kFP64DefaultNaN,
5296 kFP64DefaultNaN, kFP64DefaultNaN);
5297 FmaddFmsubHelper(kFP64NegativeInfinity, 0, qa,
5298 kFP64DefaultNaN, kFP64DefaultNaN,
5299 kFP64DefaultNaN, kFP64DefaultNaN);
5306 float s1 = rawbits_to_float(0x7f951111);
5307 float s2 = rawbits_to_float(0x7f952222);
5308 float sa = rawbits_to_float(0x7f95aaaa);
5309 float q1 = rawbits_to_float(0x7fea1111);
5310 float q2 = rawbits_to_float(0x7fea2222);
5311 float qa = rawbits_to_float(0x7feaaaaa);
5320 float s1_proc = rawbits_to_float(0x7fd51111);
5321 float s2_proc = rawbits_to_float(0x7fd52222);
5322 float sa_proc = rawbits_to_float(0x7fd5aaaa);
5334 float s1_proc_neg = rawbits_to_float(0xffd51111);
5335 float sa_proc_neg = rawbits_to_float(0xffd5aaaa);
5336 float q1_proc_neg = rawbits_to_float(0xffea1111);
5337 float qa_proc_neg = rawbits_to_float(0xffeaaaaa);
5344 FmaddFmsubHelper(q1, 0, 0, q1_proc, q1_proc_neg, q1_proc_neg, q1_proc);
5345 FmaddFmsubHelper(0, q2, 0, q2_proc, q2_proc, q2_proc, q2_proc);
5346 FmaddFmsubHelper(0, 0, qa, qa_proc, qa_proc, qa_proc_neg, qa_proc_neg);
5347 FmaddFmsubHelper(q1, q2, 0, q1_proc, q1_proc_neg, q1_proc_neg, q1_proc);
5348 FmaddFmsubHelper(0, q2, qa, qa_proc, qa_proc, qa_proc_neg, qa_proc_neg);
5349 FmaddFmsubHelper(q1, 0, qa, qa_proc, qa_proc, qa_proc_neg, qa_proc_neg);
5350 FmaddFmsubHelper(q1, q2, qa, qa_proc, qa_proc, qa_proc_neg, qa_proc_neg);
5353 FmaddFmsubHelper(s1, 0, 0, s1_proc, s1_proc_neg, s1_proc_neg, s1_proc);
5354 FmaddFmsubHelper(0, s2, 0, s2_proc, s2_proc, s2_proc, s2_proc);
5355 FmaddFmsubHelper(0, 0, sa, sa_proc, sa_proc, sa_proc_neg, sa_proc_neg);
5356 FmaddFmsubHelper(s1, s2, 0, s1_proc, s1_proc_neg, s1_proc_neg, s1_proc);
5357 FmaddFmsubHelper(0, s2, sa, sa_proc, sa_proc, sa_proc_neg, sa_proc_neg);
5358 FmaddFmsubHelper(s1, 0, sa, sa_proc, sa_proc, sa_proc_neg, sa_proc_neg);
5359 FmaddFmsubHelper(s1, s2, sa, sa_proc, sa_proc, sa_proc_neg, sa_proc_neg);
5362 FmaddFmsubHelper(s1, q2, qa, s1_proc, s1_proc_neg, s1_proc_neg, s1_proc);
5363 FmaddFmsubHelper(q1, s2, qa, s2_proc, s2_proc, s2_proc, s2_proc);
5364 FmaddFmsubHelper(q1, q2, sa, sa_proc, sa_proc, sa_proc_neg, sa_proc_neg);
5365 FmaddFmsubHelper(s1, s2, qa, s1_proc, s1_proc_neg, s1_proc_neg, s1_proc);
5366 FmaddFmsubHelper(q1, s2, sa, sa_proc, sa_proc, sa_proc_neg, sa_proc_neg);
5367 FmaddFmsubHelper(s1, q2, sa, sa_proc, sa_proc, sa_proc_neg, sa_proc_neg);
5368 FmaddFmsubHelper(s1, s2, sa, sa_proc, sa_proc, sa_proc_neg, sa_proc_neg);
5371 FmaddFmsubHelper(0, kFP32PositiveInfinity, qa,
5372 kFP32DefaultNaN, kFP32DefaultNaN,
5373 kFP32DefaultNaN, kFP32DefaultNaN);
5374 FmaddFmsubHelper(kFP32PositiveInfinity, 0, qa,
5375 kFP32DefaultNaN, kFP32DefaultNaN,
5376 kFP32DefaultNaN, kFP32DefaultNaN);
5377 FmaddFmsubHelper(0, kFP32NegativeInfinity, qa,
5378 kFP32DefaultNaN, kFP32DefaultNaN,
5379 kFP32DefaultNaN, kFP32DefaultNaN);
5380 FmaddFmsubHelper(kFP32NegativeInfinity, 0, qa,
5381 kFP32DefaultNaN, kFP32DefaultNaN,
5382 kFP32DefaultNaN, kFP32DefaultNaN);
5391 __ Fmov(
s14, -0.0f);
5392 __ Fmov(
s15, kFP32PositiveInfinity);
5393 __ Fmov(
s16, kFP32NegativeInfinity);
5394 __ Fmov(
s17, 3.25f);
5397 __ Fmov(
s20, -2.0f);
5400 __ Fmov(
d27, kFP64PositiveInfinity);
5401 __ Fmov(
d28, kFP64NegativeInfinity);
5444 static float MinMaxHelper(
float n,
5447 float quiet_nan_substitute = 0.0) {
5448 uint32_t raw_n = float_to_rawbits(n);
5449 uint32_t raw_m = float_to_rawbits(m);
5453 return rawbits_to_float(raw_n | kSQuietNanMask);
5454 }
else if (
std::isnan(m) && ((raw_m & kSQuietNanMask) == 0)) {
5456 return rawbits_to_float(raw_m | kSQuietNanMask);
5457 }
else if (quiet_nan_substitute == 0.0) {
5469 n = quiet_nan_substitute;
5472 m = quiet_nan_substitute;
5476 if ((n == 0.0) && (m == 0.0) &&
5477 (copysign(1.0, n) != copysign(1.0, m))) {
5478 return min ? -0.0 : 0.0;
5481 return min ? fminf(n, m) : fmaxf(n, m);
5485 static double MinMaxHelper(
double n,
5488 double quiet_nan_substitute = 0.0) {
5489 uint64_t raw_n = double_to_rawbits(n);
5490 uint64_t raw_m = double_to_rawbits(m);
5494 return rawbits_to_double(raw_n | kDQuietNanMask);
5495 }
else if (
std::isnan(m) && ((raw_m & kDQuietNanMask) == 0)) {
5497 return rawbits_to_double(raw_m | kDQuietNanMask);
5498 }
else if (quiet_nan_substitute == 0.0) {
5510 n = quiet_nan_substitute;
5513 m = quiet_nan_substitute;
5517 if ((n == 0.0) && (m == 0.0) &&
5518 (copysign(1.0, n) != copysign(1.0, m))) {
5519 return min ? -0.0 : 0.0;
5522 return min ? fmin(n, m) : fmax(n, m);
5526 static void FminFmaxDoubleHelper(
double n,
double m,
double min,
double max,
5527 double minnm,
double maxnm) {
5553 double snan = rawbits_to_double(0x7ff5555512345678);
5554 double qnan = rawbits_to_double(0x7ffaaaaa87654321);
5556 double snan_processed = rawbits_to_double(0x7ffd555512345678);
5557 double qnan_processed = qnan;
5565 FminFmaxDoubleHelper(0, 0, 0, 0, 0, 0);
5566 FminFmaxDoubleHelper(0, 1, 0, 1, 0, 1);
5567 FminFmaxDoubleHelper(kFP64PositiveInfinity, kFP64NegativeInfinity,
5568 kFP64NegativeInfinity, kFP64PositiveInfinity,
5569 kFP64NegativeInfinity, kFP64PositiveInfinity);
5570 FminFmaxDoubleHelper(snan, 0,
5571 snan_processed, snan_processed,
5572 snan_processed, snan_processed);
5573 FminFmaxDoubleHelper(0, snan,
5574 snan_processed, snan_processed,
5575 snan_processed, snan_processed);
5576 FminFmaxDoubleHelper(qnan, 0,
5577 qnan_processed, qnan_processed,
5579 FminFmaxDoubleHelper(0, qnan,
5580 qnan_processed, qnan_processed,
5582 FminFmaxDoubleHelper(qnan, snan,
5583 snan_processed, snan_processed,
5584 snan_processed, snan_processed);
5585 FminFmaxDoubleHelper(snan, qnan,
5586 snan_processed, snan_processed,
5587 snan_processed, snan_processed);
5590 double inputs[] = { DBL_MAX, DBL_MIN, 1.0, 0.0,
5591 -DBL_MAX, -DBL_MIN, -1.0, -0.0,
5592 kFP64PositiveInfinity, kFP64NegativeInfinity,
5593 kFP64QuietNaN, kFP64SignallingNaN };
5595 const int count =
sizeof(inputs) /
sizeof(inputs[0]);
5597 for (
int in = 0; in < count; in++) {
5598 double n = inputs[in];
5599 for (
int im = 0; im < count; im++) {
5600 double m = inputs[im];
5601 FminFmaxDoubleHelper(n, m,
5602 MinMaxHelper(n, m,
true),
5603 MinMaxHelper(n, m,
false),
5604 MinMaxHelper(n, m,
true, kFP64PositiveInfinity),
5605 MinMaxHelper(n, m,
false, kFP64NegativeInfinity));
5611 static void FminFmaxFloatHelper(
float n,
float m,
float min,
float max,
5612 float minnm,
float maxnm) {
5638 float snan = rawbits_to_float(0x7f951234);
5639 float qnan = rawbits_to_float(0x7fea8765);
5641 float snan_processed = rawbits_to_float(0x7fd51234);
5642 float qnan_processed = qnan;
5650 FminFmaxFloatHelper(0, 0, 0, 0, 0, 0);
5651 FminFmaxFloatHelper(0, 1, 0, 1, 0, 1);
5652 FminFmaxFloatHelper(kFP32PositiveInfinity, kFP32NegativeInfinity,
5653 kFP32NegativeInfinity, kFP32PositiveInfinity,
5654 kFP32NegativeInfinity, kFP32PositiveInfinity);
5655 FminFmaxFloatHelper(snan, 0,
5656 snan_processed, snan_processed,
5657 snan_processed, snan_processed);
5658 FminFmaxFloatHelper(0, snan,
5659 snan_processed, snan_processed,
5660 snan_processed, snan_processed);
5661 FminFmaxFloatHelper(qnan, 0,
5662 qnan_processed, qnan_processed,
5664 FminFmaxFloatHelper(0, qnan,
5665 qnan_processed, qnan_processed,
5667 FminFmaxFloatHelper(qnan, snan,
5668 snan_processed, snan_processed,
5669 snan_processed, snan_processed);
5670 FminFmaxFloatHelper(snan, qnan,
5671 snan_processed, snan_processed,
5672 snan_processed, snan_processed);
5675 float inputs[] = { FLT_MAX, FLT_MIN, 1.0, 0.0,
5676 -FLT_MAX, -FLT_MIN, -1.0, -0.0,
5677 kFP32PositiveInfinity, kFP32NegativeInfinity,
5678 kFP32QuietNaN, kFP32SignallingNaN };
5680 const int count =
sizeof(inputs) /
sizeof(inputs[0]);
5682 for (
int in = 0; in < count; in++) {
5683 float n = inputs[in];
5684 for (
int im = 0; im < count; im++) {
5685 float m = inputs[im];
5686 FminFmaxFloatHelper(n, m,
5687 MinMaxHelper(n, m,
true),
5688 MinMaxHelper(n, m,
false),
5689 MinMaxHelper(n, m,
true, kFP32PositiveInfinity),
5690 MinMaxHelper(n, m,
false, kFP32NegativeInfinity));
5777 masm.FPTmpList()->set_list(0);
5781 __ Mov(w18, 0x7f800001);
5796 masm.FPTmpList()->set_list(
d0.Bit());
5798 masm.FPTmpList()->set_list(0);
5803 __ Mov(x21, 0x7ff0000000000001UL);
5818 masm.FPTmpList()->set_list(
d0.Bit());
5819 __ Fcmp(
d19, 12.3456);
5820 masm.FPTmpList()->set_list(0);
5887 __ Fmov(
s18, kFP32PositiveInfinity);
5890 __ Fmov(
d21, kFP64PositiveInfinity);
5932 __ Fmov(
s18, kFP32NegativeInfinity);
5935 __ Fmov(
d21, kFP64NegativeInfinity);
5970 __ Fmov(
s19, 65536.0);
5972 __ Fmov(
s21, kFP32PositiveInfinity);
5977 __ Fmov(
d26, 4294967296.0);
5979 __ Fmov(
d28, kFP64PositiveInfinity);
6031 __ Fmov(
s23, kFP32PositiveInfinity);
6032 __ Fmov(
s24, kFP32NegativeInfinity);
6055 __ Fmov(
d23, kFP32PositiveInfinity);
6056 __ Fmov(
d24, kFP32NegativeInfinity);
6114 __ Fmov(
s23, kFP32PositiveInfinity);
6115 __ Fmov(
s24, kFP32NegativeInfinity);
6138 __ Fmov(
d23, kFP32PositiveInfinity);
6139 __ Fmov(
d24, kFP32NegativeInfinity);
6197 __ Fmov(
s23, kFP32PositiveInfinity);
6198 __ Fmov(
s24, kFP32NegativeInfinity);
6221 __ Fmov(
d23, kFP32PositiveInfinity);
6222 __ Fmov(
d24, kFP32NegativeInfinity);
6280 __ Fmov(
s23, kFP32PositiveInfinity);
6281 __ Fmov(
s24, kFP32NegativeInfinity);
6284 __ Fmov(
s27, FLT_MAX);
6285 __ Fmov(
s28, FLT_MIN);
6286 __ Fmov(
s29, rawbits_to_float(0x7fc12345));
6287 __ Fmov(
s30, rawbits_to_float(0x7f812345));
6344 struct {
double in;
float expected;} test[] = {
6352 {pow(2.0, -126), powf(2, -126)},
6357 {rawbits_to_double(0x3ff0000000000000), rawbits_to_float(0x3f800000)},
6358 {rawbits_to_double(0x3ff0000000000001), rawbits_to_float(0x3f800000)},
6359 {rawbits_to_double(0x3ff0000010000000), rawbits_to_float(0x3f800000)},
6360 {rawbits_to_double(0x3ff0000010000001), rawbits_to_float(0x3f800001)},
6361 {rawbits_to_double(0x3ff0000020000000), rawbits_to_float(0x3f800001)},
6362 {rawbits_to_double(0x3ff0000020000001), rawbits_to_float(0x3f800001)},
6363 {rawbits_to_double(0x3ff0000030000000), rawbits_to_float(0x3f800002)},
6364 {rawbits_to_double(0x3ff0000030000001), rawbits_to_float(0x3f800002)},
6365 {rawbits_to_double(0x3ff0000040000000), rawbits_to_float(0x3f800002)},
6366 {rawbits_to_double(0x3ff0000040000001), rawbits_to_float(0x3f800002)},
6367 {rawbits_to_double(0x3ff0000050000000), rawbits_to_float(0x3f800002)},
6368 {rawbits_to_double(0x3ff0000050000001), rawbits_to_float(0x3f800003)},
6369 {rawbits_to_double(0x3ff0000060000000), rawbits_to_float(0x3f800003)},
6371 {rawbits_to_double(0x3feffffff0000000), rawbits_to_float(0x3f800000)},
6373 {rawbits_to_double(0x47efffffefffffff), rawbits_to_float(0x7f7fffff)},
6376 {kFP64PositiveInfinity, kFP32PositiveInfinity},
6377 {DBL_MAX, kFP32PositiveInfinity},
6379 {pow(2.0, 128), kFP32PositiveInfinity},
6381 {rawbits_to_double(0x47effffff0000000), kFP32PositiveInfinity},
6387 {rawbits_to_double(0x3690000000000000), rawbits_to_float(0x00000000)},
6391 {rawbits_to_double(0x380fffffc0000000), rawbits_to_float(0x007fffff)},
6393 {rawbits_to_double(0x36a0000000000000), rawbits_to_float(0x00000001)},
6398 {rawbits_to_double(0x37c159e000000000), rawbits_to_float(0x00045678)},
6399 {rawbits_to_double(0x37c159e000000001), rawbits_to_float(0x00045678)},
6400 {rawbits_to_double(0x37c159e200000000), rawbits_to_float(0x00045678)},
6401 {rawbits_to_double(0x37c159e200000001), rawbits_to_float(0x00045679)},
6402 {rawbits_to_double(0x37c159e400000000), rawbits_to_float(0x00045679)},
6403 {rawbits_to_double(0x37c159e400000001), rawbits_to_float(0x00045679)},
6404 {rawbits_to_double(0x37c159e600000000), rawbits_to_float(0x0004567a)},
6405 {rawbits_to_double(0x37c159e600000001), rawbits_to_float(0x0004567a)},
6406 {rawbits_to_double(0x37c159e800000000), rawbits_to_float(0x0004567a)},
6407 {rawbits_to_double(0x37c159e800000001), rawbits_to_float(0x0004567a)},
6408 {rawbits_to_double(0x37c159ea00000000), rawbits_to_float(0x0004567a)},
6409 {rawbits_to_double(0x37c159ea00000001), rawbits_to_float(0x0004567b)},
6410 {rawbits_to_double(0x37c159ec00000000), rawbits_to_float(0x0004567b)},
6412 {rawbits_to_double(0x3690000000000001), rawbits_to_float(0x00000001)},
6415 {rawbits_to_double(0x7ff82468a0000000), rawbits_to_float(0x7fc12345)},
6416 {rawbits_to_double(0x7ff82468bfffffff), rawbits_to_float(0x7fc12345)},
6418 {rawbits_to_double(0x7ff02468a0000000), rawbits_to_float(0x7fc12345)},
6419 {rawbits_to_double(0x7ff02468bfffffff), rawbits_to_float(0x7fc12345)},
6420 {rawbits_to_double(0x7ff000001fffffff), rawbits_to_float(0x7fc00000)},
6422 int count =
sizeof(test) /
sizeof(test[0]);
6424 for (
int i = 0; i < count; i++) {
6425 double in = test[i].in;
6426 float expected = test[i].expected;
6459 __ Fmov(
s4, kFP32PositiveInfinity);
6460 __ Fmov(
s5, kFP32NegativeInfinity);
6461 __ Fmov(
s6, 0x7fffff80);
6467 __ Fmov(
d12, kFP64PositiveInfinity);
6468 __ Fmov(
d13, kFP64NegativeInfinity);
6474 __ Fmov(
s20, kFP32PositiveInfinity);
6475 __ Fmov(
s21, kFP32NegativeInfinity);
6476 __ Fmov(
s22, 0x7fffff8000000000UL);
6481 __ Fmov(
d27, kFP64PositiveInfinity);
6482 __ Fmov(
d28, kFP64NegativeInfinity);
6483 __ Fmov(
d29, 0x7ffffffffffffc00UL);
6496 __ Fcvtas(w10,
d10);
6497 __ Fcvtas(w11,
d11);
6498 __ Fcvtas(w12,
d12);
6499 __ Fcvtas(w13,
d13);
6500 __ Fcvtas(w14,
d14);
6501 __ Fcvtas(w15,
d15);
6502 __ Fcvtas(x17,
s17);
6503 __ Fcvtas(x18,
s18);
6504 __ Fcvtas(x19,
s19);
6505 __ Fcvtas(x20,
s20);
6506 __ Fcvtas(x21,
s21);
6507 __ Fcvtas(x22,
s22);
6508 __ Fcvtas(x23,
s23);
6509 __ Fcvtas(x24,
d24);
6510 __ Fcvtas(x25,
d25);
6511 __ Fcvtas(x26,
d26);
6512 __ Fcvtas(x27,
d27);
6513 __ Fcvtas(x28,
d28);
6514 __ Fcvtas(x29,
d29);
6515 __ Fcvtas(x30,
d30);
6564 __ Fmov(
s4, kFP32PositiveInfinity);
6565 __ Fmov(
s5, kFP32NegativeInfinity);
6566 __ Fmov(
s6, 0xffffff00);
6571 __ Fmov(
d12, kFP64PositiveInfinity);
6572 __ Fmov(
d13, kFP64NegativeInfinity);
6573 __ Fmov(
d14, 0xfffffffe);
6578 __ Fmov(
s20, kFP32PositiveInfinity);
6579 __ Fmov(
s21, kFP32NegativeInfinity);
6580 __ Fmov(
s22, 0xffffff0000000000UL);
6584 __ Fmov(
d27, kFP64PositiveInfinity);
6585 __ Fmov(
d28, kFP64NegativeInfinity);
6586 __ Fmov(
d29, 0xfffffffffffff800UL);
6587 __ Fmov(
s30, 0x100000000UL);
6598 __ Fcvtau(w10,
d10);
6599 __ Fcvtau(w11,
d11);
6600 __ Fcvtau(w12,
d12);
6601 __ Fcvtau(w13,
d13);
6602 __ Fcvtau(w14,
d14);
6603 __ Fcvtau(w15,
d15);
6604 __ Fcvtau(x16,
s16);
6605 __ Fcvtau(x17,
s17);
6606 __ Fcvtau(x18,
s18);
6607 __ Fcvtau(x19,
s19);
6608 __ Fcvtau(x20,
s20);
6609 __ Fcvtau(x21,
s21);
6610 __ Fcvtau(x22,
s22);
6611 __ Fcvtau(x24,
d24);
6612 __ Fcvtau(x25,
d25);
6613 __ Fcvtau(x26,
d26);
6614 __ Fcvtau(x27,
d27);
6615 __ Fcvtau(x28,
d28);
6616 __ Fcvtau(x29,
d29);
6617 __ Fcvtau(w30,
s30);
6664 __ Fmov(
s4, kFP32PositiveInfinity);
6665 __ Fmov(
s5, kFP32NegativeInfinity);
6666 __ Fmov(
s6, 0x7fffff80);
6672 __ Fmov(
d12, kFP64PositiveInfinity);
6673 __ Fmov(
d13, kFP64NegativeInfinity);
6679 __ Fmov(
s20, kFP32PositiveInfinity);
6680 __ Fmov(
s21, kFP32NegativeInfinity);
6681 __ Fmov(
s22, 0x7fffff8000000000UL);
6686 __ Fmov(
d27, kFP64PositiveInfinity);
6687 __ Fmov(
d28, kFP64NegativeInfinity);
6688 __ Fmov(
d29, 0x7ffffffffffffc00UL);
6701 __ Fcvtms(w10,
d10);
6702 __ Fcvtms(w11,
d11);
6703 __ Fcvtms(w12,
d12);
6704 __ Fcvtms(w13,
d13);
6705 __ Fcvtms(w14,
d14);
6706 __ Fcvtms(w15,
d15);
6707 __ Fcvtms(x17,
s17);
6708 __ Fcvtms(x18,
s18);
6709 __ Fcvtms(x19,
s19);
6710 __ Fcvtms(x20,
s20);
6711 __ Fcvtms(x21,
s21);
6712 __ Fcvtms(x22,
s22);
6713 __ Fcvtms(x23,
s23);
6714 __ Fcvtms(x24,
d24);
6715 __ Fcvtms(x25,
d25);
6716 __ Fcvtms(x26,
d26);
6717 __ Fcvtms(x27,
d27);
6718 __ Fcvtms(x28,
d28);
6719 __ Fcvtms(x29,
d29);
6720 __ Fcvtms(x30,
d30);
6769 __ Fmov(
s4, kFP32PositiveInfinity);
6770 __ Fmov(
s5, kFP32NegativeInfinity);
6771 __ Fmov(
s6, 0x7fffff80);
6777 __ Fmov(
d12, kFP64PositiveInfinity);
6778 __ Fmov(
d13, kFP64NegativeInfinity);
6784 __ Fmov(
s20, kFP32PositiveInfinity);
6785 __ Fmov(
s21, kFP32NegativeInfinity);
6786 __ Fmov(
s22, 0x7fffff8000000000UL);
6791 __ Fmov(
d27, kFP64PositiveInfinity);
6792 __ Fmov(
d28, kFP64NegativeInfinity);
6793 __ Fmov(
d29, 0x7ffffffffffffc00UL);
6806 __ Fcvtmu(w10,
d10);
6807 __ Fcvtmu(w11,
d11);
6808 __ Fcvtmu(w12,
d12);
6809 __ Fcvtmu(w13,
d13);
6810 __ Fcvtmu(w14,
d14);
6811 __ Fcvtmu(x17,
s17);
6812 __ Fcvtmu(x18,
s18);
6813 __ Fcvtmu(x19,
s19);
6814 __ Fcvtmu(x20,
s20);
6815 __ Fcvtmu(x21,
s21);
6816 __ Fcvtmu(x22,
s22);
6817 __ Fcvtmu(x23,
s23);
6818 __ Fcvtmu(x24,
d24);
6819 __ Fcvtmu(x25,
d25);
6820 __ Fcvtmu(x26,
d26);
6821 __ Fcvtmu(x27,
d27);
6822 __ Fcvtmu(x28,
d28);
6823 __ Fcvtmu(x29,
d29);
6824 __ Fcvtmu(x30,
d30);
6872 __ Fmov(
s4, kFP32PositiveInfinity);
6873 __ Fmov(
s5, kFP32NegativeInfinity);
6874 __ Fmov(
s6, 0x7fffff80);
6880 __ Fmov(
d12, kFP64PositiveInfinity);
6881 __ Fmov(
d13, kFP64NegativeInfinity);
6887 __ Fmov(
s20, kFP32PositiveInfinity);
6888 __ Fmov(
s21, kFP32NegativeInfinity);
6889 __ Fmov(
s22, 0x7fffff8000000000UL);
6894 __ Fmov(
d27, kFP64PositiveInfinity);
6895 __ Fmov(
d28, kFP64NegativeInfinity);
6896 __ Fmov(
d29, 0x7ffffffffffffc00UL);
6909 __ Fcvtns(w10,
d10);
6910 __ Fcvtns(w11,
d11);
6911 __ Fcvtns(w12,
d12);
6912 __ Fcvtns(w13,
d13);
6913 __ Fcvtns(w14,
d14);
6914 __ Fcvtns(w15,
d15);
6915 __ Fcvtns(x17,
s17);
6916 __ Fcvtns(x18,
s18);
6917 __ Fcvtns(x19,
s19);
6918 __ Fcvtns(x20,
s20);
6919 __ Fcvtns(x21,
s21);
6920 __ Fcvtns(x22,
s22);
6921 __ Fcvtns(x23,
s23);
6922 __ Fcvtns(x24,
d24);
6923 __ Fcvtns(x25,
d25);
6924 __ Fcvtns(x26,
d26);
6925 __ Fcvtns(x27,
d27);
6927 __ Fcvtns(x29,
d29);
6928 __ Fcvtns(x30,
d30);
6977 __ Fmov(
s4, kFP32PositiveInfinity);
6978 __ Fmov(
s5, kFP32NegativeInfinity);
6979 __ Fmov(
s6, 0xffffff00);
6984 __ Fmov(
d12, kFP64PositiveInfinity);
6985 __ Fmov(
d13, kFP64NegativeInfinity);
6986 __ Fmov(
d14, 0xfffffffe);
6991 __ Fmov(
s20, kFP32PositiveInfinity);
6992 __ Fmov(
s21, kFP32NegativeInfinity);
6993 __ Fmov(
s22, 0xffffff0000000000UL);
6997 __ Fmov(
d27, kFP64PositiveInfinity);
6998 __ Fmov(
d28, kFP64NegativeInfinity);
6999 __ Fmov(
d29, 0xfffffffffffff800UL);
7000 __ Fmov(
s30, 0x100000000UL);
7011 __ Fcvtnu(w10,
d10);
7012 __ Fcvtnu(w11,
d11);
7013 __ Fcvtnu(w12,
d12);
7014 __ Fcvtnu(w13,
d13);
7015 __ Fcvtnu(w14,
d14);
7016 __ Fcvtnu(w15,
d15);
7017 __ Fcvtnu(x16,
s16);
7018 __ Fcvtnu(x17,
s17);
7019 __ Fcvtnu(x18,
s18);
7020 __ Fcvtnu(x19,
s19);
7021 __ Fcvtnu(x20,
s20);
7022 __ Fcvtnu(x21,
s21);
7023 __ Fcvtnu(x22,
s22);
7024 __ Fcvtnu(x24,
d24);
7025 __ Fcvtnu(x25,
d25);
7026 __ Fcvtnu(x26,
d26);
7027 __ Fcvtnu(x27,
d27);
7029 __ Fcvtnu(x29,
d29);
7030 __ Fcvtnu(w30,
s30);
7077 __ Fmov(
s4, kFP32PositiveInfinity);
7078 __ Fmov(
s5, kFP32NegativeInfinity);
7079 __ Fmov(
s6, 0x7fffff80);
7085 __ Fmov(
d12, kFP64PositiveInfinity);
7086 __ Fmov(
d13, kFP64NegativeInfinity);
7092 __ Fmov(
s20, kFP32PositiveInfinity);
7093 __ Fmov(
s21, kFP32NegativeInfinity);
7094 __ Fmov(
s22, 0x7fffff8000000000UL);
7099 __ Fmov(
d27, kFP64PositiveInfinity);
7100 __ Fmov(
d28, kFP64NegativeInfinity);
7101 __ Fmov(
d29, 0x7ffffffffffffc00UL);
7114 __ Fcvtzs(w10,
d10);
7115 __ Fcvtzs(w11,
d11);
7116 __ Fcvtzs(w12,
d12);
7117 __ Fcvtzs(w13,
d13);
7118 __ Fcvtzs(w14,
d14);
7119 __ Fcvtzs(w15,
d15);
7120 __ Fcvtzs(x17,
s17);
7121 __ Fcvtzs(x18,
s18);
7122 __ Fcvtzs(x19,
s19);
7123 __ Fcvtzs(x20,
s20);
7124 __ Fcvtzs(x21,
s21);
7125 __ Fcvtzs(x22,
s22);
7126 __ Fcvtzs(x23,
s23);
7127 __ Fcvtzs(x24,
d24);
7128 __ Fcvtzs(x25,
d25);
7129 __ Fcvtzs(x26,
d26);
7130 __ Fcvtzs(x27,
d27);
7131 __ Fcvtzs(x28,
d28);
7132 __ Fcvtzs(x29,
d29);
7133 __ Fcvtzs(x30,
d30);
7182 __ Fmov(
s4, kFP32PositiveInfinity);
7183 __ Fmov(
s5, kFP32NegativeInfinity);
7184 __ Fmov(
s6, 0x7fffff80);
7190 __ Fmov(
d12, kFP64PositiveInfinity);
7191 __ Fmov(
d13, kFP64NegativeInfinity);
7197 __ Fmov(
s20, kFP32PositiveInfinity);
7198 __ Fmov(
s21, kFP32NegativeInfinity);
7199 __ Fmov(
s22, 0x7fffff8000000000UL);
7204 __ Fmov(
d27, kFP64PositiveInfinity);
7205 __ Fmov(
d28, kFP64NegativeInfinity);
7206 __ Fmov(
d29, 0x7ffffffffffffc00UL);
7219 __ Fcvtzu(w10,
d10);
7220 __ Fcvtzu(w11,
d11);
7221 __ Fcvtzu(w12,
d12);
7222 __ Fcvtzu(w13,
d13);
7223 __ Fcvtzu(w14,
d14);
7224 __ Fcvtzu(x17,
s17);
7225 __ Fcvtzu(x18,
s18);
7226 __ Fcvtzu(x19,
s19);
7227 __ Fcvtzu(x20,
s20);
7228 __ Fcvtzu(x21,
s21);
7229 __ Fcvtzu(x22,
s22);
7230 __ Fcvtzu(x23,
s23);
7231 __ Fcvtzu(x24,
d24);
7232 __ Fcvtzu(x25,
d25);
7233 __ Fcvtzu(x26,
d26);
7234 __ Fcvtzu(x27,
d27);
7235 __ Fcvtzu(x28,
d28);
7236 __ Fcvtzu(x29,
d29);
7237 __ Fcvtzu(x30,
d30);
7286 static void TestUScvtfHelper(uint64_t in,
7287 uint64_t expected_scvtf_bits,
7288 uint64_t expected_ucvtf_bits) {
7290 uint32_t u32 = u64 & 0xffffffff;
7291 int64_t s64 =
static_cast<int64_t
>(in);
7292 int32_t s32 = s64 & 0x7fffffff;
7294 bool cvtf_s32 = (s64 == s32);
7295 bool cvtf_u32 = (u64 == u32);
7297 double results_scvtf_x[65];
7298 double results_ucvtf_x[65];
7299 double results_scvtf_w[33];
7300 double results_ucvtf_w[33];
7305 __ Mov(x0, reinterpret_cast<int64_t>(results_scvtf_x));
7306 __ Mov(x1, reinterpret_cast<int64_t>(results_ucvtf_x));
7307 __ Mov(x2, reinterpret_cast<int64_t>(results_scvtf_w));
7308 __ Mov(x3, reinterpret_cast<int64_t>(results_ucvtf_w));
7314 __ Mov(x11, 0x5555555555555555);
7328 for (
int fbits = 1; fbits <= 32; fbits++) {
7329 __ Scvtf(
d0, x10, fbits);
7330 __ Ucvtf(
d1, x10, fbits);
7331 __ Scvtf(
d2, w11, fbits);
7332 __ Ucvtf(
d3, w11, fbits);
7341 for (
int fbits = 33; fbits <= 64; fbits++) {
7342 __ Scvtf(
d0, x10, fbits);
7343 __ Ucvtf(
d1, x10, fbits);
7352 double expected_scvtf_base = rawbits_to_double(expected_scvtf_bits);
7353 double expected_ucvtf_base = rawbits_to_double(expected_ucvtf_bits);
7355 for (
int fbits = 0; fbits <= 32; fbits++) {
7356 double expected_scvtf = expected_scvtf_base / pow(2.0, fbits);
7357 double expected_ucvtf = expected_ucvtf_base / pow(2.0, fbits);
7363 for (
int fbits = 33; fbits <= 64; fbits++) {
7364 double expected_scvtf = expected_scvtf_base / pow(2.0, fbits);
7365 double expected_ucvtf = expected_ucvtf_base / pow(2.0, fbits);
7379 TestUScvtfHelper(0x0000000000000000, 0x0000000000000000, 0x0000000000000000);
7380 TestUScvtfHelper(0x0000000000000001, 0x3ff0000000000000, 0x3ff0000000000000);
7381 TestUScvtfHelper(0x0000000040000000, 0x41d0000000000000, 0x41d0000000000000);
7382 TestUScvtfHelper(0x0000000100000000, 0x41f0000000000000, 0x41f0000000000000);
7383 TestUScvtfHelper(0x4000000000000000, 0x43d0000000000000, 0x43d0000000000000);
7385 TestUScvtfHelper(0x4000000000000400, 0x43d0000000000001, 0x43d0000000000001);
7387 TestUScvtfHelper(0x000000007fffffff, 0x41dfffffffc00000, 0x41dfffffffc00000);
7389 TestUScvtfHelper(0x00000000ffffffff, 0x41efffffffe00000, 0x41efffffffe00000);
7390 TestUScvtfHelper(0x0000000080000000, 0x41e0000000000000, 0x41e0000000000000);
7391 TestUScvtfHelper(0x0000000080000001, 0x41e0000000200000, 0x41e0000000200000);
7393 TestUScvtfHelper(0x7ffffffffffffc00, 0x43dfffffffffffff, 0x43dfffffffffffff);
7395 TestUScvtfHelper(0x0123456789abcde0, 0x43723456789abcde, 0x43723456789abcde);
7396 TestUScvtfHelper(0x0000000012345678, 0x41b2345678000000, 0x41b2345678000000);
7400 TestUScvtfHelper(0xffffffffc0000000, 0xc1d0000000000000, 0x43effffffff80000);
7401 TestUScvtfHelper(0xffffffff00000000, 0xc1f0000000000000, 0x43efffffffe00000);
7402 TestUScvtfHelper(0xc000000000000000, 0xc3d0000000000000, 0x43e8000000000000);
7405 TestUScvtfHelper(0x1000000000000000, 0x43b0000000000000, 0x43b0000000000000);
7406 TestUScvtfHelper(0x1000000000000001, 0x43b0000000000000, 0x43b0000000000000);
7407 TestUScvtfHelper(0x1000000000000080, 0x43b0000000000000, 0x43b0000000000000);
7408 TestUScvtfHelper(0x1000000000000081, 0x43b0000000000001, 0x43b0000000000001);
7409 TestUScvtfHelper(0x1000000000000100, 0x43b0000000000001, 0x43b0000000000001);
7410 TestUScvtfHelper(0x1000000000000101, 0x43b0000000000001, 0x43b0000000000001);
7411 TestUScvtfHelper(0x1000000000000180, 0x43b0000000000002, 0x43b0000000000002);
7412 TestUScvtfHelper(0x1000000000000181, 0x43b0000000000002, 0x43b0000000000002);
7413 TestUScvtfHelper(0x1000000000000200, 0x43b0000000000002, 0x43b0000000000002);
7414 TestUScvtfHelper(0x1000000000000201, 0x43b0000000000002, 0x43b0000000000002);
7415 TestUScvtfHelper(0x1000000000000280, 0x43b0000000000002, 0x43b0000000000002);
7416 TestUScvtfHelper(0x1000000000000281, 0x43b0000000000003, 0x43b0000000000003);
7417 TestUScvtfHelper(0x1000000000000300, 0x43b0000000000003, 0x43b0000000000003);
7419 TestUScvtfHelper(0x8000000000000000, 0xc3e0000000000000, 0x43e0000000000000);
7420 TestUScvtfHelper(0x8000000000000001, 0xc3e0000000000000, 0x43e0000000000000);
7421 TestUScvtfHelper(0x8000000000000200, 0xc3e0000000000000, 0x43e0000000000000);
7422 TestUScvtfHelper(0x8000000000000201, 0xc3dfffffffffffff, 0x43e0000000000000);
7423 TestUScvtfHelper(0x8000000000000400, 0xc3dfffffffffffff, 0x43e0000000000000);
7424 TestUScvtfHelper(0x8000000000000401, 0xc3dfffffffffffff, 0x43e0000000000001);
7425 TestUScvtfHelper(0x8000000000000600, 0xc3dffffffffffffe, 0x43e0000000000001);
7426 TestUScvtfHelper(0x8000000000000601, 0xc3dffffffffffffe, 0x43e0000000000001);
7427 TestUScvtfHelper(0x8000000000000800, 0xc3dffffffffffffe, 0x43e0000000000001);
7428 TestUScvtfHelper(0x8000000000000801, 0xc3dffffffffffffe, 0x43e0000000000001);
7429 TestUScvtfHelper(0x8000000000000a00, 0xc3dffffffffffffe, 0x43e0000000000001);
7430 TestUScvtfHelper(0x8000000000000a01, 0xc3dffffffffffffd, 0x43e0000000000001);
7431 TestUScvtfHelper(0x8000000000000c00, 0xc3dffffffffffffd, 0x43e0000000000002);
7433 TestUScvtfHelper(0x7ffffffffffffe00, 0x43e0000000000000, 0x43e0000000000000);
7434 TestUScvtfHelper(0x7fffffffffffffff, 0x43e0000000000000, 0x43e0000000000000);
7435 TestUScvtfHelper(0xfffffffffffffc00, 0xc090000000000000, 0x43f0000000000000);
7436 TestUScvtfHelper(0xffffffffffffffff, 0xbff0000000000000, 0x43f0000000000000);
7441 static void TestUScvtf32Helper(uint64_t in,
7442 uint32_t expected_scvtf_bits,
7443 uint32_t expected_ucvtf_bits) {
7445 uint32_t u32 = u64 & 0xffffffff;
7446 int64_t s64 =
static_cast<int64_t
>(in);
7447 int32_t s32 = s64 & 0x7fffffff;
7449 bool cvtf_s32 = (s64 == s32);
7450 bool cvtf_u32 = (u64 == u32);
7452 float results_scvtf_x[65];
7453 float results_ucvtf_x[65];
7454 float results_scvtf_w[33];
7455 float results_ucvtf_w[33];
7460 __ Mov(x0, reinterpret_cast<int64_t>(results_scvtf_x));
7461 __ Mov(x1, reinterpret_cast<int64_t>(results_ucvtf_x));
7462 __ Mov(x2, reinterpret_cast<int64_t>(results_scvtf_w));
7463 __ Mov(x3, reinterpret_cast<int64_t>(results_ucvtf_w));
7469 __ Mov(x11, 0x5555555555555555);
7483 for (
int fbits = 1; fbits <= 32; fbits++) {
7484 __ Scvtf(
s0, x10, fbits);
7485 __ Ucvtf(
s1, x10, fbits);
7486 __ Scvtf(
s2, w11, fbits);
7487 __ Ucvtf(
s3, w11, fbits);
7496 for (
int fbits = 33; fbits <= 64; fbits++) {
7497 __ Scvtf(
s0, x10, fbits);
7498 __ Ucvtf(
s1, x10, fbits);
7507 float expected_scvtf_base = rawbits_to_float(expected_scvtf_bits);
7508 float expected_ucvtf_base = rawbits_to_float(expected_ucvtf_bits);
7510 for (
int fbits = 0; fbits <= 32; fbits++) {
7511 float expected_scvtf = expected_scvtf_base / powf(2, fbits);
7512 float expected_ucvtf = expected_ucvtf_base / powf(2, fbits);
7519 for (
int fbits = 33; fbits <= 64; fbits++) {
7521 float expected_scvtf = expected_scvtf_base / powf(2, fbits);
7522 float expected_ucvtf = expected_ucvtf_base / powf(2, fbits);
7536 TestUScvtf32Helper(0x0000000000000000, 0x00000000, 0x00000000);
7537 TestUScvtf32Helper(0x0000000000000001, 0x3f800000, 0x3f800000);
7538 TestUScvtf32Helper(0x0000000040000000, 0x4e800000, 0x4e800000);
7539 TestUScvtf32Helper(0x0000000100000000, 0x4f800000, 0x4f800000);
7540 TestUScvtf32Helper(0x4000000000000000, 0x5e800000, 0x5e800000);
7542 TestUScvtf32Helper(0x0000000000800001, 0x4b000001, 0x4b000001);
7543 TestUScvtf32Helper(0x4000008000000000, 0x5e800001, 0x5e800001);
7545 TestUScvtf32Helper(0x000000007fffff80, 0x4effffff, 0x4effffff);
7547 TestUScvtf32Helper(0x00000000ffffff00, 0x4f7fffff, 0x4f7fffff);
7548 TestUScvtf32Helper(0x0000000080000000, 0x4f000000, 0x4f000000);
7549 TestUScvtf32Helper(0x0000000080000100, 0x4f000001, 0x4f000001);
7551 TestUScvtf32Helper(0x7fffff8000000000, 0x5effffff, 0x5effffff);
7553 TestUScvtf32Helper(0x0000000000876543, 0x4b076543, 0x4b076543);
7557 TestUScvtf32Helper(0xfffffc0000000000, 0xd4800000, 0x5f7ffffc);
7558 TestUScvtf32Helper(0xc000000000000000, 0xde800000, 0x5f400000);
7561 TestUScvtf32Helper(0x0000800000000000, 0x57000000, 0x57000000);
7562 TestUScvtf32Helper(0x0000800000000001, 0x57000000, 0x57000000);
7563 TestUScvtf32Helper(0x0000800000800000, 0x57000000, 0x57000000);
7564 TestUScvtf32Helper(0x0000800000800001, 0x57000001, 0x57000001);
7565 TestUScvtf32Helper(0x0000800001000000, 0x57000001, 0x57000001);
7566 TestUScvtf32Helper(0x0000800001000001, 0x57000001, 0x57000001);
7567 TestUScvtf32Helper(0x0000800001800000, 0x57000002, 0x57000002);
7568 TestUScvtf32Helper(0x0000800001800001, 0x57000002, 0x57000002);
7569 TestUScvtf32Helper(0x0000800002000000, 0x57000002, 0x57000002);
7570 TestUScvtf32Helper(0x0000800002000001, 0x57000002, 0x57000002);
7571 TestUScvtf32Helper(0x0000800002800000, 0x57000002, 0x57000002);
7572 TestUScvtf32Helper(0x0000800002800001, 0x57000003, 0x57000003);
7573 TestUScvtf32Helper(0x0000800003000000, 0x57000003, 0x57000003);
7575 TestUScvtf32Helper(0x8000000000000000, 0xdf000000, 0x5f000000);
7576 TestUScvtf32Helper(0x8000000000000001, 0xdf000000, 0x5f000000);
7577 TestUScvtf32Helper(0x8000004000000000, 0xdf000000, 0x5f000000);
7578 TestUScvtf32Helper(0x8000004000000001, 0xdeffffff, 0x5f000000);
7579 TestUScvtf32Helper(0x8000008000000000, 0xdeffffff, 0x5f000000);
7580 TestUScvtf32Helper(0x8000008000000001, 0xdeffffff, 0x5f000001);
7581 TestUScvtf32Helper(0x800000c000000000, 0xdefffffe, 0x5f000001);
7582 TestUScvtf32Helper(0x800000c000000001, 0xdefffffe, 0x5f000001);
7583 TestUScvtf32Helper(0x8000010000000000, 0xdefffffe, 0x5f000001);
7584 TestUScvtf32Helper(0x8000010000000001, 0xdefffffe, 0x5f000001);
7585 TestUScvtf32Helper(0x8000014000000000, 0xdefffffe, 0x5f000001);
7586 TestUScvtf32Helper(0x8000014000000001, 0xdefffffd, 0x5f000001);
7587 TestUScvtf32Helper(0x8000018000000000, 0xdefffffd, 0x5f000002);
7589 TestUScvtf32Helper(0x000000007fffffc0, 0x4f000000, 0x4f000000);
7590 TestUScvtf32Helper(0x000000007fffffff, 0x4f000000, 0x4f000000);
7591 TestUScvtf32Helper(0x00000000ffffff80, 0x4f800000, 0x4f800000);
7592 TestUScvtf32Helper(0x00000000ffffffff, 0x4f800000, 0x4f800000);
7593 TestUScvtf32Helper(0x7fffffc000000000, 0x5f000000, 0x5f000000);
7594 TestUScvtf32Helper(0x7fffffffffffffff, 0x5f000000, 0x5f000000);
7595 TestUScvtf32Helper(0xffffff8000000000, 0xd3000000, 0x5f800000);
7596 TestUScvtf32Helper(0xffffffffffffffff, 0xbf800000, 0x5f800000);
7607 __ Mov(w2, 0x80000000);
7618 __ Adds(w0, w2, w2);
7643 const uint64_t fpcr_core = 0x07c00000;
7648 const uint64_t fpcr_all = fpcr_core | 0x00379f00;
7654 __ Mov(w1, 0x7fffffff);
7662 __ Cinc(x7, x7,
mi);
7663 __ Cinc(x7, x7,
ne);
7664 __ Cinc(x7, x7,
lo);
7665 __ Cinc(x7, x7,
vs);
7671 __ Cinc(x7, x7,
pl);
7672 __ Cinc(x7, x7,
eq);
7673 __ Cinc(x7, x7,
hs);
7674 __ Cinc(x7, x7,
vc);
7677 __ Mov(x8, fpcr_core);
7684 __ Mov(x9, fpcr_all);
7687 __ And(x9, x9, fpcr_core);
7693 __ Mov(x10, ~fpcr_all);
7740 uint64_t literal_base = 0x0100001000100101UL;
7742 __ Mov(x1, literal_base);
7743 for (
unsigned i = 2; i < x30.code(); i++) {
7750 __ add(xzr, x0, x1);
7751 __ add(xzr, x1, xzr);
7752 __ add(xzr, xzr, x1);
7754 __ and_(xzr, x0, x2);
7755 __ and_(xzr, x2, xzr);
7756 __ and_(xzr, xzr, x2);
7758 __ bic(xzr, x0, x3);
7759 __ bic(xzr, x3, xzr);
7760 __ bic(xzr, xzr, x3);
7762 __ eon(xzr, x0, x4);
7763 __ eon(xzr, x4, xzr);
7764 __ eon(xzr, xzr, x4);
7766 __ eor(xzr, x0, x5);
7767 __ eor(xzr, x5, xzr);
7768 __ eor(xzr, xzr, x5);
7770 __ orr(xzr, x0, x6);
7771 __ orr(xzr, x6, xzr);
7772 __ orr(xzr, xzr, x6);
7774 __ sub(xzr, x0, x7);
7775 __ sub(xzr, x7, xzr);
7776 __ sub(xzr, xzr, x7);
7786 __ Add(x29, x28, x1);
7807 uint64_t literal_base = 0x0100001000100101UL;
7809 __ Mov(x1, literal_base);
7810 for (
int i = 2; i < 30; i++) {
7819 __ adds(xzr, x1, 1234);
7820 __ adds(xzr, x0, x1);
7821 __ adds(xzr, x1, xzr);
7822 __ adds(xzr, xzr, x1);
7824 __ ands(xzr, x2, ~0xf);
7825 __ ands(xzr, xzr, ~0xf);
7826 __ ands(xzr, x0, x2);
7827 __ ands(xzr, x2, xzr);
7828 __ ands(xzr, xzr, x2);
7830 __ bics(xzr, x3, ~0xf);
7831 __ bics(xzr, xzr, ~0xf);
7832 __ bics(xzr, x0, x3);
7833 __ bics(xzr, x3, xzr);
7834 __ bics(xzr, xzr, x3);
7838 __ subs(xzr, x3, 1234);
7839 __ subs(xzr, x0, x3);
7840 __ subs(xzr, x3, xzr);
7841 __ subs(xzr, xzr, x3);
7851 __ Add(x29, x28, x1);
7867 CHECK(x0.Bit() == (1UL << 0));
7868 CHECK(x1.Bit() == (1UL << 1));
7869 CHECK(x10.Bit() == (1UL << 10));
7881 CHECK(csp.Bit() != xzr.Bit());
7884 CHECK(x0.Bit() == w0.Bit());
7885 CHECK(x1.Bit() == w1.Bit());
7886 CHECK(x10.Bit() == w10.Bit());
7887 CHECK(jssp.Bit() == wjssp.Bit());
7888 CHECK(xzr.Bit() == wzr.Bit());
7889 CHECK(csp.Bit() == wcsp.Bit());
7902 CHECK(csp.Is(
__ StackPointer()));
7903 __ SetStackPointer(x0);
7904 CHECK(x0.Is(
__ StackPointer()));
7905 __ SetStackPointer(jssp);
7906 CHECK(jssp.Is(
__ StackPointer()));
7907 __ SetStackPointer(csp);
7908 CHECK(csp.Is(
__ StackPointer()));
7921 static const RegList x0_to_x3 = x0.Bit() | x1.Bit() | x2.Bit() | x3.Bit();
7922 static const RegList x10_to_x13 = x10.Bit() | x11.Bit() |
7923 x12.Bit() | x13.Bit();
7930 uint64_t literal_base = 0x0100001000100101UL;
7933 __ Mov(x0, literal_base);
7993 uint64_t literal_base = 0x0100001000100101UL;
7996 __ Mov(x0, literal_base);
8073 uint64_t literal_base = 0x0100001000100101UL;
8076 __ Mov(x0, literal_base);
8098 uint64_t x0_expected = literal_base * 1;
8099 uint64_t x1_expected = literal_base * 2;
8100 uint64_t x4_expected = (x0_expected << 32) | (x0_expected >> 32);
8101 uint64_t x5_expected = ((x1_expected << 16) & 0xffff0000) |
8102 ((x1_expected >> 16) & 0x0000ffff);
8123 uint64_t literal_base = 0x0100001000100101UL;
8126 __ Mov(x0, literal_base);
8142 __ Mov(x4,
__ StackPointer());
8143 __ SetStackPointer(x4);
8156 __ Mov(csp,
__ StackPointer());
8157 __ SetStackPointer(csp);
8160 __ Pop(x0, x1, x2, x3);
8165 uint64_t x0_expected = literal_base * 1;
8166 uint64_t x1_expected = literal_base * 2;
8167 uint64_t x2_expected = literal_base * 3;
8168 uint64_t x3_expected = literal_base * 4;
8169 uint64_t x6_expected = (x1_expected << 32) | (x0_expected >> 32);
8170 uint64_t x7_expected = ((x1_expected << 16) & 0xffff0000) |
8171 ((x0_expected >> 48) & 0x0000ffff);
8197 static int const kPushPopJsspMaxRegCount = -1;
8208 static void PushPopJsspSimpleHelper(
int reg_count,
8220 static RegList const allowed = ~(x8.Bit() | x9.Bit() | jssp.Bit());
8221 if (reg_count == kPushPopJsspMaxRegCount) {
8235 uint64_t literal_base = 0x0100001000100101UL;
8239 __ Mov(jssp,
__ StackPointer());
8240 __ SetStackPointer(jssp);
8245 for (i = 0; i < reg_count; i++) {
8248 if (!x[i].IsZero()) {
8249 __ Mov(x[i], literal_base * i);
8256 switch (push_method) {
8259 for (i = reg_count; i >= 4; i -= 4) {
8260 __ Push(r[i-1], r[i-2], r[i-3], r[i-4]);
8264 case 3:
__ Push(r[2], r[1], r[0]);
break;
8265 case 2:
__ Push(r[1], r[0]);
break;
8266 case 1:
__ Push(r[0]);
break;
8267 default:
ASSERT(i == 0);
break;
8271 __ PushSizeRegList(list, reg_size);
8278 switch (pop_method) {
8281 for (i = 0; i <= (reg_count-4); i += 4) {
8282 __ Pop(r[i], r[i+1], r[i+2], r[i+3]);
8285 switch (reg_count - i) {
8286 case 3:
__ Pop(r[i], r[i+1], r[i+2]);
break;
8287 case 2:
__ Pop(r[i], r[i+1]);
break;
8288 case 1:
__ Pop(r[i]);
break;
8289 default:
ASSERT(i == reg_count);
break;
8293 __ PopSizeRegList(list, reg_size);
8300 __ Mov(csp,
__ StackPointer());
8301 __ SetStackPointer(csp);
8311 literal_base &= (0xffffffffffffffffUL >> (64-reg_size));
8312 for (
int i = 0; i < reg_count; i++) {
8313 if (x[i].IsZero()) {
8326 for (
int claim = 0; claim <= 8; claim++) {
8327 for (
int count = 0; count <= 8; count++) {
8338 PushPopJsspSimpleHelper(kPushPopJsspMaxRegCount, claim,
kWRegSizeInBits,
8340 PushPopJsspSimpleHelper(kPushPopJsspMaxRegCount, claim,
kWRegSizeInBits,
8342 PushPopJsspSimpleHelper(kPushPopJsspMaxRegCount, claim,
kWRegSizeInBits,
8344 PushPopJsspSimpleHelper(kPushPopJsspMaxRegCount, claim,
kWRegSizeInBits,
8352 for (
int claim = 0; claim <= 8; claim++) {
8353 for (
int count = 0; count <= 8; count++) {
8364 PushPopJsspSimpleHelper(kPushPopJsspMaxRegCount, claim,
kXRegSizeInBits,
8366 PushPopJsspSimpleHelper(kPushPopJsspMaxRegCount, claim,
kXRegSizeInBits,
8368 PushPopJsspSimpleHelper(kPushPopJsspMaxRegCount, claim,
kXRegSizeInBits,
8370 PushPopJsspSimpleHelper(kPushPopJsspMaxRegCount, claim,
kXRegSizeInBits,
8378 static int const kPushPopFPJsspMaxRegCount = -1;
8389 static void PushPopFPJsspSimpleHelper(
int reg_count,
8400 static RegList const allowed = ~0;
8401 if (reg_count == kPushPopFPJsspMaxRegCount) {
8417 uint64_t literal_base = 0x0100001000100101UL;
8421 __ Mov(jssp,
__ StackPointer());
8422 __ SetStackPointer(jssp);
8428 __ Mov(x1, literal_base);
8429 for (i = 0; i < reg_count; i++) {
8440 switch (push_method) {
8443 for (i = reg_count; i >= 4; i -= 4) {
8444 __ Push(v[i-1], v[i-2], v[i-3], v[i-4]);
8448 case 3:
__ Push(v[2], v[1], v[0]);
break;
8449 case 2:
__ Push(v[1], v[0]);
break;
8450 case 1:
__ Push(v[0]);
break;
8451 default:
ASSERT(i == 0);
break;
8462 switch (pop_method) {
8465 for (i = 0; i <= (reg_count-4); i += 4) {
8466 __ Pop(v[i], v[i+1], v[i+2], v[i+3]);
8469 switch (reg_count - i) {
8470 case 3:
__ Pop(v[i], v[i+1], v[i+2]);
break;
8471 case 2:
__ Pop(v[i], v[i+1]);
break;
8472 case 1:
__ Pop(v[i]);
break;
8473 default:
ASSERT(i == reg_count);
break;
8484 __ Mov(csp,
__ StackPointer());
8485 __ SetStackPointer(csp);
8495 literal_base &= (0xffffffffffffffffUL >> (64-reg_size));
8496 for (
int i = 0; i < reg_count; i++) {
8497 uint64_t literal = literal_base * i;
8499 memcpy(&expected, &literal,
sizeof(expected));
8509 for (
int claim = 0; claim <= 8; claim++) {
8510 for (
int count = 0; count <= 8; count++) {
8521 PushPopFPJsspSimpleHelper(kPushPopFPJsspMaxRegCount, claim,
kSRegSizeInBits,
8523 PushPopFPJsspSimpleHelper(kPushPopFPJsspMaxRegCount, claim,
kSRegSizeInBits,
8525 PushPopFPJsspSimpleHelper(kPushPopFPJsspMaxRegCount, claim,
kSRegSizeInBits,
8527 PushPopFPJsspSimpleHelper(kPushPopFPJsspMaxRegCount, claim,
kSRegSizeInBits,
8535 for (
int claim = 0; claim <= 8; claim++) {
8536 for (
int count = 0; count <= 8; count++) {
8547 PushPopFPJsspSimpleHelper(kPushPopFPJsspMaxRegCount, claim,
kDRegSizeInBits,
8549 PushPopFPJsspSimpleHelper(kPushPopFPJsspMaxRegCount, claim,
kDRegSizeInBits,
8551 PushPopFPJsspSimpleHelper(kPushPopFPJsspMaxRegCount, claim,
kDRegSizeInBits,
8553 PushPopFPJsspSimpleHelper(kPushPopFPJsspMaxRegCount, claim,
kDRegSizeInBits,
8561 static void PushPopJsspMixedMethodsHelper(
int claim,
int reg_size) {
8567 static RegList const allowed =
8568 ~(x8.Bit() | x9.Bit() | jssp.Bit() | xzr.Bit());
8576 for (
int i = 0; i <= 3; i++) {
8577 r0_to_r3 |= x[i].
Bit();
8580 for (
int i = 4; i <= 5; i++) {
8581 r4_to_r5 |= x[i].
Bit();
8584 for (
int i = 6; i <= 9; i++) {
8585 r6_to_r9 |= x[i].
Bit();
8593 uint64_t literal_base = 0x0100001000100101UL;
8598 __ Mov(jssp,
__ StackPointer());
8599 __ SetStackPointer(jssp);
8604 __ Mov(x[3], literal_base * 3);
8605 __ Mov(x[2], literal_base * 2);
8606 __ Mov(x[1], literal_base * 1);
8607 __ Mov(x[0], literal_base * 0);
8609 __ PushSizeRegList(r0_to_r3, reg_size);
8610 __ Push(r[3], r[2]);
8613 __ PopSizeRegList(r0_to_r3, reg_size);
8615 __ Push(r[2], r[1], r[3], r[0]);
8620 __ Pop(r[6], r[7], r[8], r[9]);
8625 __ Mov(csp,
__ StackPointer());
8626 __ SetStackPointer(csp);
8635 literal_base &= (0xffffffffffffffffUL >> (64-reg_size));
8648 TEST(push_pop_jssp_mixed_methods_64) {
8650 for (
int claim = 0; claim <= 8; claim++) {
8656 TEST(push_pop_jssp_mixed_methods_32) {
8658 for (
int claim = 0; claim <= 8; claim++) {
8665 static void PushPopJsspWXOverlapHelper(
int reg_count,
int claim) {
8671 static RegList const allowed = ~(tmp.
Bit() | jssp.Bit());
8672 if (reg_count == kPushPopJsspMaxRegCount) {
8681 int const requested_w_slots = reg_count + reg_count / 2;
8685 uint32_t stack[kMaxWSlots];
8686 for (
int i = 0; i < kMaxWSlots; i++) {
8687 stack[i] = 0xdeadbeef;
8695 static uint64_t
const literal_base = 0x0100001000100101UL;
8696 static uint64_t
const literal_base_hi = literal_base >> 32;
8697 static uint64_t
const literal_base_lo = literal_base & 0xffffffff;
8698 static uint64_t
const literal_base_w = literal_base & 0xffffffff;
8703 __ Mov(jssp,
__ StackPointer());
8704 __ SetStackPointer(jssp);
8707 for (
int i = 0; i < reg_count; i++) {
8710 if (!x[i].IsZero()) {
8711 __ Mov(x[i], literal_base * i);
8748 int active_w_slots = 0;
8749 for (
int i = 0; active_w_slots < requested_w_slots; i++) {
8754 int times = i % 4 + 1;
8758 __ PushMultipleTimes(w[i], times);
8761 __ Mov(tmp.
W(), times);
8762 __ PushMultipleTimes(w[i], tmp.
W());
8765 for (
int j = 0; j < times; j++) {
8768 stack[active_w_slots++] = 0;
8770 stack[active_w_slots++] = literal_base_w * i;
8776 __ PushMultipleTimes(x[i], times);
8780 __ PushMultipleTimes(x[i], tmp);
8783 for (
int j = 0; j < times; j++) {
8784 if (x[i].IsZero()) {
8786 stack[active_w_slots++] = 0;
8787 stack[active_w_slots++] = 0;
8789 stack[active_w_slots++] = literal_base_hi * i;
8790 stack[active_w_slots++] = literal_base_lo * i;
8797 if (active_w_slots > requested_w_slots) {
8798 __ Drop(active_w_slots - requested_w_slots,
kWRegSize);
8802 stack[active_w_slots--] = 0xdeadbeef;
8803 }
while (active_w_slots > requested_w_slots);
8812 bool next_is_64 = !(reg_count & 1);
8813 for (
int i = reg_count-1; i >= 0; i--) {
8816 active_w_slots -= 2;
8819 active_w_slots -= 1;
8821 next_is_64 = !next_is_64;
8823 ASSERT(active_w_slots == 0);
8828 __ Mov(csp,
__ StackPointer());
8829 __ SetStackPointer(csp);
8837 for (
int i = 0; i < reg_count; i++) {
8840 bool expect_64 = (i & 1);
8844 uint64_t
hi = stack[slot++];
8845 uint64_t
lo = stack[slot++];
8846 expected = (hi << 32) | lo;
8848 expected = stack[slot++];
8853 if (x[i].IsZero()) {
8859 ASSERT(slot == requested_w_slots);
8867 for (
int claim = 0; claim <= 8; claim++) {
8868 for (
int count = 1; count <= 8; count++) {
8869 PushPopJsspWXOverlapHelper(count, claim);
8870 PushPopJsspWXOverlapHelper(count, claim);
8871 PushPopJsspWXOverlapHelper(count, claim);
8872 PushPopJsspWXOverlapHelper(count, claim);
8875 PushPopJsspWXOverlapHelper(kPushPopJsspMaxRegCount, claim);
8876 PushPopJsspWXOverlapHelper(kPushPopJsspMaxRegCount, claim);
8877 PushPopJsspWXOverlapHelper(kPushPopJsspMaxRegCount, claim);
8878 PushPopJsspWXOverlapHelper(kPushPopJsspMaxRegCount, claim);
8891 __ Mov(x3, 0x3333333333333333UL);
8892 __ Mov(x2, 0x2222222222222222UL);
8893 __ Mov(x1, 0x1111111111111111UL);
8894 __ Mov(x0, 0x0000000000000000UL);
8896 __ PushXRegList(x0.Bit() | x1.Bit() | x2.Bit() | x3.Bit());
8898 __ PopXRegList(x0.Bit() | x1.Bit() | x2.Bit() | x3.Bit());
8899 __ Push(x2, x1, x3, x0);
8901 __ Pop(x6, x7, x8, x9);
8904 __ PushWRegList(w0.Bit() | w1.Bit() | w2.Bit() | w3.Bit());
8905 __ Push(w3, w1, w2, w0);
8906 __ PopWRegList(w10.Bit() | w11.Bit() | w12.Bit() | w13.Bit());
8907 __ Pop(w14, w15, w16, w17);
8910 __ Push(w2, w2, w1, w1);
8912 __ Pop(w18, w19, w20, w21);
8916 __ PushXRegList(x1.Bit() | x22.Bit());
8917 __ PopXRegList(x24.Bit() | x26.Bit());
8920 __ PushWRegList(w1.Bit() | w2.Bit() | w4.Bit() | w22.Bit());
8921 __ PopWRegList(w25.Bit() | w27.Bit() | w28.Bit() | w29.Bit());
8926 __ PushXRegList(0xffffffff);
8927 __ PopXRegList(0xffffffff);
8979 __ Mov(jssp,
__ StackPointer());
8980 __ SetStackPointer(jssp);
8999 __ Mov(x0, 0x1234000000000000);
9000 __ Mov(x1, 0x1234000100010001);
9001 __ Mov(x2, 0x1234000200020002);
9002 __ Mov(x3, 0x1234000300030003);
9003 __ Mov(w4, 0x12340004);
9004 __ Mov(w5, 0x12340005);
9005 __ Mov(w6, 0x12340006);
9006 __ Fmov(
d0, 123400.0);
9007 __ Fmov(
d1, 123401.0);
9008 __ Fmov(
s2, 123402.0);
9020 __ Pop(x3, x2, x1, x0);
9022 __ Mov(csp,
__ StackPointer());
9023 __ SetStackPointer(csp);
9054 __ Mov(jssp,
__ StackPointer());
9055 __ SetStackPointer(jssp);
9059 __ Mov(x0, 0x1234000000000000);
9060 __ Mov(x1, 0x1234000100010001);
9061 __ Mov(x2, 0x1234000200020002);
9062 __ Mov(x3, 0x1234000300030003);
9063 __ Mov(w4, 0x12340004);
9064 __ Mov(w5, 0x12340005);
9065 __ Mov(w6, 0x12340006);
9066 __ Fmov(
d0, 123400.0);
9067 __ Fmov(
d1, 123401.0);
9068 __ Fmov(
s2, 123402.0);
9071 __ Push(x0, x1, x2, x3);
9072 __ Push(w4, w5, w6);
9097 __ Mov(csp,
__ StackPointer());
9098 __ SetStackPointer(csp);
9126 Label cond_pass_00, cond_pass_01, cond_pass_10, cond_pass_11;
9127 Label cond_fail_00, cond_fail_01, cond_fail_10, cond_fail_11;
9128 Label return1, return2, return3, done;
9132 __ Mov(x0, 0x5555555500000001UL);
9133 __ Mov(x1, 0xaaaaaaaa00000001UL);
9134 __ Mov(x2, 0x1234567800000000UL);
9135 __ Mov(x3, 0x8765432100000000UL);
9141 __ JumpIfBothSmi(x0, x1, &cond_pass_00, &cond_fail_00);
9143 __ JumpIfBothSmi(x0, x2, &cond_pass_01, &cond_fail_01);
9145 __ JumpIfBothSmi(x2, x1, &cond_pass_10, &cond_fail_10);
9147 __ JumpIfBothSmi(x2, x3, &cond_pass_11, &cond_fail_11);
9149 __ Bind(&cond_fail_00);
9152 __ Bind(&cond_pass_00);
9156 __ Bind(&cond_fail_01);
9159 __ Bind(&cond_pass_01);
9163 __ Bind(&cond_fail_10);
9166 __ Bind(&cond_pass_10);
9170 __ Bind(&cond_fail_11);
9173 __ Bind(&cond_pass_11);
9199 Label cond_pass_00, cond_pass_01, cond_pass_10, cond_pass_11;
9200 Label cond_fail_00, cond_fail_01, cond_fail_10, cond_fail_11;
9201 Label return1, return2, return3, done;
9205 __ Mov(x0, 0x5555555500000001UL);
9206 __ Mov(x1, 0xaaaaaaaa00000001UL);
9207 __ Mov(x2, 0x1234567800000000UL);
9208 __ Mov(x3, 0x8765432100000000UL);
9214 __ JumpIfEitherSmi(x0, x1, &cond_pass_00, &cond_fail_00);
9216 __ JumpIfEitherSmi(x0, x2, &cond_pass_01, &cond_fail_01);
9218 __ JumpIfEitherSmi(x2, x1, &cond_pass_10, &cond_fail_10);
9220 __ JumpIfEitherSmi(x2, x3, &cond_pass_11, &cond_fail_11);
9222 __ Bind(&cond_fail_00);
9225 __ Bind(&cond_pass_00);
9229 __ Bind(&cond_fail_01);
9232 __ Bind(&cond_pass_01);
9236 __ Bind(&cond_fail_10);
9239 __ Bind(&cond_pass_10);
9243 __ Bind(&cond_fail_11);
9246 __ Bind(&cond_pass_11);
9271 CHECK(NoReg.Is(NoFPReg));
9272 CHECK(NoFPReg.Is(NoReg));
9273 CHECK(NoReg.Is(NoCPUReg));
9274 CHECK(NoCPUReg.Is(NoReg));
9275 CHECK(NoFPReg.Is(NoCPUReg));
9276 CHECK(NoCPUReg.Is(NoFPReg));
9278 CHECK(NoReg.IsNone());
9279 CHECK(NoFPReg.IsNone());
9280 CHECK(NoCPUReg.IsNone());
9287 CHECK(!NoReg.IsValid());
9288 CHECK(!NoFPReg.IsValid());
9289 CHECK(!NoCPUReg.IsValid());
9291 CHECK(x0.IsValid());
9292 CHECK(w0.IsValid());
9293 CHECK(x30.IsValid());
9294 CHECK(w30.IsValid());
9295 CHECK(xzr.IsValid());
9296 CHECK(wzr.IsValid());
9298 CHECK(csp.IsValid());
9299 CHECK(wcsp.IsValid());
9306 CHECK(x0.IsValidRegister());
9307 CHECK(w0.IsValidRegister());
9308 CHECK(xzr.IsValidRegister());
9309 CHECK(wzr.IsValidRegister());
9310 CHECK(csp.IsValidRegister());
9311 CHECK(wcsp.IsValidRegister());
9312 CHECK(!x0.IsValidFPRegister());
9313 CHECK(!w0.IsValidFPRegister());
9314 CHECK(!xzr.IsValidFPRegister());
9315 CHECK(!wzr.IsValidFPRegister());
9316 CHECK(!csp.IsValidFPRegister());
9317 CHECK(!wcsp.IsValidFPRegister());
9319 CHECK(
d0.IsValidFPRegister());
9320 CHECK(
s0.IsValidFPRegister());
9326 CHECK(static_cast<CPURegister>(x0).IsValid());
9327 CHECK(static_cast<CPURegister>(w0).IsValid());
9328 CHECK(static_cast<CPURegister>(x30).IsValid());
9329 CHECK(static_cast<CPURegister>(w30).IsValid());
9330 CHECK(static_cast<CPURegister>(xzr).IsValid());
9331 CHECK(static_cast<CPURegister>(wzr).IsValid());
9333 CHECK(static_cast<CPURegister>(csp).IsValid());
9334 CHECK(static_cast<CPURegister>(wcsp).IsValid());
9336 CHECK(static_cast<CPURegister>(
d0).IsValid());
9337 CHECK(static_cast<CPURegister>(
s0).IsValid());
9338 CHECK(static_cast<CPURegister>(
d31).IsValid());
9339 CHECK(static_cast<CPURegister>(
s31).IsValid());
9341 CHECK(static_cast<CPURegister>(x0).IsValidRegister());
9342 CHECK(static_cast<CPURegister>(w0).IsValidRegister());
9343 CHECK(static_cast<CPURegister>(xzr).IsValidRegister());
9344 CHECK(static_cast<CPURegister>(wzr).IsValidRegister());
9345 CHECK(static_cast<CPURegister>(csp).IsValidRegister());
9346 CHECK(static_cast<CPURegister>(wcsp).IsValidRegister());
9347 CHECK(!static_cast<CPURegister>(x0).IsValidFPRegister());
9348 CHECK(!static_cast<CPURegister>(w0).IsValidFPRegister());
9349 CHECK(!static_cast<CPURegister>(xzr).IsValidFPRegister());
9350 CHECK(!static_cast<CPURegister>(wzr).IsValidFPRegister());
9351 CHECK(!static_cast<CPURegister>(csp).IsValidFPRegister());
9352 CHECK(!static_cast<CPURegister>(wcsp).IsValidFPRegister());
9354 CHECK(static_cast<CPURegister>(
d0).IsValidFPRegister());
9355 CHECK(static_cast<CPURegister>(
s0).IsValidFPRegister());
9356 CHECK(!static_cast<CPURegister>(
d0).IsValidRegister());
9357 CHECK(!static_cast<CPURegister>(
s0).IsValidRegister());
9616 char const * test_plain_string =
"Printf with no arguments.\n";
9617 char const * test_substring =
"'This is a substring.'";
9623 __ Mov(x29,
__ StackPointer());
9633 __ Mov(x2, reinterpret_cast<uintptr_t>(test_substring));
9636 __ Mov(w3, 0xffffffff);
9637 __ Mov(w4, 0xffffffff);
9638 __ Mov(x5, 0xffffffffffffffff);
9639 __ Mov(x6, 0xffffffffffffffff);
9646 __ Mov(x28, 0x123456789abcdef);
9661 __ orr(x8, xzr, 0x8888888888888888);
9662 __ orr(x9, xzr, 0x9999999999999999);
9668 __ Printf(test_plain_string);
9669 __ Printf(
"x0: %" PRId64
", x1: 0x%08" PRIx64
"\n", x0, x1);
9670 __ Printf(
"d0: %f\n",
d0);
9671 __ Printf(
"Test %%s: %s\n", x2);
9672 __ Printf(
"w3(uint32): %" PRIu32
"\nw4(int32): %" PRId32
"\n"
9673 "x5(uint64): %" PRIu64
"\nx6(int64): %" PRId64
"\n",
9675 __ Printf(
"%%f: %f\n%%g: %g\n%%e: %e\n%%E: %E\n",
s1,
s2,
d3,
d4);
9676 __ Printf(
"0x%08" PRIx32
", 0x%016" PRIx64
"\n", x28, x28);
9677 __ Printf(
"%g\n",
d10);
9680 const Register old_stack_pointer =
__ StackPointer();
9681 __ mov(x29, old_stack_pointer);
9682 __ SetStackPointer(x29);
9683 __ Printf(
"old_stack_pointer: 0x%016" PRIx64
"\n", old_stack_pointer);
9684 __ mov(old_stack_pointer,
__ StackPointer());
9685 __ SetStackPointer(old_stack_pointer);
9687 __ Printf(
"3=%u, 4=%u, 5=%u\n", x10, x11, x12);
9707 char const * test_plain_string =
"Printf with no arguments.\n";
9708 char const * test_substring =
"'This is a substring.'";
9710 __ PrintfNoPreserve(test_plain_string);
9716 __ PrintfNoPreserve(
"x0: %" PRId64
", x1: 0x%08" PRIx64
"\n", x0, x1);
9721 __ PrintfNoPreserve(
"d0: %f\n",
d0);
9725 __ Mov(x2, reinterpret_cast<uintptr_t>(test_substring));
9726 __ PrintfNoPreserve(
"Test %%s: %s\n", x2);
9730 __ Mov(w3, 0xffffffff);
9731 __ Mov(w4, 0xffffffff);
9732 __ Mov(x5, 0xffffffffffffffff);
9733 __ Mov(x6, 0xffffffffffffffff);
9734 __ PrintfNoPreserve(
"w3(uint32): %" PRIu32
"\nw4(int32): %" PRId32
"\n"
9735 "x5(uint64): %" PRIu64
"\nx6(int64): %" PRId64
"\n",
9743 __ PrintfNoPreserve(
"%%f: %f\n%%g: %g\n%%e: %e\n%%E: %E\n",
s1,
s2,
d3,
d4);
9747 __ Mov(x28, 0x123456789abcdef);
9748 __ PrintfNoPreserve(
"0x%08" PRIx32
", 0x%016" PRIx64
"\n", x28, x28);
9752 __ PrintfNoPreserve(
"%g\n",
d10);
9756 const Register old_stack_pointer =
__ StackPointer();
9757 __ Mov(x29, old_stack_pointer);
9758 __ SetStackPointer(x29);
9760 __ PrintfNoPreserve(
"old_stack_pointer: 0x%016" PRIx64
"\n",
9764 __ Mov(old_stack_pointer,
__ StackPointer());
9765 __ SetStackPointer(old_stack_pointer);
9771 __ PrintfNoPreserve(
"3=%u, 4=%u, 5=%u\n", x3, x4, x5);
9814 static void CopyFieldsHelper(
CPURegList temps) {
9815 static const uint64_t kLiteralBase = 0x0100001000100101UL;
9816 static const uint64_t src[] = {kLiteralBase * 1,
9827 static const uint64_t src_tagged =
9830 static const unsigned kTestCount =
sizeof(src) /
sizeof(src[0]) + 1;
9831 uint64_t* dst[kTestCount];
9832 uint64_t dst_tagged[kTestCount];
9841 for (
unsigned i = 1; i < kTestCount; i++) {
9842 dst[i] =
new uint64_t[i];
9843 memset(dst[i], 0, i *
sizeof(kLiteralBase));
9844 dst_tagged[i] =
reinterpret_cast<uint64_t
>(dst[i]) +
kHeapObjectTag;
9850 __ Mov(x0, dst_tagged[0]);
9852 __ CopyFields(x0, x1, temps, 0);
9853 for (
unsigned i = 1; i < kTestCount; i++) {
9854 __ Mov(x0, dst_tagged[i]);
9855 __ Mov(x1, src_tagged);
9856 __ CopyFields(x0, x1, temps, i);
9863 for (
unsigned i = 1; i < kTestCount; i++) {
9864 for (
unsigned j = 0; j < i; j++) {
9865 CHECK(src[j] == dst[i][j]);
9878 CopyFieldsHelper(
CPURegList(x10, x11, x12, x13));
9882 static void DoSmiAbsTest(
int32_t value,
bool must_fail =
false) {
9887 __ Mov(x2, 0xc001c0de);
9890 __ SmiAbs(x1, &slow);
9907 int32_t result = (value >= 0) ? value : -value;
9922 DoSmiAbsTest(0x12345);
9923 DoSmiAbsTest(0x40000000);
9924 DoSmiAbsTest(0x7fffffff);
9926 DoSmiAbsTest(-12345);
9927 DoSmiAbsTest(0x80000001);
9930 DoSmiAbsTest(0x80000000,
true);
9944 __ Adr(
lr, &target);
9947 __ Mov(x0, 0xdeadbeef);
9951 __ Mov(x0, 0xc001c0de);
10027 double sn = rawbits_to_double(0x7ff5555511111111);
10028 double qn = rawbits_to_double(0x7ffaaaaa11111111);
10033 double sn_proc = rawbits_to_double(0x7ffd555511111111);
10034 double qn_proc = qn;
10073 uint64_t qn_raw = double_to_rawbits(qn);
10074 uint64_t sn_raw = double_to_rawbits(sn);
10103 float sn = rawbits_to_float(0x7f951111);
10104 float qn = rawbits_to_float(0x7fea1111);
10109 float sn_proc = rawbits_to_float(0x7fd51111);
10110 float qn_proc = qn;
10149 uint32_t qn_raw = float_to_rawbits(qn);
10150 uint32_t sn_raw = float_to_rawbits(sn);
10176 static void ProcessNaNsHelper(
double n,
double m,
double expected) {
10212 double sn = rawbits_to_double(0x7ff5555511111111);
10213 double sm = rawbits_to_double(0x7ff5555522222222);
10214 double qn = rawbits_to_double(0x7ffaaaaa11111111);
10215 double qm = rawbits_to_double(0x7ffaaaaa22222222);
10222 double sn_proc = rawbits_to_double(0x7ffd555511111111);
10223 double sm_proc = rawbits_to_double(0x7ffd555522222222);
10224 double qn_proc = qn;
10225 double qm_proc = qm;
10232 ProcessNaNsHelper(qn, 0, qn_proc);
10233 ProcessNaNsHelper(0, qm, qm_proc);
10234 ProcessNaNsHelper(qn, qm, qn_proc);
10237 ProcessNaNsHelper(sn, 0, sn_proc);
10238 ProcessNaNsHelper(0, sm, sm_proc);
10239 ProcessNaNsHelper(sn, sm, sn_proc);
10242 ProcessNaNsHelper(sn, qm, sn_proc);
10243 ProcessNaNsHelper(qn, sm, sm_proc);
10244 ProcessNaNsHelper(sn, sm, sn_proc);
10248 static void ProcessNaNsHelper(
float n,
float m,
float expected) {
10284 float sn = rawbits_to_float(0x7f951111);
10285 float sm = rawbits_to_float(0x7f952222);
10286 float qn = rawbits_to_float(0x7fea1111);
10287 float qm = rawbits_to_float(0x7fea2222);
10294 float sn_proc = rawbits_to_float(0x7fd51111);
10295 float sm_proc = rawbits_to_float(0x7fd52222);
10296 float qn_proc = qn;
10297 float qm_proc = qm;
10304 ProcessNaNsHelper(qn, 0, qn_proc);
10305 ProcessNaNsHelper(0, qm, qm_proc);
10306 ProcessNaNsHelper(qn, qm, qn_proc);
10309 ProcessNaNsHelper(sn, 0, sn_proc);
10310 ProcessNaNsHelper(0, sm, sm_proc);
10311 ProcessNaNsHelper(sn, sm, sn_proc);
10314 ProcessNaNsHelper(sn, qm, sn_proc);
10315 ProcessNaNsHelper(qn, sm, sm_proc);
10316 ProcessNaNsHelper(sn, sm, sn_proc);
10320 static void DefaultNaNHelper(
float n,
float m,
float a) {
10331 __ Orr(x1, x0, DN_mask);
10377 uint32_t n_raw = float_to_rawbits(n);
10408 float sn = rawbits_to_float(0x7f951111);
10409 float sm = rawbits_to_float(0x7f952222);
10410 float sa = rawbits_to_float(0x7f95aaaa);
10411 float qn = rawbits_to_float(0x7fea1111);
10412 float qm = rawbits_to_float(0x7fea2222);
10413 float qa = rawbits_to_float(0x7feaaaaa);
10422 DefaultNaNHelper(sn, 0.0f, 0.0f);
10423 DefaultNaNHelper(0.0f, sm, 0.0f);
10424 DefaultNaNHelper(0.0f, 0.0f, sa);
10425 DefaultNaNHelper(sn, sm, 0.0f);
10426 DefaultNaNHelper(0.0f, sm, sa);
10427 DefaultNaNHelper(sn, 0.0f, sa);
10428 DefaultNaNHelper(sn, sm, sa);
10430 DefaultNaNHelper(qn, 0.0f, 0.0f);
10431 DefaultNaNHelper(0.0f, qm, 0.0f);
10432 DefaultNaNHelper(0.0f, 0.0f, qa);
10433 DefaultNaNHelper(qn, qm, 0.0f);
10434 DefaultNaNHelper(0.0f, qm, qa);
10435 DefaultNaNHelper(qn, 0.0f, qa);
10436 DefaultNaNHelper(qn, qm, qa);
10438 DefaultNaNHelper(qn, sm, sa);
10439 DefaultNaNHelper(sn, qm, sa);
10440 DefaultNaNHelper(sn, sm, qa);
10441 DefaultNaNHelper(qn, qm, sa);
10442 DefaultNaNHelper(sn, qm, qa);
10443 DefaultNaNHelper(qn, sm, qa);
10444 DefaultNaNHelper(qn, qm, qa);
10448 static void DefaultNaNHelper(
double n,
double m,
double a) {
10459 __ Orr(x1, x0, DN_mask);
10505 uint64_t n_raw = double_to_rawbits(n);
10536 double sn = rawbits_to_double(0x7ff5555511111111);
10537 double sm = rawbits_to_double(0x7ff5555522222222);
10538 double sa = rawbits_to_double(0x7ff55555aaaaaaaa);
10539 double qn = rawbits_to_double(0x7ffaaaaa11111111);
10540 double qm = rawbits_to_double(0x7ffaaaaa22222222);
10541 double qa = rawbits_to_double(0x7ffaaaaaaaaaaaaa);
10550 DefaultNaNHelper(sn, 0.0, 0.0);
10551 DefaultNaNHelper(0.0, sm, 0.0);
10552 DefaultNaNHelper(0.0, 0.0, sa);
10553 DefaultNaNHelper(sn, sm, 0.0);
10554 DefaultNaNHelper(0.0, sm, sa);
10555 DefaultNaNHelper(sn, 0.0, sa);
10556 DefaultNaNHelper(sn, sm, sa);
10558 DefaultNaNHelper(qn, 0.0, 0.0);
10559 DefaultNaNHelper(0.0, qm, 0.0);
10560 DefaultNaNHelper(0.0, 0.0, qa);
10561 DefaultNaNHelper(qn, qm, 0.0);
10562 DefaultNaNHelper(0.0, qm, qa);
10563 DefaultNaNHelper(qn, 0.0, qa);
10564 DefaultNaNHelper(qn, qm, qa);
10566 DefaultNaNHelper(qn, sm, sa);
10567 DefaultNaNHelper(sn, qm, sa);
10568 DefaultNaNHelper(sn, sm, qa);
10569 DefaultNaNHelper(qn, qm, sa);
10570 DefaultNaNHelper(sn, qm, qa);
10571 DefaultNaNHelper(qn, sm, qa);
10572 DefaultNaNHelper(qn, qm, qa);
10590 __ Bind(&
function);
10599 call_start = buf +
__ pc_offset();
10600 __ Call(buf +
function.pos(), RelocInfo::NONE64);
10601 return_address = buf +
__ pc_offset();
10614 CHECK(return_address ==
10621 static void AbsHelperX(int64_t value) {
10634 expected = labs(value);
10639 __ Abs(x11, x1, &fail);
10640 __ Abs(x12, x1, &fail, &next);
10652 __ Abs(x12, x1, &next, &fail);
10654 __ Abs(x13, x1, &done);
10676 static void AbsHelperW(
int32_t value) {
10688 __ Mov(w1, static_cast<uint32_t>(value));
10691 expected = abs(value);
10696 __ Abs(w11, w1, &fail);
10697 __ Abs(w12, w1, &fail, &next);
10709 __ Abs(w12, w1, &next, &fail);
10711 __ Abs(w13, w1, &done);
10759 const unsigned constant_pool_size = 312;
10760 const unsigned veneer_pool_size = 184;
10762 __ RecordConstPool(constant_pool_size);
10763 for (
unsigned i = 0; i < constant_pool_size / 4; ++i) {
10767 __ RecordVeneerPool(masm.pc_offset(), veneer_pool_size);
10774 Heap* heap = isolate->heap();
10778 masm.GetCode(&desc);
10779 MaybeObject* maybe_code = heap->
CreateCode(desc, 0, masm.CodeObject());
10780 maybe_code->ToObject(&code_object);
10783 unsigned pool_count = 0;
10784 int pool_mask = RelocInfo::ModeMask(RelocInfo::CONST_POOL) |
10785 RelocInfo::ModeMask(RelocInfo::VENEER_POOL);
10787 RelocInfo*
info = it.rinfo();
10788 if (RelocInfo::IsConstPool(info->rmode())) {
10789 ASSERT(info->data() == constant_pool_size);
10792 if (RelocInfo::IsVeneerPool(info->rmode())) {
10793 ASSERT(info->data() == veneer_pool_size);
10798 ASSERT(pool_count == 2);
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter NULL
#define CHECK_EQ(expected, value)
const int64_t kDQuietNanMask
const LowDwVfpRegister d11
const LowDwVfpRegister d0
const unsigned kDRegSizeInBits
#define ASSERT_LITERAL_POOL_SIZE(expected)
void Dump(MacroAssembler *assm)
const unsigned kZeroRegCode
#define ASSERT_EQUAL_REGISTERS(expected)
const int64_t kSQuietNanMask
#define ASSERT_EQUAL_FP64(expected, result)
const unsigned kByteSizeInBytes
const unsigned kXRegSizeInBits
const LowDwVfpRegister d15
#define ASSERT(condition)
CPURegister PopHighestIndex()
const LowDwVfpRegister d3
const unsigned kLinkRegCode
CPURegister PopLowestIndex()
const LowDwVfpRegister d10
static Code * cast(Object *obj)
#define ASSERT_EQUAL_64(expected, result)
int CountSetBits(uint64_t value, int width)
const unsigned kWRegSizeInBits
bool IsSignallingNaN(double num)
const LowDwVfpRegister d14
#define ASSERT_EQUAL_32(expected, result)
const LowDwVfpRegister d7
const LowDwVfpRegister d4
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print statistics of the maximum memory committed for the heap in only print modified registers Don t break for ASM_UNIMPLEMENTED_BREAK macros print stack trace when an illegal exception is thrown randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot testing_bool_flag testing_int_flag string flag tmp file in which to serialize heap Print the time it takes to lazily compile hydrogen code stubs concurrent_recompilation concurrent_sweeping Print usage including flags
#define START_AFTER_RESET()
const LowDwVfpRegister d13
const LowDwVfpRegister d6
const unsigned kInstructionSize
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array shift
const unsigned kSRegSizeInBits
const LowDwVfpRegister d5
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra code(assertions) for debugging") DEFINE_bool(code_comments
const unsigned kSPRegInternalCode
const unsigned kNumberOfFPRegisters
#define CHECK_NE(unexpected, value)
bool IncludesAliasOf(const CPURegister &other1, const CPURegister &other2=NoCPUReg, const CPURegister &other3=NoCPUReg, const CPURegister &other4=NoCPUReg) const
void ClobberFP(MacroAssembler *masm, RegList reg_list, double const value)
const LowDwVfpRegister d9
static Local< Context > New(Isolate *isolate, ExtensionConfiguration *extensions=NULL, Handle< ObjectTemplate > global_template=Handle< ObjectTemplate >(), Handle< Value > global_object=Handle< Value >())
MUST_USE_RESULT MaybeObject * CreateCode(const CodeDesc &desc, Code::Flags flags, Handle< Object > self_reference, bool immovable=false, bool crankshafted=false, int prologue_offset=Code::kPrologueOffsetNotSet)
const unsigned kNumberOfRegisters
const LowDwVfpRegister d2
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function info
static Register XRegFromCode(unsigned code)
CPURegister::RegisterType type() const
static int32_t ImmBranchRange(ImmBranchType branch_type)
uint64_t flags_nzcv() const
static Address return_address_from_call_start(Address pc)
RegList PopulateRegisterArray(Register *w, Register *x, Register *r, int reg_size, int reg_count, RegList allowed)
const unsigned kFramePointerRegCode
const LowDwVfpRegister d12
void Clobber(MacroAssembler *masm, RegList reg_list, uint64_t const value)
RegList PopulateFPRegisterArray(FPRegister *s, FPRegister *d, FPRegister *v, int reg_size, int reg_count, RegList allowed)
bool Is(const CPURegister &other) const
const LowDwVfpRegister d1
#define ASSERT_EQUAL_FP32(expected, result)
#define SETUP_SIZE(buf_size)
void Queue(const CPURegister &rt)
const LowDwVfpRegister d8
#define ASSERT_EQUAL_NZCV(expected)