6#if defined(TARGET_ARCH_ARM64)
20#define EXPECT_DISASSEMBLY(expected)
22#define EXPECT_DISASSEMBLY(expected) \
23 EXPECT_STREQ(expected, test->RelativeDisassembly())
28 __ add(
R0,
R0, Operand(42));
34 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
44 __ movz(
R0, Immediate(42), 0);
50 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
57 __ movz(
R0, Immediate(42), 0);
58 __ movz(
R0, Immediate(42), 1);
64 EXPECT_EQ(42LL << 16, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
67 "movz r0, #0x2a lsl 16\n"
72 __ movz(
R0, Immediate(42), 2);
78 EXPECT_EQ(42LL << 32, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
80 "movz r0, #0x2a lsl 32\n"
85 __ movz(
R0, Immediate(42), 3);
91 EXPECT_EQ(42LL << 48, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
93 "movz r0, #0x2a lsl 48\n"
99 __ movn(
R0, Immediate(42), 0);
105 EXPECT_EQ(~42LL, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
112 __ movn(
R0, Immediate(42), 1);
118 EXPECT_EQ(~(42LL << 16), EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
120 "movn r0, #0x2a lsl 16\n"
125 __ movn(
R0, Immediate(42), 2);
131 EXPECT_EQ(~(42LL << 32), EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
133 "movn r0, #0x2a lsl 32\n"
138 __ movn(
R0, Immediate(42), 3);
144 EXPECT_EQ(~(42LL << 48), EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
146 "movn r0, #0x2a lsl 48\n"
152 __ movz(
R0, Immediate(1), 3);
153 __ movk(
R0, Immediate(42), 0);
159 EXPECT_EQ(42LL | (1LL << 48),
160 EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
162 "movz r0, #0x1 lsl 48\n"
168 __ movz(
R0, Immediate(1), 0);
169 __ movk(
R0, Immediate(42), 1);
175 EXPECT_EQ((42LL << 16) | 1,
176 EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
179 "movk r0, #0x2a lsl 16\n"
184 __ movz(
R0, Immediate(1), 0);
185 __ movk(
R0, Immediate(42), 2);
191 EXPECT_EQ((42LL << 32) | 1,
192 EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
195 "movk r0, #0x2a lsl 32\n"
200 __ movz(
R0, Immediate(1), 0);
201 __ movk(
R0, Immediate(42), 3);
207 EXPECT_EQ((42LL << 48) | 1,
208 EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
211 "movk r0, #0x2a lsl 48\n"
216 __ movz(
R0, Immediate(0x8000), 0);
222 EXPECT_EQ(0x8000, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
230 __ movz(
R0, Immediate(20), 0);
231 __ movz(
R1, Immediate(22), 0);
238 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
247 __ movz(
R0, Immediate(20), 0);
248 __ movz(
R1, Immediate(11), 0);
255 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
259 "add r0, r0, r1 lsl #1\n"
264 __ movz(
R0, Immediate(20), 0);
265 __ movz(
R1, Immediate(44), 0);
272 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
276 "add r0, r0, r1 lsr #1\n"
281 __ movz(
R0, Immediate(20), 0);
282 __ movz(
R1, Immediate(44), 0);
289 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
293 "add r0, r0, r1 asr #1\n"
298 __ movz(
R0, Immediate(43), 0);
299 __ movn(
R1, Immediate(0), 0);
307 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
311 "add r1, zr, r1 lsl #3\n"
312 "add r0, r0, r1 asr #3\n"
318 __ movz(
R0, Immediate(43), 0);
319 __ movz(
R1, Immediate(0xffff), 0);
320 __ movk(
R1, Immediate(0xffff), 1);
327 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
331 "movk r1, #0xffff lsl 16\n"
332 "add r0, r0, r1 sxtw\n"
337 __ LoadImmediate(
R2, -1);
338 __ LoadImmediate(
R1, 1);
339 __ LoadImmediate(
R0, 0);
348 EXPECT_EQ(1, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
360 __ LoadImmediate(
R1, 1);
361 __ LoadImmediate(
R0, 0);
370 EXPECT_EQ(-1, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
381 __ LoadImmediate(
R0, 0);
382 __ LoadImmediate(
R1, 1);
383 __ LoadImmediate(
R2, 0xFFFFFFFFFFFFFFFF);
384 __ LoadImmediate(
R3, 0x7FFFFFFFFFFFFFFF);
393 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
398 "mov r3, 0x7fffffffffffffff\n"
401 "csinc r0, r0, r0, vs\n"
406 __ LoadImmediate(
R2, -1);
407 __ LoadImmediate(
R1, 1);
408 __ LoadImmediate(
R0, 0);
417 EXPECT_EQ(1, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
422 "addws tmp, r2, r1\n"
423 "adcws tmp, r2, r0\n"
429 __ LoadImmediate(
R1, 1);
430 __ LoadImmediate(
R0, 0);
439 EXPECT_EQ(0x0FFFFFFFF, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
443 "subws tmp, r0, r1\n"
444 "sbcws tmp, r0, r0\n"
450 __ LoadImmediate(
R0, 0);
451 __ LoadImmediate(
R1, 1);
452 __ LoadImmediate(
R2, 0xFFFFFFFF);
453 __ LoadImmediate(
R3, 0x7FFFFFFF);
462 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
466 "mov r2, 0xffffffff\n"
467 "mov r3, 0x7fffffff\n"
468 "addws tmp, r2, r1\n"
469 "adcws tmp, r3, r0\n"
470 "csinc r0, r0, r0, vs\n"
481 __ movz(
R0, Immediate(43), 0);
482 __ movz(
R1, Immediate(42), 0);
491 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
494 "sub csp, csp, #0x1000\n"
495 "sub csp, csp, #0x10\n"
498 "str r1, [sp, #-8]!\n"
499 "ldr r0, [sp], #8 !\n"
506 __ movz(
R0, Immediate(43), 0);
507 __ movz(
R1, Immediate(42), 0);
508 __ add(
R2,
SP, Operand(1));
509 __ str(
R1, Address(
R2, -1));
510 __ ldr(
R0, Address(
R2, -1));
517 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
520 "sub csp, csp, #0x1000\n"
524 "str r1, [r2, #-1]\n"
525 "ldr r0, [r2, #-1]\n"
536 __ movz(
R0, Immediate(43), 0);
537 __ movz(
R1, Immediate(42), 0);
550 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
553 "sub csp, csp, #0x1000\n"
554 "sub csp, csp, #0x100\n"
557 "str r1, [sp, #-256]!\n"
558 "ldr r0, [sp], #248 !\n"
566 __ movz(
R0, Immediate(43), 0);
567 __ movz(
R1, Immediate(42), 0);
569 __ andi(
CSP,
SP, Immediate(~15));
579 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
582 "sub csp, csp, #0x1000\n"
585 "sub sp, sp, #0x1000\n"
586 "and csp, sp, 0xfffffffffffffff0\n"
587 "str r1, [sp, #4096]\n"
588 "add sp, sp, #0x1000\n"
596 __ movz(
R0, Immediate(43), 0);
597 __ movz(
R1, Immediate(42), 0);
598 __ movz(
R2, Immediate(0xfff8), 0);
599 __ movk(
R2, Immediate(0xffff), 1);
604 __ andi(
CSP,
SP, Immediate(~15));
613 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
616 "sub csp, csp, #0x1000\n"
620 "movk r2, #0xffff lsl 16\n"
621 "str r1, [sp, r2 sxtw]\n"
623 "and csp, sp, 0xfffffffffffffff0\n"
632 __ movz(
R0, Immediate(43), 0);
633 __ movz(
R1, Immediate(42), 0);
634 __ movz(
R2, Immediate(10), 0);
636 __ andi(
CSP,
SP, Immediate(~15));
647 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
650 "sub csp, csp, #0x1000\n"
654 "sub sp, sp, #0x50\n"
655 "and csp, sp, 0xfffffffffffffff0\n"
656 "str r1, [sp, r2 uxtx scaled]\n"
657 "ldr r0, [sp, r2 uxtx scaled]\n"
658 "add sp, sp, #0x50\n"
669 __ LoadImmediate(
R1, 0xffffffff);
679 EXPECT_EQ(-1, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
682 "sub csp, csp, #0x1000\n"
683 "sub csp, csp, #0x10\n"
684 "mov r1, 0xffffffff\n"
685 "strw r1, [sp, #-4]!\n"
687 "ldrsw r1, [sp], #4 !\n"
698 __ LoadImmediate(
R2, 43);
699 __ LoadImmediate(
R3, 42);
709 EXPECT_EQ(1, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
712 "sub csp, csp, #0x1000\n"
713 "sub csp, csp, #0x10\n"
716 "stp r2, r3, [sp, #-16]!\n"
717 "ldp r0, r1, [sp], #16 !\n"
725 __ LoadImmediate(
R2, 43);
726 __ LoadImmediate(
R3, 42);
728 __ andi(
CSP,
SP, Immediate(~15));
739 EXPECT_EQ(1, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
742 "sub csp, csp, #0x1000\n"
745 "sub sp, sp, #0x20\n"
746 "and csp, sp, 0xfffffffffffffff0\n"
747 "stp r2, r3, [sp, #16]\n"
748 "ldp r0, r1, [sp, #16]\n"
749 "add sp, sp, #0x20\n"
757 __ LoadImmediate(
R2, 0xAABBCCDDEEFF9988);
758 __ LoadImmediate(
R3, 0xBBCCDDEEFF998877);
760 __ andi(
CSP,
SP, Immediate(~15));
773 EXPECT_EQ(-278523631, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
776 "sub csp, csp, #0x1000\n"
778 "movk r2, #0xeeff lsl 16\n"
779 "movk r2, #0xccdd lsl 32\n"
780 "movk r2, #0xaabb lsl 48\n"
782 "movk r3, #0xff99 lsl 16\n"
783 "movk r3, #0xddee lsl 32\n"
784 "movk r3, #0xbbcc lsl 48\n"
785 "sub sp, sp, #0x20\n"
786 "and csp, sp, 0xfffffffffffffff0\n"
787 "stpw r2, r3, [sp, #8]\n"
788 "ldpw r0, r1, [sp, #8]\n"
789 "add sp, sp, #0x20\n"
797 __ LoadImmediate(
R2, 0xAABBCCDDEEFF9988);
798 __ LoadImmediate(
R3, 0xBBCCDDEEFF998877);
800 __ andi(
CSP,
SP, Immediate(~15));
813 EXPECT_EQ(-278523631, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
816 "sub csp, csp, #0x1000\n"
818 "movk r2, #0xeeff lsl 16\n"
819 "movk r2, #0xccdd lsl 32\n"
820 "movk r2, #0xaabb lsl 48\n"
822 "movk r3, #0xff99 lsl 16\n"
823 "movk r3, #0xddee lsl 32\n"
824 "movk r3, #0xbbcc lsl 48\n"
825 "sub sp, sp, #0x20\n"
826 "and csp, sp, 0xfffffffffffffff0\n"
827 "stpw r2, r3, [sp, #8]\n"
828 "ldpsw r0, r1, [sp, #8]\n"
829 "add sp, sp, #0x20\n"
837 __ LoadImmediate(
R2, 12);
838 __ LoadImmediate(
R3, 21);
839 __ PushRegisterPair(
R2,
R3);
849 EXPECT_EQ(12, EXECUTE_TEST_CODE_INT64(PushRegisterPair,
test->entry()));
852 "sub csp, csp, #0x1000\n"
855 "stp r2, r3, [sp, #-16]!\n"
856 "ldr r0, [sp], #8 !\n"
857 "ldr r1, [sp], #8 !\n"
864 __ LoadImmediate(
R3, 12);
865 __ LoadImmediate(
R2, 21);
866 __ PushRegisterPair(
R3,
R2);
877 EXECUTE_TEST_CODE_INT64(PushRegisterPairReversed,
test->entry()));
880 "sub csp, csp, #0x1000\n"
883 "stp r3, r2, [sp, #-16]!\n"
884 "ldr r0, [sp], #8 !\n"
885 "ldr r1, [sp], #8 !\n"
892 __ LoadImmediate(
R2, 12);
893 __ LoadImmediate(
R3, 21);
896 __ PopRegisterPair(
R0,
R1);
904 EXPECT_EQ(12, EXECUTE_TEST_CODE_INT64(PopRegisterPair,
test->entry()));
907 "sub csp, csp, #0x1000\n"
910 "str r3, [sp, #-8]!\n"
911 "str r2, [sp, #-8]!\n"
912 "ldp r0, r1, [sp], #16 !\n"
919 __ LoadImmediate(
R3, 12);
920 __ LoadImmediate(
R2, 21);
923 __ PopRegisterPair(
R1,
R0);
932 EXECUTE_TEST_CODE_INT64(PopRegisterPairReversed,
test->entry()));
935 "sub csp, csp, #0x1000\n"
938 "str r3, [sp, #-8]!\n"
939 "str r2, [sp, #-8]!\n"
940 "ldp r1, r0, [sp], #16 !\n"
947 __ LoadDImmediate(
V1, 3.0);
948 __ LoadDImmediate(
V2, 4.0);
949 __ PushDoublePair(
V1,
V2);
950 __ LoadDImmediate(
V1, 0.0);
951 __ LoadDImmediate(
V2, 0.0);
960 EXPECT_EQ(1.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
963 "sub csp, csp, #0x1000\n"
964 "fmovd v1, 3.000000\n"
965 "fmovd v2, 4.000000\n"
966 "fstpd v1, v2, [sp, #-16]!\n"
969 "fldpd v1, v2, [sp], #16 !\n"
977 __ LoadDImmediate(
V1, 3.0);
978 __ LoadDImmediate(
V2, 4.0);
980 __ LoadDImmediate(
V1, 0.0);
981 __ LoadDImmediate(
V2, 0.0);
990 EXPECT_EQ(1.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
993 "sub csp, csp, #0x1000\n"
994 "fmovd v1, 3.000000\n"
995 "fmovd v2, 4.000000\n"
996 "fstpq v1, v2, [sp, #-32]!\n"
999 "fldpq v1, v2, [sp], #32 !\n"
1000 "fsubd v0, v2, v1\n"
1007 __ movz(
R0, Immediate(40), 0);
1008 __ movz(
R1, Immediate(42), 0);
1014 __ cmp(
TMP, Operand(0));
1024 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Semaphore,
test->entry()));
1027 "sub csp, csp, #0x1000\n"
1030 "str r0, [sp, #-8]!\n"
1032 "stxr tmp, r1, [sp]\n"
1035 "ldr r0, [sp], #8 !\n"
1042 __ movz(
R0, Immediate(40), 0);
1043 __ movz(
R1, Immediate(42), 0);
1056 typedef intptr_t (*FailedSemaphore)()
DART_UNUSED;
1057 EXPECT_EQ(41, EXECUTE_TEST_CODE_INT64(FailedSemaphore,
test->entry()));
1060 "sub csp, csp, #0x1000\n"
1063 "str r0, [sp, #-8]!\n"
1066 "stxr tmp, r1, [sp]\n"
1067 "ldr r0, [sp], #8 !\n"
1075 __ movz(
R0, Immediate(40), 0);
1079 __ movz(
R0, Immediate(40), 0);
1080 __ movz(
R1, Immediate(42), 0);
1088 __ cmp(
TMP, Operand(0));
1101 EXECUTE_TEST_CODE_INT64(Semaphore32,
test->entry()));
1104 "sub csp, csp, #0x1000\n"
1106 "add r0, r0, r0 lsl #32\n"
1107 "str r0, [sp, #-8]!\n"
1111 "stxrw tmp, r1, [sp]\n"
1114 "ldr r0, [sp], #8 !\n"
1121 __ movz(
R0, Immediate(40), 0);
1125 __ movz(
R0, Immediate(40), 0);
1126 __ movz(
R1, Immediate(42), 0);
1139 typedef intptr_t (*FailedSemaphore32)()
DART_UNUSED;
1143 EXECUTE_TEST_CODE_INT64(FailedSemaphore32,
test->entry()));
1146 "sub csp, csp, #0x1000\n"
1148 "add r0, r0, r0 lsl #32\n"
1149 "str r0, [sp, #-8]!\n"
1154 "stxrw tmp, r1, [sp]\n"
1155 "ldr r0, [sp], #8 !\n"
1166 __ LoadImmediate(
R0, 42);
1172 typedef intptr_t (*LoadStoreExclusiveR31)()
DART_UNUSED;
1173 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(LoadStoreExclusiveR31,
test->entry()));
1175 "sub csp, csp, #0x10\n"
1177 "stxr r0, zr, [csp]\n"
1178 "add csp, csp, #0x10\n"
1189 __ LoadImmediate(
R0, 42);
1195 typedef intptr_t (*LoadStoreExclusiveR31)()
DART_UNUSED;
1196 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(LoadStoreExclusiveR31,
test->entry()));
1198 "sub csp, csp, #0x10\n"
1201 "stxr r1, zr, [r0]\n"
1202 "add csp, csp, #0x10\n"
1213 __ LoadImmediate(
R0, 42);
1219 typedef intptr_t (*LoadStoreExclusiveR31)()
DART_UNUSED;
1220 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(LoadStoreExclusiveR31,
test->entry()));
1222 "sub csp, csp, #0x10\n"
1225 "stxr zr, r1, [r0]\n"
1226 "add csp, csp, #0x10\n"
1233 __ LoadImmediate(
R2, 2);
1239 typedef intptr_t (*AtomicLoadClear)(intptr_t)
DART_UNUSED;
1242 EXECUTE_TEST_CODE_INTPTR_INTPTR(AtomicLoadClear,
test->entry(),
1243 reinterpret_cast<intptr_t
>(&
x)));
1249 "ldclr r2, r0, [r1]\n"
1255 __ LoadImmediate(
R2, 1);
1261 typedef intptr_t (*AtomicLoadSet)(intptr_t)
DART_UNUSED;
1264 EXECUTE_TEST_CODE_INTPTR_INTPTR(AtomicLoadSet,
test->entry(),
1265 reinterpret_cast<intptr_t
>(&
x)));
1271 "ldset r2, r0, [r1]\n"
1284 __ PushImmediate(0x1122334455667788);
1286 __ CompareImmediate(
R1, 0x1122334455667788);
1291 __ PushImmediate(0x1122334455667788);
1293 __ CompareImmediate(
R1, 0x55667788);
1298 __ PushImmediate(0);
1299 __ LoadImmediate(
R1, 0x1122334455667788);
1302 __ CompareImmediate(
R1, 0x1122334455667788);
1306 __ PushImmediate(0);
1307 __ LoadImmediate(
R1, 0x1122334455667788);
1310 __ CompareImmediate(
R1, 0x55667788);
1313 __ LoadImmediate(
R0, 0x42);
1317 __ LoadImmediate(
R0, 0x84);
1326 typedef intptr_t (*LoadAcquireStoreRelease)()
DART_UNUSED;
1328 EXECUTE_TEST_CODE_INT64(LoadAcquireStoreRelease,
test->entry()));
1331 "sub csp, csp, #0x1000\n"
1332 "stp fp, lr, [sp, #-16]!\n"
1334 "movz tmp, #0x7788\n"
1335 "movk tmp, #0x5566 lsl 16\n"
1336 "movk tmp, #0x3344 lsl 32\n"
1337 "movk tmp, #0x1122 lsl 48\n"
1338 "str tmp, [sp, #-8]!\n"
1340 "movz tmp2, #0x7788\n"
1341 "movk tmp2, #0x5566 lsl 16\n"
1342 "movk tmp2, #0x3344 lsl 32\n"
1343 "movk tmp2, #0x1122 lsl 48\n"
1346 "add sp, sp, #0x8\n"
1347 "movz tmp, #0x7788\n"
1348 "movk tmp, #0x5566 lsl 16\n"
1349 "movk tmp, #0x3344 lsl 32\n"
1350 "movk tmp, #0x1122 lsl 48\n"
1351 "str tmp, [sp, #-8]!\n"
1353 "movz tmp2, #0x7788\n"
1354 "movk tmp2, #0x5566 lsl 16\n"
1357 "add sp, sp, #0x8\n"
1359 "str tmp, [sp, #-8]!\n"
1360 "movz r1, #0x7788\n"
1361 "movk r1, #0x5566 lsl 16\n"
1362 "movk r1, #0x3344 lsl 32\n"
1363 "movk r1, #0x1122 lsl 48\n"
1365 "ldr r1, [sp], #8 !\n"
1366 "movz tmp2, #0x7788\n"
1367 "movk tmp2, #0x5566 lsl 16\n"
1368 "movk tmp2, #0x3344 lsl 32\n"
1369 "movk tmp2, #0x1122 lsl 48\n"
1373 "str tmp, [sp, #-8]!\n"
1374 "movz r1, #0x7788\n"
1375 "movk r1, #0x5566 lsl 16\n"
1376 "movk r1, #0x3344 lsl 32\n"
1377 "movk r1, #0x1122 lsl 48\n"
1379 "ldr r1, [sp], #8 !\n"
1380 "movz tmp2, #0x7788\n"
1381 "movk tmp2, #0x5566 lsl 16\n"
1388 "ldp fp, lr, [sp], #16 !\n"
1395 __ movz(
R1, Immediate(43), 0);
1396 __ movz(
R2, Immediate(42), 0);
1403 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
1411constexpr uint64_t kU64MinusOne = 0xffffffffffffffffull;
1412constexpr uint64_t kU64MinInt32 = 0xffffffff80000000ull;
1413constexpr uint64_t kU64MaxInt32 = 0x000000007fffffffull;
1414constexpr uint64_t kU64MinInt64 = 0x8000000000000000ull;
1415constexpr uint64_t kU64MaxInt64 = 0x7fffffffffffffffull;
1417#define FOR_EACH_ASR_64_TEST_CONFIG(M) \
1420 M(kU64MaxInt32, 0, kU64MaxInt32) \
1421 M(kU64MaxInt64, 0, kU64MaxInt64) \
1422 M(kU64MinInt32, 0, kU64MinInt32) \
1423 M(kU64MinInt64, 0, kU64MinInt64) \
1427 M(0xffffull, 1, 0x7fffull) \
1428 M(0xffffffffull, 1, 0x7fffffffull) \
1429 M(kU64MaxInt32, 1, 0x3fffffffull) \
1430 M(kU64MaxInt64, 1, 0x3fffffffffffffffull) \
1431 M(kU64MinInt32, 1, 0xffffffffc0000000ull) \
1432 M(kU64MinInt64, 1, 0xc000000000000000ull) \
1433 M(kU64MinusOne, 1, kU64MinusOne) \
1436 M(0xffffull, 2, 0x3fffull) \
1437 M(0xffffffffull, 2, 0x3fffffffull) \
1438 M(kU64MaxInt32, 2, 0x1fffffffull) \
1439 M(kU64MaxInt64, 2, 0x1fffffffffffffffull) \
1440 M(kU64MinInt32, 2, 0xffffffffe0000000ull) \
1441 M(kU64MinInt64, 2, 0xe000000000000000ull) \
1442 M(kU64MinusOne, 2, kU64MinusOne) \
1446 M(0xffffull, 31, 0ull) \
1447 M(0xffffffffull, 31, 1ull) \
1448 M(kU64MaxInt32, 31, 0ull) \
1449 M(kU64MaxInt64, 31, 0xffffffffull) \
1450 M(kU64MinInt32, 31, kU64MinusOne) \
1451 M(kU64MinInt64, 31, 0xffffffff00000000ull) \
1452 M(kU64MinusOne, 31, kU64MinusOne) \
1456 M(0xffffull, 32, 0ull) \
1457 M(0xffffffffull, 32, 0ull) \
1458 M(kU64MaxInt64, 32, 0x7fffffffull) \
1459 M(kU64MinInt32, 32, kU64MinusOne) \
1460 M(kU64MinInt64, 32, 0xffffffff80000000ull) \
1461 M(kU64MinusOne, 32, kU64MinusOne) \
1465 M(0xffffull, 62, 0ull) \
1466 M(0xffffffffull, 62, 0ull) \
1467 M(kU64MaxInt64, 62, 1ull) \
1468 M(kU64MinInt32, 62, kU64MinusOne) \
1469 M(kU64MinInt64, 62, 0xfffffffffffffffeull) \
1470 M(kU64MinusOne, 62, kU64MinusOne) \
1474 M(0xffffull, 63, 0ull) \
1475 M(0xffffffffull, 63, 0ull) \
1476 M(kU64MaxInt64, 63, 0ull) \
1477 M(kU64MinInt32, 63, kU64MinusOne) \
1478 M(kU64MinInt64, 63, kU64MinusOne) \
1479 M(kU64MinusOne, 63, kU64MinusOne)
1481#define FOR_EACH_LSR_64_TEST_CONFIG(M) \
1484 M(kU64MaxInt32, 0, kU64MaxInt32) \
1485 M(kU64MaxInt64, 0, kU64MaxInt64) \
1486 M(kU64MinInt32, 0, kU64MinInt32) \
1487 M(kU64MinInt64, 0, kU64MinInt64) \
1491 M(0xffffull, 1, 0x7fffull) \
1492 M(0xffffffffull, 1, 0x7fffffffull) \
1493 M(kU64MaxInt32, 1, 0x3fffffffull) \
1494 M(kU64MaxInt64, 1, 0x3fffffffffffffffull) \
1495 M(kU64MinInt32, 1, 0x7fffffffc0000000ull) \
1496 M(kU64MinInt64, 1, 0x4000000000000000ull) \
1497 M(kU64MinusOne, 1, 0x7fffffffffffffffull) \
1500 M(0xffffull, 2, 0x3fffull) \
1501 M(0xffffffffull, 2, 0x3fffffffull) \
1502 M(kU64MaxInt32, 2, 0x1fffffffull) \
1503 M(kU64MaxInt64, 2, 0x1fffffffffffffffull) \
1504 M(kU64MinInt32, 2, 0x3fffffffe0000000ull) \
1505 M(kU64MinInt64, 2, 0x2000000000000000ull) \
1506 M(kU64MinusOne, 2, 0x3fffffffffffffffull) \
1510 M(0xffffull, 31, 0ull) \
1511 M(0xffffffffull, 31, 1ull) \
1512 M(kU64MaxInt32, 31, 0ull) \
1513 M(kU64MaxInt64, 31, 0xffffffffull) \
1514 M(kU64MinInt32, 31, 0x1ffffffffull) \
1515 M(kU64MinInt64, 31, 0x100000000ull) \
1516 M(kU64MinusOne, 31, 0x1ffffffffull) \
1520 M(0xffffull, 32, 0ull) \
1521 M(0xffffffffull, 32, 0ull) \
1522 M(kU64MaxInt64, 32, 0x7fffffffull) \
1523 M(kU64MinInt32, 32, 0xffffffffull) \
1524 M(kU64MinInt64, 32, 0x80000000ull) \
1525 M(kU64MinusOne, 32, 0xffffffffull) \
1529 M(0xffffull, 62, 0ull) \
1530 M(0xffffffffull, 62, 0ull) \
1531 M(kU64MaxInt64, 62, 1ull) \
1532 M(kU64MinInt32, 62, 3ull) \
1533 M(kU64MinInt64, 62, 2ull) \
1534 M(kU64MinusOne, 62, 3ull) \
1538 M(0xffffull, 63, 0ull) \
1539 M(0xffffffffull, 63, 0ull) \
1540 M(kU64MaxInt64, 63, 0ull) \
1541 M(kU64MinInt32, 63, 1ull) \
1542 M(kU64MinInt64, 63, 1ull) \
1543 M(kU64MinusOne, 63, 1ull)
1545#define FOR_EACH_LSL_64_TEST_CONFIG(M) \
1548 M(kU64MaxInt32, 0, kU64MaxInt32) \
1549 M(kU64MaxInt64, 0, kU64MaxInt64) \
1550 M(kU64MinInt32, 0, kU64MinInt32) \
1551 M(kU64MinInt64, 0, kU64MinInt64) \
1555 M(0xffffull, 1, 0x1fffeull) \
1556 M(0xffffffffull, 1, 0x1fffffffeull) \
1557 M(kU64MaxInt32, 1, 0xfffffffeull) \
1558 M(kU64MaxInt64, 1, 0xfffffffffffffffeull) \
1559 M(kU64MinInt32, 1, 0xffffffff00000000ull) \
1560 M(kU64MinInt64, 1, 0ull) \
1561 M(kU64MinusOne, 1, 0xfffffffffffffffeull) \
1564 M(0xffffull, 2, 0x3fffcull) \
1565 M(0xffffffffull, 2, 0x3fffffffcull) \
1566 M(kU64MaxInt32, 2, 0x1fffffffcull) \
1567 M(kU64MaxInt64, 2, 0xfffffffffffffffcull) \
1568 M(kU64MinInt32, 2, 0xfffffffe00000000ull) \
1569 M(kU64MinInt64, 2, 0ull) \
1570 M(kU64MinusOne, 2, 0xfffffffffffffffcull) \
1572 M(1ull, 31, 0x0000000080000000ull) \
1573 M(4ull, 31, 0x0000000200000000ull) \
1574 M(0xffffull, 31, 0x00007fff80000000ull) \
1575 M(0xffffffffull, 31, 0x7fffffff80000000ull) \
1576 M(kU64MaxInt32, 31, 0x3fffffff80000000ull) \
1577 M(kU64MaxInt64, 31, 0xffffffff80000000ull) \
1578 M(kU64MinInt32, 31, 0xc000000000000000ull) \
1579 M(kU64MinInt64, 31, 0ull) \
1580 M(kU64MinusOne, 31, 0xffffffff80000000ull) \
1582 M(1ull, 32, 0x0000000100000000ull) \
1583 M(4ull, 32, 0x0000000400000000ull) \
1584 M(0xffffull, 32, 0x0000ffff00000000ull) \
1585 M(0xffffffffull, 32, 0xffffffff00000000ull) \
1586 M(kU64MaxInt64, 32, 0xffffffff00000000ull) \
1587 M(kU64MinInt32, 32, 0x8000000000000000ull) \
1588 M(kU64MinInt64, 32, 0ull) \
1589 M(kU64MinusOne, 32, 0xffffffff00000000ull) \
1591 M(1ull, 62, 0x4000000000000000ull) \
1593 M(0xffffull, 62, 0xc000000000000000ull) \
1594 M(0xffffffffull, 62, 0xc000000000000000ull) \
1595 M(kU64MaxInt64, 62, 0xc000000000000000ull) \
1596 M(kU64MinInt32, 62, 0ull) \
1597 M(kU64MinInt64, 62, 0ull) \
1598 M(kU64MinusOne, 62, 0xc000000000000000ull) \
1600 M(1ull, 63, 0x8000000000000000ull) \
1602 M(0xffffull, 63, 0x8000000000000000ull) \
1603 M(0xffffffffull, 63, 0x8000000000000000ull) \
1604 M(kU64MaxInt64, 63, 0x8000000000000000ull) \
1605 M(kU64MinInt32, 63, 0ull) \
1606 M(kU64MinInt64, 63, 0ull) \
1607 M(kU64MinusOne, 63, 0x8000000000000000ull)
1609#define SHIFT_64_IMMEDIATE_TEST(macro_op, val, shift, expected) \
1610 ASSEMBLER_TEST_GENERATE(macro_op##_##val##_##shift, assembler) { \
1611 __ LoadImmediate(R1, bit_cast<int64_t>(val)); \
1612 __ macro_op(R0, R1, (shift)); \
1616 ASSEMBLER_TEST_RUN(macro_op##_##val##_##shift, test) { \
1617 typedef int64_t (*Int64Return)() DART_UNUSED; \
1618 EXPECT_EQ((expected), bit_cast<uint64_t>(EXECUTE_TEST_CODE_INT64( \
1619 Int64Return, test->entry()))); \
1622#define ASR_64_IMMEDIATE_TEST(val, shift, expected) \
1623 SHIFT_64_IMMEDIATE_TEST(AsrImmediate, val, shift, expected)
1625#define LSR_64_IMMEDIATE_TEST(val, shift, expected) \
1626 SHIFT_64_IMMEDIATE_TEST(LsrImmediate, val, shift, expected)
1628#define LSL_64_IMMEDIATE_TEST(val, shift, expected) \
1629 SHIFT_64_IMMEDIATE_TEST(LslImmediate, val, shift, expected)
1631FOR_EACH_ASR_64_TEST_CONFIG(ASR_64_IMMEDIATE_TEST)
1632FOR_EACH_LSR_64_TEST_CONFIG(LSR_64_IMMEDIATE_TEST)
1633FOR_EACH_LSL_64_TEST_CONFIG(LSL_64_IMMEDIATE_TEST)
1635#undef LSL_64_IMMEDIATE_TEST
1636#undef LSR_64_IMMEDIATE_TEST
1637#undef ASR_64_IMMEDIATE_TEST
1638#undef SHIFT_64_IMMEDIATE_TEST
1639#undef FOR_EACH_LSL_64_TESTS_LIST
1640#undef FOR_EACH_LSR_64_TESTS_LIST
1641#undef FOR_EACH_ASR_64_TESTS_LIST
1643constexpr uint32_t kU32MinusOne = 0xffffffffu;
1644constexpr uint32_t kU32MinInt32 = 0x80000000u;
1645constexpr uint32_t kU32MaxInt32 = 0x7fffffffu;
1647#define FOR_EACH_ASR_32_TEST_CONFIG(M) \
1650 M(kU32MaxInt32, 0, kU32MaxInt32) \
1651 M(kU32MinInt32, 0, kU32MinInt32) \
1655 M(0xffffu, 1, 0x7fffu) \
1656 M(0xffffffffu, 1, 0xffffffffu) \
1657 M(kU32MaxInt32, 1, 0x3fffffffu) \
1658 M(kU32MinInt32, 1, 0xc0000000u) \
1659 M(kU32MinusOne, 1, 0xffffffffu) \
1662 M(0xffffu, 2, 0x3fffu) \
1663 M(0xffffffffu, 2, 0xffffffffu) \
1664 M(kU32MaxInt32, 2, 0x1fffffffu) \
1665 M(kU32MinInt32, 2, 0xe0000000u) \
1666 M(kU32MinusOne, 2, kU32MinusOne) \
1670 M(0xffffu, 31, 0u) \
1671 M(0xffffffffu, 31, 0xffffffffu) \
1672 M(kU32MaxInt32, 31, 0u) \
1673 M(kU32MinInt32, 31, kU32MinusOne) \
1674 M(kU32MinusOne, 31, kU32MinusOne)
1676#define FOR_EACH_LSR_32_TEST_CONFIG(M) \
1679 M(kU32MaxInt32, 0, kU32MaxInt32) \
1680 M(kU32MinInt32, 0, kU32MinInt32) \
1684 M(0xffffu, 1, 0x7fffu) \
1685 M(0xffffffffu, 1, 0x7fffffffu) \
1686 M(kU32MaxInt32, 1, 0x3fffffffu) \
1687 M(kU32MinInt32, 1, 0x40000000u) \
1688 M(kU32MinusOne, 1, 0x7fffffffu) \
1691 M(0xffffu, 2, 0x3fffu) \
1692 M(0xffffffffu, 2, 0x3fffffffu) \
1693 M(kU32MaxInt32, 2, 0x1fffffffu) \
1694 M(kU32MinInt32, 2, 0x20000000u) \
1695 M(kU32MinusOne, 2, 0x3fffffffu) \
1699 M(0xffffu, 31, 0u) \
1700 M(0xffffffffu, 31, 1u) \
1701 M(kU32MaxInt32, 31, 0u) \
1702 M(kU32MinInt32, 31, 1u) \
1703 M(kU32MinusOne, 31, 1u)
1705#define FOR_EACH_LSL_32_TEST_CONFIG(M) \
1708 M(kU32MaxInt32, 0, kU32MaxInt32) \
1709 M(kU32MinInt32, 0, kU32MinInt32) \
1713 M(0xffffu, 1, 0x1fffeu) \
1714 M(0xffffffffu, 1, 0xfffffffeu) \
1715 M(kU32MaxInt32, 1, 0xfffffffeu) \
1716 M(kU32MinInt32, 1, 0x00000000u) \
1717 M(kU32MinusOne, 1, 0xfffffffeu) \
1720 M(0xffffu, 2, 0x3fffcu) \
1721 M(0xffffffffu, 2, 0xfffffffcu) \
1722 M(kU32MaxInt32, 2, 0xfffffffcu) \
1723 M(kU32MinInt32, 2, 0x00000000u) \
1724 M(kU32MinusOne, 2, 0xfffffffcu) \
1726 M(1u, 31, 0x80000000u) \
1727 M(4u, 31, 0x00000000u) \
1728 M(0xffffu, 31, 0x80000000u) \
1729 M(0xffffffffu, 31, 0x80000000u) \
1730 M(kU32MaxInt32, 31, 0x80000000u) \
1731 M(kU32MinInt32, 31, 0x00000000u) \
1732 M(kU32MinusOne, 31, 0x80000000u)
1734#define SHIFT_32_IMMEDIATE_TEST(macro_op, val, shift, expected) \
1735 ASSEMBLER_TEST_GENERATE(macro_op##a_##val##_##shift, assembler) { \
1736 __ LoadImmediate(R1, bit_cast<int32_t>(val)); \
1737 __ macro_op(R0, R1, (shift), kFourBytes); \
1741 ASSEMBLER_TEST_RUN(macro_op##a_##val##_##shift, test) { \
1742 typedef int32_t (*Int32Return)() DART_UNUSED; \
1743 EXPECT_EQ((expected), bit_cast<uint32_t>((int32_t)EXECUTE_TEST_CODE_INT64( \
1744 Int32Return, test->entry()))); \
1747#define ASR_32_IMMEDIATE_TEST(val, shift, expected) \
1748 SHIFT_32_IMMEDIATE_TEST(AsrImmediate, val, shift, expected)
1750#define LSR_32_IMMEDIATE_TEST(val, shift, expected) \
1751 SHIFT_32_IMMEDIATE_TEST(LsrImmediate, val, shift, expected)
1753#define LSL_32_IMMEDIATE_TEST(val, shift, expected) \
1754 SHIFT_32_IMMEDIATE_TEST(LslImmediate, val, shift, expected)
1756FOR_EACH_ASR_32_TEST_CONFIG(ASR_32_IMMEDIATE_TEST)
1757FOR_EACH_LSR_32_TEST_CONFIG(LSR_32_IMMEDIATE_TEST)
1758FOR_EACH_LSL_32_TEST_CONFIG(LSL_32_IMMEDIATE_TEST)
1760#undef LSL_32_IMMEDIATE_TEST
1761#undef LSR_32_IMMEDIATE_TEST
1762#undef ASR_32_IMMEDIATE_TEST
1763#undef SHIFT_32_IMMEDIATE_TEST
1764#undef FOR_EACH_LSL_32_TESTS_LIST
1765#undef FOR_EACH_LSR_32_TESTS_LIST
1766#undef FOR_EACH_ASR_32_TESTS_LIST
1769 __ LslImmediate(
R0,
R0, 1);
1770 __ LslImmediate(
R0,
R0, 2);
1771 __ LslImmediate(
R0,
R0, 3);
1772 __ LslImmediate(
R0,
R0, 4);
1773 __ LslImmediate(
R0,
R0, 60);
1774 __ LslImmediate(
R0,
R0, 61);
1775 __ LslImmediate(
R0,
R0, 62);
1776 __ LslImmediate(
R0,
R0, 63);
1801 "lslw r0, r0, #28\n"
1802 "lslw r0, r0, #29\n"
1803 "lslw r0, r0, #30\n"
1804 "lslw r0, r0, #31\n");
1808 __ LsrImmediate(
R0,
R0, 1);
1809 __ LsrImmediate(
R0,
R0, 2);
1810 __ LsrImmediate(
R0,
R0, 3);
1811 __ LsrImmediate(
R0,
R0, 4);
1812 __ LsrImmediate(
R0,
R0, 60);
1813 __ LsrImmediate(
R0,
R0, 61);
1814 __ LsrImmediate(
R0,
R0, 62);
1815 __ LsrImmediate(
R0,
R0, 63);
1840 "lsrw r0, r0, #28\n"
1841 "lsrw r0, r0, #29\n"
1842 "lsrw r0, r0, #30\n"
1843 "lsrw r0, r0, #31\n");
1847 __ AsrImmediate(
R0,
R0, 1);
1848 __ AsrImmediate(
R0,
R0, 2);
1849 __ AsrImmediate(
R0,
R0, 3);
1850 __ AsrImmediate(
R0,
R0, 4);
1851 __ AsrImmediate(
R0,
R0, 60);
1852 __ AsrImmediate(
R0,
R0, 61);
1853 __ AsrImmediate(
R0,
R0, 62);
1854 __ AsrImmediate(
R0,
R0, 63);
1879 "asrw r0, r0, #28\n"
1880 "asrw r0, r0, #29\n"
1881 "asrw r0, r0, #30\n"
1882 "asrw r0, r0, #31\n");
1886 __ movz(
R1, Immediate(42), 0);
1887 __ movz(
R2, Immediate(21), 0);
1894 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
1898 "and r0, r1, r2 lsl #1\n"
1903 __ movz(
R1, Immediate(42), 0);
1904 __ movz(
R2, Immediate(5), 0);
1911 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
1920 __ movz(
R1, Immediate(32), 0);
1921 __ movz(
R2, Immediate(10), 0);
1928 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
1937 __ movz(
R1, Immediate(32), 0);
1938 __ movn(
R2, Immediate(0), 0);
1939 __ movk(
R2, Immediate(0xffd5), 0);
1946 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
1950 "movk r2, #0xffd5\n"
1956 __ movz(
R1, Immediate(0xffd5), 0);
1957 __ movz(
R2, Immediate(0xffff), 0);
1964 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
1966 "movz r1, #0xffd5\n"
1967 "movz r2, #0xffff\n"
1973 __ movz(
R1, Immediate(0xffd5), 0);
1974 __ movn(
R2, Immediate(0xffff), 0);
1981 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
1983 "movz r1, #0xffd5\n"
1984 "movn r2, #0xffff\n"
1991 __ movz(
R1, Immediate(42), 0);
1992 __ andi(
R0,
R1, Immediate(0xaaaaaaaaaaaaaaaaULL));
1998 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2001 "and r0, r1, 0xaaaaaaaaaaaaaaaa\n"
2018 EXPECT_EQ(32, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2021 "sub tmp2, csp, #0x1f\n"
2022 "and csp, tmp2, 0xfffffffffffffff0\n"
2030 __ movz(
R1, Immediate(43), 0);
2031 __ andi(
R0,
R1, Immediate(1));
2037 EXPECT_EQ(1, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2045 __ movz(
R1, Immediate(0), 0);
2046 __ movz(
R2, Immediate(0x3f), 0);
2047 __ movz(
R3, Immediate(0xa), 0);
2048 __ orri(
R1,
R1, Immediate(0x0020002000200020ULL));
2056 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2061 "orr r1, r1, 0x20002000200020\n"
2068 __ movn(
R0, Immediate(0), 0);
2069 __ movk(
R0, Immediate(0xffd5), 0);
2070 __ movz(
R1, Immediate(0x3f), 0);
2071 __ eori(
R0,
R0, Immediate(0x3f3f3f3f3f3f3f3fULL));
2078 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2081 "movk r0, #0xffd5\n"
2083 "eor r0, r0, 0x3f3f3f3f3f3f3f3f\n"
2092 __ cmp(
R1, Operand(64));
2094 __ LoadImmediate(
R2, 42);
2096 __ cmp(
R2, Operand(58));
2098 __ LoadImmediate(
R0, -1);
2100 __ cmp(
R1, Operand(0));
2104 __ cmp(
R1, Operand(3));
2109 __ LoadImmediate(
R0, 1);
2115 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2128 "add r0, zr, r0 lsr #3\n"
2142 __ cmp(
R1, Operand(32));
2144 __ LoadImmediate(
R2, 42);
2146 __ cmp(
R2, Operand(26));
2148 __ LoadImmediate(
R0, -1);
2150 __ cmp(
R1, Operand(0));
2154 __ cmp(
R1, Operand(3));
2156 __ LoadImmediate(
R0, 0xFFFFFFFF0FFFFFFF);
2158 __ cmp(
R1, Operand(4));
2160 __ LoadImmediate(
R0, 0xFFFFFFFF);
2162 __ cmp(
R1, Operand(0));
2167 __ LoadImmediate(
R0, 1);
2173 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2186 "add r0, zr, r0 lsr #35\n"
2190 "mov r0, 0xffffffff0fffffff\n"
2194 "mov r0, 0xffffffff\n"
2205 const int64_t immediate = 0x0000000000000015;
2206 __ LoadImmediate(
R0, immediate);
2213 const int64_t expected = 0xa800000000000000;
2214 EXPECT_EQ(expected, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2224 __ movz(
R0, Immediate(42), 0);
2226 __ movz(
R0, Immediate(0), 0);
2233 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2243 __ movz(
R0, Immediate(42), 0);
2246 __ movz(
R0, Immediate(0), 0);
2249 __ movz(
R0, Immediate(0), 0);
2253 __ movz(
R0, Immediate(0), 0);
2259 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2274 __ movz(
R0, Immediate(42), 0);
2275 __ movz(
R1, Immediate(234), 0);
2276 __ movz(
R2, Immediate(234), 0);
2280 __ movz(
R0, Immediate(0), 0);
2287 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2301 __ movz(
R0, Immediate(0), 0);
2302 __ movz(
R1, Immediate(233), 0);
2303 __ movz(
R2, Immediate(234), 0);
2307 __ movz(
R0, Immediate(42), 0);
2314 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2328 __ movz(
R0, Immediate(42), 0);
2329 __ movz(
R1, Immediate(1), 0);
2331 __ cmp(
R1, Operand(1));
2333 __ movz(
R0, Immediate(0), 0);
2340 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2353 __ movz(
R0, Immediate(42), 0);
2354 __ movn(
R1, Immediate(0), 0);
2356 __ cmn(
R1, Operand(1));
2358 __ movz(
R0, Immediate(0), 0);
2365 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2378 __ movz(
R0, Immediate(42), 0);
2379 __ movz(
R1, Immediate(233), 0);
2380 __ movz(
R2, Immediate(234), 0);
2384 __ movz(
R0, Immediate(0), 0);
2391 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2405 __ movz(
R0, Immediate(0), 0);
2406 __ movz(
R1, Immediate(235), 0);
2407 __ movz(
R2, Immediate(234), 0);
2411 __ movz(
R0, Immediate(42), 0);
2418 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2432 __ movz(
R0, Immediate(42), 0);
2433 __ movz(
R1, Immediate(0), 0);
2436 __ movz(
R0, Immediate(0), 0);
2443 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2455 __ movz(
R0, Immediate(0), 0);
2456 __ movz(
R1, Immediate(1), 0);
2459 __ movz(
R0, Immediate(42), 0);
2466 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2478 __ movz(
R0, Immediate(42), 0);
2479 __ movz(
R1, Immediate(1), 0);
2482 __ movz(
R0, Immediate(0), 0);
2489 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2501 __ movz(
R0, Immediate(0), 0);
2502 __ movz(
R1, Immediate(0), 0);
2505 __ movz(
R0, Immediate(42), 0);
2512 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2521static constexpr int64_t kBits5And35 = (1 << 5) | (1ll << 35);
2526 __ movz(
R0, Immediate(42), 0);
2527 __ LoadImmediate(
R1, ~kBits5And35);
2530 __ movz(
R0, Immediate(0), 0);
2533 __ tbz(&l2,
R1, 35);
2534 __ movz(
R0, Immediate(0), 0);
2542 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2545 "movn r1, #0x8 lsl 32\n"
2546 "movk r1, #0xffdf\n"
2557 __ movz(
R0, Immediate(0), 0);
2558 __ LoadImmediate(
R1, kBits5And35);
2561 __ movz(
R0, Immediate(42), 0);
2568 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2572 "movk r1, #0x8 lsl 32\n"
2581 __ movz(
R0, Immediate(42), 0);
2582 __ LoadImmediate(
R1, kBits5And35);
2585 __ movz(
R0, Immediate(0), 0);
2588 __ tbnz(&l2,
R1, 35);
2589 __ movz(
R0, Immediate(0), 0);
2597 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2601 "movk r1, #0x8 lsl 32\n"
2602 "tbnzw r1, #5, +8\n"
2604 "tbnz r1, #35, +8\n"
2612 __ movz(
R0, Immediate(0), 0);
2613 __ LoadImmediate(
R1, ~kBits5And35);
2616 __ movz(
R0, Immediate(42), 0);
2623 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2626 "movn r1, #0x8 lsl 32\n"
2627 "movk r1, #0xffdf\n"
2628 "tbnzw r1, #5, +8\n"
2636 __ movz(
R0, Immediate(42), 0);
2637 __ LoadImmediate(
R1, ~kBits5And35);
2641 const intptr_t kRange = 1 << 14;
2642 for (intptr_t
i = 0;
i < kRange;
i++) {
2646 __ movz(
R0, Immediate(0), 0);
2653 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2659 __ movz(
R0, Immediate(42), 0);
2660 __ LoadImmediate(
R1, kBits5And35);
2664 const intptr_t kRange = 1 << 14;
2665 for (intptr_t
i = 0;
i < kRange;
i++) {
2669 __ movz(
R0, Immediate(0), 0);
2676 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2682 __ LoadDImmediate(
V0, 42.0);
2683 __ LoadDImmediate(
V1, 234.0);
2684 __ LoadDImmediate(
V2, 234.0);
2688 __ LoadDImmediate(
V0, 0.0);
2695 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
2697 "movz tmp, #0x4045 lsl 48\n"
2699 "movz tmp, #0x4000 lsl 32\n"
2700 "movk tmp, #0x406d lsl 48\n"
2702 "movz tmp, #0x4000 lsl 32\n"
2703 "movk tmp, #0x406d lsl 48\n"
2714 __ LoadImmediate(
R0, 41);
2716 __ Stop(
"Hammertime");
2718 for (
int i = 0;
i < 0x10000;
i++) {
2719 __ add(
R0,
R0, Operand(1));
2720 __ sub(
R0,
R0, Operand(1));
2723 __ AddImmediate(
R0,
R0, -1);
2726 __ AddImmediate(
R0,
R0, 1);
2732 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2738 for (
int i = 0;
i < 0x10000;
i++) {
2739 __ add(
R0,
R0, Operand(1));
2740 __ sub(
R0,
R0, Operand(1));
2743 __ LoadImmediate(
R0, 41);
2745 __ Stop(
"Hammertime");
2747 __ AddImmediate(
R0,
R0, -1);
2750 __ AddImmediate(
R0,
R0, 1);
2756 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2761 __ LoadImmediate(
R0, 41);
2764 __ AddImmediate(
R0,
R0, -1);
2767 __ AddImmediate(
R0,
R0, 1);
2770 for (
int i = 0;
i < 0x10000;
i++) {
2771 __ add(
R0,
R0, Operand(1));
2772 __ sub(
R0,
R0, Operand(1));
2776 __ tbnz(&l2,
R0, 5);
2777 __ Stop(
"Hammertime");
2782 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2788 __ LoadDImmediate(
V0, 0.0);
2789 __ LoadDImmediate(
V1, 233.0);
2790 __ LoadDImmediate(
V2, 234.0);
2794 __ LoadDImmediate(
V0, 42.0);
2801 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
2804 "movz tmp, #0x2000 lsl 32\n"
2805 "movk tmp, #0x406d lsl 48\n"
2807 "movz tmp, #0x4000 lsl 32\n"
2808 "movk tmp, #0x406d lsl 48\n"
2812 "movz tmp, #0x4045 lsl 48\n"
2820 __ LoadDImmediate(
V0, 42.0);
2821 __ LoadDImmediate(
V1, 233.0);
2822 __ LoadDImmediate(
V2, 234.0);
2826 __ LoadDImmediate(
V0, 0.0);
2833 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
2839 __ LoadDImmediate(
V0, 0.0);
2840 __ LoadDImmediate(
V1, 235.0);
2841 __ LoadDImmediate(
V2, 234.0);
2845 __ LoadDImmediate(
V0, 42.0);
2852 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
2855 "movz tmp, #0x6000 lsl 32\n"
2856 "movk tmp, #0x406d lsl 48\n"
2858 "movz tmp, #0x4000 lsl 32\n"
2859 "movk tmp, #0x406d lsl 48\n"
2863 "movz tmp, #0x4045 lsl 48\n"
2871 __ LoadDImmediate(
V0, 235.0);
2872 __ LoadDImmediate(
V1, 233.0);
2876 __ LoadDImmediate(
V0, 0.0);
2879 __ LoadDImmediate(
V0, 42.0);
2885 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
2887 "movz tmp, #0x6000 lsl 32\n"
2888 "movk tmp, #0x406d lsl 48\n"
2890 "movz tmp, #0x2000 lsl 32\n"
2891 "movk tmp, #0x406d lsl 48\n"
2897 "movz tmp, #0x4045 lsl 48\n"
2905 __ movz(
R0, Immediate(42), 0);
2906 __ movz(
R1, Immediate(2), 0);
2907 __ movz(
R2, Immediate(1), 0);
2911 __ movz(
R0, Immediate(0), 0);
2918 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2932 __ movz(
R0, Immediate(0), 0);
2933 __ movz(
R1, Immediate(2), 0);
2934 __ movz(
R2, Immediate(2), 0);
2938 __ movz(
R0, Immediate(42), 0);
2945 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2959 __ movz(
R0, Immediate(42), 0);
2960 __ movz(
R1, Immediate(2), 0);
2961 __ movz(
R2, Immediate(2), 0);
2965 __ movz(
R0, Immediate(0), 0);
2972 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
2986 __ movz(
R0, Immediate(0), 0);
2987 __ movz(
R1, Immediate(2), 0);
2988 __ movz(
R2, Immediate(1), 0);
2992 __ movz(
R0, Immediate(42), 0);
2999 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3013 __ movz(
R0, Immediate(42), 0);
3014 __ movz(
R1, Immediate(2), 0);
3016 __ andis(
R3,
R1, Immediate(1));
3018 __ movz(
R0, Immediate(0), 0);
3025 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3029 "ands r3, r1, 0x1\n"
3038 __ movz(
R0, Immediate(0), 0);
3039 __ movz(
R1, Immediate(2), 0);
3041 __ andis(
R3,
R1, Immediate(2));
3043 __ movz(
R0, Immediate(42), 0);
3050 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3054 "ands r3, r1, 0x2\n"
3062 __ movz(
R0, Immediate(123), 0);
3069 __ movz(
R0, Immediate(42), 0);
3075 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3079 __ movz(
R0, Immediate(123), 0);
3080 SPILLS_RETURN_ADDRESS_FROM_LR_TO_REGISTER(
3085 RESTORES_RETURN_ADDRESS_FROM_REGISTER_TO_LR(
__ add(
LR,
ZR, Operand(
R3)));
3089 __ movz(
R0, Immediate(42), 0);
3095 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3100 __ movz(
R0, Immediate(27), 0);
3101 __ movz(
R1, Immediate(9), 0);
3110 EXPECT_EQ(3, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3120 __ movz(
R0, Immediate(27), 0);
3121 __ movz(
R1, Immediate(9), 0);
3131 EXPECT_EQ(-3, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3142 __ movz(
R0, Immediate(27), 0);
3143 __ movz(
R1, Immediate(0), 0);
3152 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3162 __ movz(
R0, Immediate(27), 0);
3163 __ movz(
R1, Immediate(0), 0);
3172 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3182 __ movz(
R0, Immediate(0x8000), 3);
3183 __ movn(
R1, Immediate(0), 0);
3192 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3194 "movz r0, #0x8000 lsl 48\n"
3202 __ movz(
R3, Immediate(0x8000), 3);
3203 __ movn(
R1, Immediate(0), 0);
3212 EXPECT_EQ(
static_cast<int64_t
>(0x8000000000000000),
3213 EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3215 "movz r3, #0x8000 lsl 48\n"
3223 __ movz(
R1, Immediate(21), 0);
3224 __ movz(
R2, Immediate(1), 0);
3231 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3240 __ movz(
R1, Immediate(84), 0);
3241 __ movz(
R2, Immediate(1), 0);
3248 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3257 __ movz(
R1, Immediate(1), 0);
3258 __ movz(
R2, Immediate(63), 0);
3266 EXPECT_EQ(1, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3276 __ movz(
R1, Immediate(1), 0);
3277 __ movz(
R2, Immediate(63), 0);
3285 EXPECT_EQ(-1, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3295 __ movz(
R1, Immediate(6), 0);
3296 __ movz(
R2, Immediate(7), 0);
3303 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3312 __ movz(
R1, Immediate(6), 0);
3313 __ movz(
R2, Immediate(7), 0);
3321 EXPECT_EQ(-42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3331 __ movz(
R1, Immediate(6), 0);
3332 __ movz(
R2, Immediate(7), 0);
3339 EXPECT_EQ(0, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3343 "smulh r0, r1, r2\n"
3348 __ movz(
R1, Immediate(6), 0);
3349 __ movz(
R2, Immediate(7), 0);
3357 EXPECT_EQ(-1, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3362 "smulh r0, r1, r2\n"
3367 __ movz(
R1, Immediate(-1), 3);
3368 __ movz(
R2, Immediate(7), 3);
3375 EXPECT_EQ(
static_cast<int64_t
>(0x6fff900000000),
3376 EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3378 "movz r1, #0xffff lsl 48\n"
3379 "movz r2, #0x7 lsl 48\n"
3380 "umulh r0, r1, r2\n"
3385 __ movn(
R1, Immediate(0), 0);
3386 __ movz(
R2, Immediate(7), 0);
3387 __ movz(
R3, Immediate(8), 0);
3394 EXPECT_EQ(0x700000001, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3399 "umaddl r0, r1, r2, r3\n"
3404 __ movn(
R1, Immediate(1), 0);
3405 __ movz(
R2, Immediate(7), 0);
3406 __ movz(
R3, Immediate(20), 0);
3413 EXPECT_EQ(6, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3418 "smaddl r0, r1, r2, r3\n"
3423 __ movn(
R1, Immediate(1), 0);
3424 __ movn(
R2, Immediate(0), 0);
3431 EXPECT_EQ(2, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3435 "smull r0, r1, r2\n"
3440 __ movz(
R1, Immediate(0xffff), 0);
3441 __ movz(
R2, Immediate(0xffff), 0);
3448 EXPECT_EQ(0xfffe0001, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3450 "movz r1, #0xffff\n"
3451 "movz r2, #0xffff\n"
3452 "smull r0, r1, r2\n"
3458 __ movz(
R1, Immediate(0xffff), 0);
3459 __ AddImmediate(
R1, 4);
3460 __ movz(
R2, Immediate(0x7fff), 0);
3462 __ AsrImmediate(
R3,
R0, 31);
3464 __ b(&return_ltuae,
NE);
3467 __ movz(
R0, Immediate(42), 0);
3473 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3475 "movz r1, #0xffff\n"
3476 "add r1, r1, #0x4\n"
3477 "movz r2, #0x7fff\n"
3478 "smull r0, r1, r2\n"
3480 "cmp r3, r0 asr #63\n"
3489 __ movz(
R1, Immediate(0xffff), 0);
3490 __ movn(
R2, Immediate(0xffff), 0);
3491 __ AddImmediate(
R2, -3);
3493 __ AsrImmediate(
R3,
R0, 31);
3495 __ b(&return_ltuae,
NE);
3498 __ movz(
R0, Immediate(42), 0);
3504 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3506 "movz r1, #0xffff\n"
3507 "movn r2, #0xffff\n"
3508 "sub r2, r2, #0x3\n"
3509 "smull r0, r1, r2\n"
3511 "cmp r3, r0 asr #63\n"
3520 __ LoadImmediate(
R1, 0x01007fff);
3521 __ LoadImmediate(
R2, 0x01007fff);
3523 __ AsrImmediate(
R3,
R0, 31);
3525 __ b(&return_ltuae,
NE);
3528 __ movz(
R0, Immediate(42), 0);
3534 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3536 "movz r1, #0x7fff\n"
3537 "movk r1, #0x100 lsl 16\n"
3538 "movz r2, #0x7fff\n"
3539 "movk r2, #0x100 lsl 16\n"
3540 "smull r0, r1, r2\n"
3542 "cmp r3, r0 asr #63\n"
3551 __ LoadImmediate(
R1, 0x7fffffff);
3554 __ b(&return_ltuae,
VS);
3557 __ movz(
R0, Immediate(42), 0);
3563 EXPECT_EQ(-0x7fffffff, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3565 "mov r1, 0x7fffffff\n"
3576 __ LoadImmediate(
R1, 0x7123);
3579 __ b(&return_ltuae,
VS);
3582 __ movz(
R0, Immediate(42), 0);
3588 EXPECT_EQ(-0x7123, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3590 "movz r1, #0x7123\n"
3601 __ LoadImmediate(
R1, -0x80000000ll);
3604 __ b(&return_ltuae,
VS);
3607 __ movz(
R0, Immediate(42), 0);
3613 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3615 "mov r1, 0xffffffff80000000\n"
3626 __ LoadImmediate(
R0, 42);
3632 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3639 __ LoadImmediate(
R0, 0xf1234123);
3645 EXPECT_EQ(0xf1234123, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3647 "movz r0, #0x4123\n"
3648 "movk r0, #0xf123 lsl 16\n"
3653 __ LoadImmediate(
R0, 0x4321f1234123);
3659 EXPECT_EQ(0x4321f1234123,
3660 EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3662 "movz r0, #0x4123\n"
3663 "movk r0, #0xf123 lsl 16\n"
3664 "movk r0, #0x4321 lsl 32\n"
3669 __ LoadImmediate(
R0, 0x9287436598237465);
3675 EXPECT_EQ(
static_cast<int64_t
>(0x9287436598237465),
3676 EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3678 "movz r0, #0x7465\n"
3679 "movk r0, #0x9823 lsl 16\n"
3680 "movk r0, #0x4365 lsl 32\n"
3681 "movk r0, #0x9287 lsl 48\n"
3686 __ LoadImmediate(
R0, -42);
3692 EXPECT_EQ(-42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3699 __ LoadImmediate(
R0, -0x1212341234);
3705 EXPECT_EQ(-0x1212341234, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3707 "movn r0, #0x12 lsl 32\n"
3708 "movk r0, #0xedcb lsl 16\n"
3709 "movk r0, #0xedcc\n"
3714 __ LoadImmediate(
R0, -0x1212340000);
3720 EXPECT_EQ(-0x1212340000, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3722 "movn r0, #0x12 lsl 32\n"
3723 "movk r0, #0xedcc lsl 16\n"
3729 __ LoadImmediate(
R0, -0x1200001234);
3735 EXPECT_EQ(-0x1200001234, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3737 "movn r0, #0x12 lsl 32\n"
3738 "movk r0, #0xedcc\n"
3743 __ LoadImmediate(
R0, -0x12341234);
3749 EXPECT_EQ(-0x12341234, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
3751 "movn r0, #0x1234 lsl 16\n"
3752 "movk r0, #0xedcc\n"
3764 typedef intptr_t (*LoadHalfWordUnaligned)(intptr_t)
DART_UNUSED;
3773 static_cast<int16_t
>(
static_cast<uint16_t
>(0xAB89)),
3774 EXECUTE_TEST_CODE_INTPTR_INTPTR(LoadHalfWordUnaligned,
test->entry(),
3775 reinterpret_cast<intptr_t
>(&
buffer[0])));
3777 static_cast<int16_t
>(
static_cast<uint16_t
>(0xCDAB)),
3778 EXECUTE_TEST_CODE_INTPTR_INTPTR(LoadHalfWordUnaligned,
test->entry(),
3779 reinterpret_cast<intptr_t
>(&
buffer[1])));
3794 typedef intptr_t (*LoadHalfWordUnsignedUnaligned)(intptr_t)
DART_UNUSED;
3802 EXPECT_EQ(0xAB89, EXECUTE_TEST_CODE_INTPTR_INTPTR(
3803 LoadHalfWordUnsignedUnaligned,
test->entry(),
3804 reinterpret_cast<intptr_t
>(&
buffer[0])));
3805 EXPECT_EQ(0xCDAB, EXECUTE_TEST_CODE_INTPTR_INTPTR(
3806 LoadHalfWordUnsignedUnaligned,
test->entry(),
3807 reinterpret_cast<intptr_t
>(&
buffer[1])));
3815 __ LoadImmediate(
R1, 0xABCD);
3823 typedef intptr_t (*StoreHalfWordUnaligned)(intptr_t)
DART_UNUSED;
3831 EXPECT_EQ(0xABCD, EXECUTE_TEST_CODE_INTPTR_INTPTR(
3832 StoreHalfWordUnaligned,
test->entry(),
3833 reinterpret_cast<intptr_t
>(&
buffer[0])));
3834 EXPECT_EQ(0xCD,
buffer[0]);
3835 EXPECT_EQ(0xAB,
buffer[1]);
3838 EXPECT_EQ(0xABCD, EXECUTE_TEST_CODE_INTPTR_INTPTR(
3839 StoreHalfWordUnaligned,
test->entry(),
3840 reinterpret_cast<intptr_t
>(&
buffer[1])));
3841 EXPECT_EQ(0xCD,
buffer[1]);
3842 EXPECT_EQ(0xAB,
buffer[2]);
3845 "movz r1, #0xabcd\n"
3859 typedef int32_t (*LoadWordUnaligned)(intptr_t)
DART_UNUSED;
3860 uint8_t
buffer[8] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0};
3863 static_cast<int32_t
>(0x78563412),
3864 EXECUTE_TEST_CODE_INT32_INTPTR(LoadWordUnaligned,
test->entry(),
3865 reinterpret_cast<intptr_t
>(&
buffer[0])));
3867 static_cast<int32_t
>(0x9A785634),
3868 EXECUTE_TEST_CODE_INT32_INTPTR(LoadWordUnaligned,
test->entry(),
3869 reinterpret_cast<intptr_t
>(&
buffer[1])));
3871 static_cast<int32_t
>(0xBC9A7856),
3872 EXECUTE_TEST_CODE_INT32_INTPTR(LoadWordUnaligned,
test->entry(),
3873 reinterpret_cast<intptr_t
>(&
buffer[2])));
3875 static_cast<int32_t
>(0xDEBC9A78),
3876 EXECUTE_TEST_CODE_INT32_INTPTR(LoadWordUnaligned,
test->entry(),
3877 reinterpret_cast<intptr_t
>(&
buffer[3])));
3885 __ LoadImmediate(
R1, 0x12345678);
3893 typedef intptr_t (*StoreWordUnaligned)(intptr_t)
DART_UNUSED;
3894 uint8_t
buffer[8] = {0, 0, 0, 0, 0, 0, 0, 0};
3896 EXPECT_EQ(0x12345678, EXECUTE_TEST_CODE_INTPTR_INTPTR(
3897 StoreWordUnaligned,
test->entry(),
3898 reinterpret_cast<intptr_t
>(&
buffer[0])));
3899 EXPECT_EQ(0x78,
buffer[0]);
3900 EXPECT_EQ(0x56,
buffer[1]);
3901 EXPECT_EQ(0x34,
buffer[2]);
3902 EXPECT_EQ(0x12,
buffer[3]);
3904 EXPECT_EQ(0x12345678, EXECUTE_TEST_CODE_INTPTR_INTPTR(
3905 StoreWordUnaligned,
test->entry(),
3906 reinterpret_cast<intptr_t
>(&
buffer[1])));
3907 EXPECT_EQ(0x78,
buffer[1]);
3908 EXPECT_EQ(0x56,
buffer[2]);
3909 EXPECT_EQ(0x34,
buffer[3]);
3910 EXPECT_EQ(0x12,
buffer[4]);
3912 EXPECT_EQ(0x12345678, EXECUTE_TEST_CODE_INTPTR_INTPTR(
3913 StoreWordUnaligned,
test->entry(),
3914 reinterpret_cast<intptr_t
>(&
buffer[2])));
3915 EXPECT_EQ(0x78,
buffer[2]);
3916 EXPECT_EQ(0x56,
buffer[3]);
3917 EXPECT_EQ(0x34,
buffer[4]);
3918 EXPECT_EQ(0x12,
buffer[5]);
3920 EXPECT_EQ(0x12345678, EXECUTE_TEST_CODE_INTPTR_INTPTR(
3921 StoreWordUnaligned,
test->entry(),
3922 reinterpret_cast<intptr_t
>(&
buffer[3])));
3923 EXPECT_EQ(0x78,
buffer[3]);
3924 EXPECT_EQ(0x56,
buffer[4]);
3925 EXPECT_EQ(0x34,
buffer[5]);
3926 EXPECT_EQ(0x12,
buffer[6]);
3929 "movz r1, #0x5678\n"
3930 "movk r1, #0x1234 lsl 16\n"
3946 __ RestorePinnedRegisters();
3947 __ LoadPoolPointer(
PP);
3963 __ LoadImmediate(
R0, 42);
3969 EXPECT_EQ(42,
test->InvokeWithCodeAndThread<int64_t>());
3974 __ LoadImmediate(
R0, 0xf1234123);
3980 EXPECT_EQ(0xf1234123,
test->InvokeWithCodeAndThread<int64_t>());
3985 __ LoadImmediate(
R0, 0x4321f1234124);
3991 EXPECT_EQ(0x4321f1234124,
test->InvokeWithCodeAndThread<int64_t>());
3996 __ LoadImmediate(
R0, 0x9287436598237465);
4002 EXPECT_EQ(
static_cast<int64_t
>(0x9287436598237465),
4003 test->InvokeWithCodeAndThread<int64_t>());
4009 __ LoadObject(
R0, Object::null_object());
4016 test->InvokeWithCodeAndThread<
uword>());
4022 __ PushObject(Object::null_object());
4030 test->InvokeWithCodeAndThread<
uword>());
4036 __ LoadObject(
R0, Object::bool_true());
4037 __ LoadObject(
R1, Object::bool_false());
4038 __ ldr(
R2, Address(
THR, Thread::object_null_offset()));
4039 __ CompareObject(
R2, Object::null_object());
4047 test->InvokeWithCodeAndThread<
uword>());
4059 test->InvokeWithCodeAndThread<
uword>());
4071 test->InvokeWithCodeAndThread<
uword>());
4075 __ LoadImmediate(
R1, 42);
4076 __ LoadImmediate(
R2, 1234);
4077 __ CompareRegisters(
R1,
R2);
4084 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4089 "csel r0, r1, r2, lt\n"
4094 __ LoadImmediate(
R1, 42);
4095 __ LoadImmediate(
R2, 1234);
4096 __ CompareRegisters(
R1,
R2);
4103 EXPECT_EQ(1234, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4108 "csel r0, r1, r2, ge\n"
4113 __ LoadImmediate(
R1, 42);
4114 __ LoadImmediate(
R2, 1234);
4115 __ CompareRegisters(
R1,
R2);
4122 EXPECT_EQ(43, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4126 __ LoadImmediate(
R1, 42);
4127 __ LoadImmediate(
R2, 1234);
4128 __ CompareRegisters(
R1,
R2);
4135 EXPECT_EQ(1234, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4145 __ LoadImmediate(
R1, 42);
4146 __ LoadImmediate(
R2, 1234);
4147 __ CompareRegisters(
R1,
R2);
4154 EXPECT_EQ(~42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4159 "csinv r0, r2, r1, ge\n"
4164 __ LoadImmediate(
R1, 42);
4165 __ LoadImmediate(
R2, 1234);
4166 __ CompareRegisters(
R1,
R2);
4173 EXPECT_EQ(1234, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4178 "csinv r0, r2, r1, lt\n"
4183 __ LoadImmediate(
R1, 42);
4184 __ LoadImmediate(
R2, 1234);
4185 __ CompareRegisters(
R1,
R2);
4192 EXPECT_EQ(-42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4197 "csneg r0, r2, r1, ge\n"
4202 __ LoadImmediate(
R1, 42);
4203 __ LoadImmediate(
R2, 1234);
4204 __ CompareRegisters(
R1,
R2);
4211 EXPECT_EQ(1234, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4216 "csneg r0, r2, r1, lt\n"
4221 __ LoadImmediate(
R1, 0x819);
4222 __ LoadImmediate(
R0, 0x5a5a5a5a);
4229 EXPECT_EQ(0x81, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4232 "movz r0, #0x5a5a\n"
4233 "movk r0, #0x5a5a lsl 16\n"
4234 "ubfm r0, r1, #4, #11\n"
4239 __ LoadImmediate(
R1, 0x819);
4240 __ LoadImmediate(
R0, 0x5a5a5a5a);
4247 EXPECT_EQ(-0x7f, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4250 "movz r0, #0x5a5a\n"
4251 "movk r0, #0x5a5a lsl 16\n"
4252 "sbfm r0, r1, #4, #11\n"
4257 __ LoadImmediate(
R1, 0x819);
4258 __ LoadImmediate(
R0, 0x5a5a5a5a);
4265 EXPECT_EQ(0x5a5b9a5a, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4268 "movz r0, #0x5a5a\n"
4269 "movk r0, #0x5a5a lsl 16\n"
4270 "bfm r0, r1, #52, #4\n"
4275 __ LoadImmediate(
R1, 0xff1248ff);
4276 __ LoadImmediate(
R0, 0x5a5a5a5a);
4284 EXPECT_EQ(0x7e2491fe, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4286 "movz r1, #0x48ff\n"
4287 "movk r1, #0xff12 lsl 16\n"
4288 "movz r0, #0x5a5a\n"
4289 "movk r0, #0x5a5a lsl 16\n"
4290 "ubfm r0, r1, #63, #29\n"
4295 __ LoadImmediate(
R1, 0x819);
4296 __ LoadImmediate(
R0, 0x5a5a5a5a);
4303 EXPECT_EQ(0x5a5a5a81, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4306 "movz r0, #0x5a5a\n"
4307 "movk r0, #0x5a5a lsl 16\n"
4308 "bfm r0, r1, #4, #11\n"
4313 __ LoadImmediate(
R1, 0x819);
4314 __ LoadImmediate(
R0, 0x5a5a5a5a);
4321 EXPECT_EQ(-0x7e70, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4324 "movz r0, #0x5a5a\n"
4325 "movk r0, #0x5a5a lsl 16\n"
4326 "sbfm r0, r1, #60, #11\n"
4331 __ LoadImmediate(
R1, 0xff);
4332 __ LoadImmediate(
R0, 0x5a5a5a5a);
4334 __ LoadImmediate(
R2, 0x2a);
4335 __ LoadImmediate(
R1, 0x5a5a5a5a);
4343 EXPECT_EQ(0x29, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4346 "movz r0, #0x5a5a\n"
4347 "movk r0, #0x5a5a lsl 16\n"
4350 "movz r1, #0x5a5a\n"
4351 "movk r1, #0x5a5a lsl 16\n"
4358 __ LoadImmediate(
R1, 0xffff);
4359 __ LoadImmediate(
R0, 0x5a5a5a5a);
4361 __ LoadImmediate(
R2, 0x1002a);
4362 __ LoadImmediate(
R1, 0x5a5a5a5a);
4370 EXPECT_EQ(0x29, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4373 "movz r0, #0x5a5a\n"
4374 "movk r0, #0x5a5a lsl 16\n"
4377 "movk r2, #0x1 lsl 16\n"
4378 "movz r1, #0x5a5a\n"
4379 "movk r1, #0x5a5a lsl 16\n"
4386 __ LoadImmediate(
R1, 0xffffffffll);
4387 __ LoadImmediate(
R0, 0x5a5a5a5a);
4389 __ LoadImmediate(
R2, 0x10000002all);
4390 __ LoadImmediate(
R1, 0x5a5a5a5a);
4398 EXPECT_EQ(0x29, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4400 "mov r1, 0xffffffff\n"
4401 "movz r0, #0x5a5a\n"
4402 "movk r0, #0x5a5a lsl 16\n"
4405 "movk r2, #0x1 lsl 32\n"
4406 "movz r1, #0x5a5a\n"
4407 "movk r1, #0x5a5a lsl 16\n"
4414 __ LoadImmediate(
R1, 0xffffffffll);
4415 __ LoadImmediate(
R0, 0x5a5a5a5a);
4417 __ LoadImmediate(
R2, 0x10000002all);
4418 __ LoadImmediate(
R1, 0x5a5a5a5a);
4426 EXPECT_EQ(0xffffffffll + 42,
4427 EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4429 "mov r1, 0xffffffff\n"
4430 "movz r0, #0x5a5a\n"
4431 "movk r0, #0x5a5a lsl 16\n"
4432 "ubfm r0, r1, #0, #31\n"
4434 "movk r2, #0x1 lsl 32\n"
4435 "movz r1, #0x5a5a\n"
4436 "movk r1, #0x5a5a lsl 16\n"
4437 "ubfm r1, r2, #0, #31\n"
4443 __ LoadImmediate(
R1, -1);
4444 __ LoadImmediate(
R0, 0x5a5a5a5a);
4446 __ LoadImmediate(
R2, 0x12a);
4447 __ LoadImmediate(
R1, 0x5a5a5a5a);
4455 EXPECT_EQ(0xff + 0x2a, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4458 "movz r0, #0x5a5a\n"
4459 "movk r0, #0x5a5a lsl 16\n"
4462 "movz r1, #0x5a5a\n"
4463 "movk r1, #0x5a5a lsl 16\n"
4470 __ LoadImmediate(
R1, -1);
4471 __ LoadImmediate(
R0, 0x5a5a5a5a);
4473 __ LoadImmediate(
R2, 0x1002a);
4474 __ LoadImmediate(
R1, 0x5a5a5a5a);
4482 EXPECT_EQ(0xffff + 0x2a, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4485 "movz r0, #0x5a5a\n"
4486 "movk r0, #0x5a5a lsl 16\n"
4489 "movk r2, #0x1 lsl 16\n"
4490 "movz r1, #0x5a5a\n"
4491 "movk r1, #0x5a5a lsl 16\n"
4499 __ LoadDImmediate(
V0, 1.0);
4505 EXPECT_EQ(1.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
4507 "fmovd v0, 1.000000\n"
4512 __ LoadDImmediate(
V0, 123412983.1324524315);
4518 EXPECT_FLOAT_EQ(123412983.1324524315,
4519 EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()),
4522 "movz tmp, #0xa19c\n"
4523 "movk tmp, #0xdc87 lsl 16\n"
4524 "movk tmp, #0x6c87 lsl 32\n"
4525 "movk tmp, #0x419d lsl 48\n"
4531 __ LoadDImmediate(
V1, 1.0);
4538 const int64_t one = bit_cast<int64_t, double>(1.0);
4539 EXPECT_EQ(one, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4541 "fmovd v1, 1.000000\n"
4547 __ LoadDImmediate(
V1, 1.0);
4555 EXPECT_EQ(1.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
4557 "fmovd v1, 1.000000\n"
4564 __ LoadDImmediate(
V2, 1.0);
4572 int64_t
result = EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry());
4573 const uint32_t one = bit_cast<uint32_t, float>(1.0f);
4574 EXPECT_EQ(one,
static_cast<uint32_t
>(
result));
4576 "fmovd v2, 1.000000\n"
4583 __ LoadImmediate(
R2, bit_cast<uint32_t, float>(1.0f));
4591 int64_t
result = EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry());
4592 const uint32_t one = bit_cast<uint32_t, float>(1.0f);
4593 EXPECT_EQ(one,
static_cast<uint32_t
>(
result));
4595 "mov r2, 0x3f800000\n"
4607 __ LoadDImmediate(
V1, 42.0);
4616 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
4619 "sub csp, csp, #0x1000\n"
4620 "sub csp, csp, #0x10\n"
4621 "movz tmp, #0x4045 lsl 48\n"
4623 "fstrd v1, [sp, #-8]!\n"
4624 "fldrd v0, [sp], #8 !\n"
4635 __ LoadDImmediate(
V1, 42.0);
4646 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
4649 "sub csp, csp, #0x1000\n"
4650 "sub csp, csp, #0x10\n"
4651 "movz tmp, #0x4045 lsl 48\n"
4654 "fstrs v2, [sp, #-8]!\n"
4655 "fldrs v3, [sp], #8 !\n"
4667 __ LoadDImmediate(
V1, 21.0);
4668 __ LoadDImmediate(
V2, 21.0);
4669 __ LoadImmediate(
R1, 42);
4685 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
4688 "sub csp, csp, #0x1000\n"
4689 "sub csp, csp, #0x10\n"
4690 "fmovd v1, 21.000000\n"
4691 "fmovd v2, 21.000000\n"
4693 "str r1, [sp, #-8]!\n"
4694 "fstrd v1, [sp, #-8]!\n"
4695 "fstrd v2, [sp, #-8]!\n"
4696 "fldrq v3, [sp], #16 !\n"
4697 "ldr r0, [sp], #8 !\n"
4698 "fstrq v3, [sp, #-16]!\n"
4699 "fldrd v0, [sp], #8 !\n"
4700 "fldrd v1, [sp], #8 !\n"
4701 "faddd v0, v0, v1\n"
4707 __ LoadDImmediate(
V0, 42.5);
4714 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4716 "movz tmp, #0x4000 lsl 32\n"
4717 "movk tmp, #0x4045 lsl 48\n"
4724 __ LoadDImmediate(
V0, -42.5);
4732 EXPECT_EQ(-42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4734 "movz tmp, #0x4000 lsl 32\n"
4735 "movk tmp, #0xc045 lsl 48\n"
4743 __ LoadDImmediate(
V0, 1e20);
4750 EXPECT_EQ(
kMaxInt64, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4754 __ LoadDImmediate(
V0, -1e20);
4761 EXPECT_EQ(
kMinInt64, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4763 "movz tmp, #0x8c40\n"
4764 "movk tmp, #0x78b5 lsl 16\n"
4765 "movk tmp, #0xaf1d lsl 32\n"
4766 "movk tmp, #0xc415 lsl 48\n"
4773 __ LoadDImmediate(
V0, 1e10);
4780 EXPECT_EQ(
kMaxInt32, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4782 "movz tmp, #0x2000 lsl 16\n"
4783 "movk tmp, #0xa05f lsl 32\n"
4784 "movk tmp, #0x4202 lsl 48\n"
4791 __ LoadDImmediate(
V0, -1e10);
4799 EXPECT_EQ(
kMinInt32, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4801 "movz tmp, #0x2000 lsl 16\n"
4802 "movk tmp, #0xa05f lsl 32\n"
4803 "movk tmp, #0xc202 lsl 48\n"
4811 __ LoadDImmediate(
V0, 42.5);
4818 EXPECT_EQ(43, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4820 "movz tmp, #0x4000 lsl 32\n"
4821 "movk tmp, #0x4045 lsl 48\n"
4828 __ LoadDImmediate(
V0, -42.5);
4836 EXPECT_EQ(-42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4838 "movz tmp, #0x4000 lsl 32\n"
4839 "movk tmp, #0xc045 lsl 48\n"
4847 __ LoadDImmediate(
V0, 1e20);
4854 EXPECT_EQ(
kMaxInt64, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4856 "movz tmp, #0x8c40\n"
4857 "movk tmp, #0x78b5 lsl 16\n"
4858 "movk tmp, #0xaf1d lsl 32\n"
4859 "movk tmp, #0x4415 lsl 48\n"
4866 __ LoadDImmediate(
V0, -1e20);
4873 EXPECT_EQ(
kMinInt64, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4875 "movz tmp, #0x8c40\n"
4876 "movk tmp, #0x78b5 lsl 16\n"
4877 "movk tmp, #0xaf1d lsl 32\n"
4878 "movk tmp, #0xc415 lsl 48\n"
4885 __ LoadDImmediate(
V0, 1e10);
4892 EXPECT_EQ(
kMaxInt32, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4894 "movz tmp, #0x2000 lsl 16\n"
4895 "movk tmp, #0xa05f lsl 32\n"
4896 "movk tmp, #0x4202 lsl 48\n"
4903 __ LoadDImmediate(
V0, -1e10);
4911 EXPECT_EQ(
kMinInt32, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4913 "movz tmp, #0x2000 lsl 16\n"
4914 "movk tmp, #0xa05f lsl 32\n"
4915 "movk tmp, #0xc202 lsl 48\n"
4923 __ LoadDImmediate(
V0, 42.5);
4930 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4932 "movz tmp, #0x4000 lsl 32\n"
4933 "movk tmp, #0x4045 lsl 48\n"
4940 __ LoadDImmediate(
V0, -42.5);
4948 EXPECT_EQ(-43, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4950 "movz tmp, #0x4000 lsl 32\n"
4951 "movk tmp, #0xc045 lsl 48\n"
4959 __ LoadDImmediate(
V0, 1e20);
4966 EXPECT_EQ(
kMaxInt64, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4968 "movz tmp, #0x8c40\n"
4969 "movk tmp, #0x78b5 lsl 16\n"
4970 "movk tmp, #0xaf1d lsl 32\n"
4971 "movk tmp, #0x4415 lsl 48\n"
4978 __ LoadDImmediate(
V0, -1e20);
4985 EXPECT_EQ(
kMinInt64, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
4987 "movz tmp, #0x8c40\n"
4988 "movk tmp, #0x78b5 lsl 16\n"
4989 "movk tmp, #0xaf1d lsl 32\n"
4990 "movk tmp, #0xc415 lsl 48\n"
4997 __ LoadDImmediate(
V0, 1e10);
5004 EXPECT_EQ(
kMaxInt32, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
5006 "movz tmp, #0x2000 lsl 16\n"
5007 "movk tmp, #0xa05f lsl 32\n"
5008 "movk tmp, #0x4202 lsl 48\n"
5015 __ LoadDImmediate(
V0, -1e10);
5023 EXPECT_EQ(
kMinInt32, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
5025 "movz tmp, #0x2000 lsl 16\n"
5026 "movk tmp, #0xa05f lsl 32\n"
5027 "movk tmp, #0xc202 lsl 48\n"
5035 __ LoadImmediate(
R0, 42);
5042 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5051 __ LoadImmediate(
R0, 0x111111110000002A);
5058 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5061 "movk r0, #0x1111 lsl 32\n"
5062 "movk r0, #0x1111 lsl 48\n"
5068 __ LoadDImmediate(
V1, 42.0);
5075 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5077 "movz tmp, #0x4045 lsl 48\n"
5084 __ LoadDImmediate(
V1, -42.0);
5091 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5093 "movz tmp, #0xc045 lsl 48\n"
5100 __ LoadDImmediate(
V1, 42.0);
5107 EXPECT_EQ(-42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5109 "movz tmp, #0x4045 lsl 48\n"
5116 __ LoadDImmediate(
V1, -42.0);
5123 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5125 "movz tmp, #0xc045 lsl 48\n"
5132 __ LoadDImmediate(
V1, 64.0);
5139 EXPECT_EQ(8.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5141 "movz tmp, #0x4050 lsl 48\n"
5148 __ LoadDImmediate(
V1, 84.0);
5149 __ LoadDImmediate(
V2, 0.5);
5156 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5158 "movz tmp, #0x4055 lsl 48\n"
5160 "fmovd v2, 0.500000\n"
5161 "fmuld v0, v1, v2\n"
5166 __ LoadDImmediate(
V1, 84.0);
5167 __ LoadDImmediate(
V2, 2.0);
5174 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5176 "movz tmp, #0x4055 lsl 48\n"
5178 "fmovd v2, 2.000000\n"
5179 "fdivd v0, v1, v2\n"
5184 __ LoadDImmediate(
V1, 41.5);
5185 __ LoadDImmediate(
V2, 0.5);
5192 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5194 "movz tmp, #0xc000 lsl 32\n"
5195 "movk tmp, #0x4044 lsl 48\n"
5197 "fmovd v2, 0.500000\n"
5198 "faddd v0, v1, v2\n"
5203 __ LoadDImmediate(
V1, 42.5);
5204 __ LoadDImmediate(
V2, 0.5);
5211 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5213 "movz tmp, #0x4000 lsl 32\n"
5214 "movk tmp, #0x4045 lsl 48\n"
5216 "fmovd v2, 0.500000\n"
5217 "fsubd v0, v1, v2\n"
5223 __ LoadDImmediate(
V0, 43.0);
5224 __ LoadDImmediate(
V1, 42.0);
5226 __ add(
R2,
SP, Operand(1));
5227 __ fstrd(
V1, Address(
R2, -1));
5228 __ fldrd(
V0, Address(
R2, -1));
5236 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5239 "sub csp, csp, #0x1000\n"
5240 "movz tmp, #0x8000 lsl 32\n"
5241 "movk tmp, #0x4045 lsl 48\n"
5243 "movz tmp, #0x4045 lsl 48\n"
5245 "sub sp, sp, #0x8\n"
5246 "add r2, sp, #0x1\n"
5247 "fstrd v1, [r2, #-1]\n"
5248 "fldrd v0, [r2, #-1]\n"
5249 "add sp, sp, #0x8\n"
5260 __ LoadDImmediate(
V0, 43.0);
5261 __ LoadDImmediate(
V1, 42.0);
5274 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5277 "sub csp, csp, #0x1000\n"
5278 "sub csp, csp, #0x100\n"
5279 "movz tmp, #0x8000 lsl 32\n"
5280 "movk tmp, #0x4045 lsl 48\n"
5282 "movz tmp, #0x4045 lsl 48\n"
5284 "fstrd v1, [sp, #-256]!\n"
5285 "fldrd v0, [sp], #248 !\n"
5286 "add sp, sp, #0x8\n"
5293 __ LoadDImmediate(
V0, 43.0);
5294 __ LoadDImmediate(
V1, 42.0);
5296 __ andi(
CSP,
SP, Immediate(~15));
5299 __ fldrd(
V0, Address(
SP));
5306 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5309 "sub csp, csp, #0x1000\n"
5310 "movz tmp, #0x8000 lsl 32\n"
5311 "movk tmp, #0x4045 lsl 48\n"
5313 "movz tmp, #0x4045 lsl 48\n"
5315 "sub sp, sp, #0x1000\n"
5316 "and csp, sp, 0xfffffffffffffff0\n"
5317 "fstrd v1, [sp, #4096]\n"
5318 "add sp, sp, #0x1000\n"
5326 __ LoadDImmediate(
V0, 43.0);
5327 __ LoadDImmediate(
V1, 42.0);
5328 __ movz(
R2, Immediate(0xfff8), 0);
5329 __ movk(
R2, Immediate(0xffff), 1);
5334 __ andi(
CSP,
SP, Immediate(~15));
5335 __ fldrd(
V0, Address(
SP));
5343 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5346 "sub csp, csp, #0x1000\n"
5347 "movz tmp, #0x8000 lsl 32\n"
5348 "movk tmp, #0x4045 lsl 48\n"
5350 "movz tmp, #0x4045 lsl 48\n"
5352 "movz r2, #0xfff8\n"
5353 "movk r2, #0xffff lsl 16\n"
5354 "fstrd v1, [sp, r2 sxtw]\n"
5355 "sub sp, sp, #0x8\n"
5356 "and csp, sp, 0xfffffffffffffff0\n"
5358 "add sp, sp, #0x8\n"
5365 __ LoadDImmediate(
V0, 43.0);
5366 __ LoadDImmediate(
V1, 42.0);
5367 __ movz(
R2, Immediate(10), 0);
5369 __ andi(
CSP,
SP, Immediate(~15));
5380 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5383 "sub csp, csp, #0x1000\n"
5384 "movz tmp, #0x8000 lsl 32\n"
5385 "movk tmp, #0x4045 lsl 48\n"
5387 "movz tmp, #0x4045 lsl 48\n"
5390 "sub sp, sp, #0x50\n"
5391 "and csp, sp, 0xfffffffffffffff0\n"
5392 "fstrd v1, [sp, r2 uxtx scaled]\n"
5393 "fldrd v0, [sp, r2 uxtx scaled]\n"
5394 "add sp, sp, #0x50\n"
5400 __ LoadImmediate(
R0, 42);
5401 __ LoadImmediate(
R1, 43);
5402 __ LoadImmediate(
R2, 44);
5403 __ LoadImmediate(
R3, 45);
5424 EXPECT_EQ(174, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
5434 "vmovrs r4, v0[0]\n"
5435 "vmovrs r5, v0[1]\n"
5436 "vmovrs r6, v0[2]\n"
5437 "vmovrs r7, v0[3]\n"
5445 __ LoadImmediate(
R0, 42);
5446 __ LoadImmediate(
R1, 43);
5461 EXPECT_EQ(85, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
5467 "vmovrd r2, v0[0]\n"
5468 "vmovrd r3, v0[1]\n"
5474 __ LoadImmediate(
R0, 0xfffffffe);
5475 __ LoadImmediate(
R1, 0xffffffff);
5496 EXPECT_EQ(2, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
5498 "mov r0, 0xfffffffe\n"
5499 "mov r1, 0xffffffff\n"
5505 "vmovrs r2, v0[0]\n"
5506 "vmovrs r3, v0[1]\n"
5507 "vmovrs r4, v0[2]\n"
5508 "vmovrs r5, v0[3]\n"
5516 __ LoadDImmediate(
V1, 21.0);
5517 __ LoadDImmediate(
V2, -21.0);
5540 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5542 "fmovd v1, 21.000000\n"
5543 "fmovd v2, -21.000000\n"
5547 "vinss v3[1], v1[0]\n"
5548 "vinss v3[3], v2[0]\n"
5550 "vinss v5[0], v4[1]\n"
5551 "vinss v6[0], v4[3]\n"
5554 "faddd v0, v5, v6\n"
5559 __ LoadDImmediate(
V1, 21.0);
5560 __ LoadDImmediate(
V2, -21.0);
5576 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5578 "fmovd v1, 21.000000\n"
5579 "fmovd v2, -21.000000\n"
5580 "vinsd v3[0], v1[0]\n"
5581 "vinsd v3[1], v2[0]\n"
5583 "vinsd v5[0], v4[0]\n"
5584 "vinsd v6[0], v4[1]\n"
5585 "faddd v0, v5, v6\n"
5590 __ LoadDImmediate(
V1, 42.0);
5591 __ LoadDImmediate(
V2, -84.0);
5613 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5615 "movz tmp, #0x4045 lsl 48\n"
5617 "movz tmp, #0xc055 lsl 48\n"
5622 "vinss v3[1], v1[0]\n"
5623 "vinss v3[3], v2[0]\n"
5625 "vinss v5[0], v4[1]\n"
5626 "vinss v6[0], v4[3]\n"
5629 "faddd v0, v5, v6\n"
5634 __ LoadDImmediate(
V1, 42.0);
5635 __ LoadDImmediate(
V2, -84.0);
5651 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5654 "movz tmp, #0x4045 lsl 48\n"
5656 "movz tmp, #0xc055 lsl 48\n"
5658 "vinsd v3[0], v1[0]\n"
5659 "vinsd v3[1], v2[0]\n"
5661 "vinsd v5[0], v4[0]\n"
5662 "vinsd v6[0], v4[1]\n"
5663 "faddd v0, v5, v6\n"
5668 __ LoadDImmediate(
V0, 0.0);
5669 __ LoadDImmediate(
V1, 1.0);
5670 __ LoadDImmediate(
V2, 2.0);
5671 __ LoadDImmediate(
V3, 3.0);
5703 EXPECT_EQ(12.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5706 "fmovd v1, 1.000000\n"
5707 "fmovd v2, 2.000000\n"
5708 "fmovd v3, 3.000000\n"
5713 "vinss v4[0], v0[0]\n"
5714 "vinss v4[1], v1[0]\n"
5715 "vinss v4[2], v2[0]\n"
5716 "vinss v4[3], v3[0]\n"
5717 "vadds v5, v4, v4\n"
5718 "vinss v0[0], v5[0]\n"
5719 "vinss v1[0], v5[1]\n"
5720 "vinss v2[0], v5[2]\n"
5721 "vinss v3[0], v5[3]\n"
5726 "faddd v0, v0, v1\n"
5727 "faddd v0, v0, v2\n"
5728 "faddd v0, v0, v3\n"
5733 __ LoadDImmediate(
V0, 0.0);
5734 __ LoadDImmediate(
V1, 1.0);
5735 __ LoadDImmediate(
V2, 2.0);
5736 __ LoadDImmediate(
V3, 3.0);
5737 __ LoadDImmediate(
V5, 0.0);
5769 EXPECT_EQ(-6.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5772 "fmovd v1, 1.000000\n"
5773 "fmovd v2, 2.000000\n"
5774 "fmovd v3, 3.000000\n"
5780 "vinss v4[0], v0[0]\n"
5781 "vinss v4[1], v1[0]\n"
5782 "vinss v4[2], v2[0]\n"
5783 "vinss v4[3], v3[0]\n"
5784 "vsubs v5, v5, v4\n"
5785 "vinss v0[0], v5[0]\n"
5786 "vinss v1[0], v5[1]\n"
5787 "vinss v2[0], v5[2]\n"
5788 "vinss v3[0], v5[3]\n"
5793 "faddd v0, v0, v1\n"
5794 "faddd v0, v0, v2\n"
5795 "faddd v0, v0, v3\n"
5800 __ LoadDImmediate(
V0, 0.0);
5801 __ LoadDImmediate(
V1, 1.0);
5802 __ LoadDImmediate(
V2, 2.0);
5803 __ LoadDImmediate(
V3, 3.0);
5835 EXPECT_EQ(14.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5838 "fmovd v1, 1.000000\n"
5839 "fmovd v2, 2.000000\n"
5840 "fmovd v3, 3.000000\n"
5845 "vinss v4[0], v0[0]\n"
5846 "vinss v4[1], v1[0]\n"
5847 "vinss v4[2], v2[0]\n"
5848 "vinss v4[3], v3[0]\n"
5849 "vmuls v5, v4, v4\n"
5850 "vinss v0[0], v5[0]\n"
5851 "vinss v1[0], v5[1]\n"
5852 "vinss v2[0], v5[2]\n"
5853 "vinss v3[0], v5[3]\n"
5858 "faddd v0, v0, v1\n"
5859 "faddd v0, v0, v2\n"
5860 "faddd v0, v0, v3\n"
5865 __ LoadDImmediate(
V0, 0.0);
5866 __ LoadDImmediate(
V1, 1.0);
5867 __ LoadDImmediate(
V2, 2.0);
5868 __ LoadDImmediate(
V3, 3.0);
5900 EXPECT_EQ(4.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5903 "fmovd v1, 1.000000\n"
5904 "fmovd v2, 2.000000\n"
5905 "fmovd v3, 3.000000\n"
5910 "vinss v4[0], v0[0]\n"
5911 "vinss v4[1], v1[0]\n"
5912 "vinss v4[2], v2[0]\n"
5913 "vinss v4[3], v3[0]\n"
5914 "vdivs v5, v4, v4\n"
5915 "vinss v0[0], v5[0]\n"
5916 "vinss v1[0], v5[1]\n"
5917 "vinss v2[0], v5[2]\n"
5918 "vinss v3[0], v5[3]\n"
5923 "faddd v0, v1, v1\n"
5924 "faddd v0, v0, v2\n"
5925 "faddd v0, v0, v3\n"
5930 __ LoadDImmediate(
V0, 2.0);
5931 __ LoadDImmediate(
V1, 3.0);
5947 EXPECT_EQ(10.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5950 "fmovd v0, 2.000000\n"
5951 "fmovd v1, 3.000000\n"
5952 "vinsd v4[0], v0[0]\n"
5953 "vinsd v4[1], v1[0]\n"
5954 "vaddd v5, v4, v4\n"
5955 "vinsd v0[0], v5[0]\n"
5956 "vinsd v1[0], v5[1]\n"
5957 "faddd v0, v0, v1\n"
5962 __ LoadDImmediate(
V0, 2.0);
5963 __ LoadDImmediate(
V1, 3.0);
5964 __ LoadDImmediate(
V5, 0.0);
5980 EXPECT_EQ(-5.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
5982 "fmovd v0, 2.000000\n"
5983 "fmovd v1, 3.000000\n"
5985 "vinsd v4[0], v0[0]\n"
5986 "vinsd v4[1], v1[0]\n"
5987 "vsubd v5, v5, v4\n"
5988 "vinsd v0[0], v5[0]\n"
5989 "vinsd v1[0], v5[1]\n"
5990 "faddd v0, v0, v1\n"
5995 __ LoadDImmediate(
V0, 2.0);
5996 __ LoadDImmediate(
V1, 3.0);
6012 EXPECT_EQ(13.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
6015 "fmovd v0, 2.000000\n"
6016 "fmovd v1, 3.000000\n"
6017 "vinsd v4[0], v0[0]\n"
6018 "vinsd v4[1], v1[0]\n"
6019 "vmuld v5, v4, v4\n"
6020 "vinsd v0[0], v5[0]\n"
6021 "vinsd v1[0], v5[1]\n"
6022 "faddd v0, v0, v1\n"
6027 __ LoadDImmediate(
V0, 2.0);
6028 __ LoadDImmediate(
V1, 3.0);
6044 EXPECT_EQ(2.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
6046 "fmovd v0, 2.000000\n"
6047 "fmovd v1, 3.000000\n"
6048 "vinsd v4[0], v0[0]\n"
6049 "vinsd v4[1], v1[0]\n"
6050 "vdivd v5, v4, v4\n"
6051 "vinsd v0[0], v5[0]\n"
6052 "vinsd v1[0], v5[1]\n"
6053 "faddd v0, v0, v1\n"
6059 __ LoadDImmediate(
V0, 21.0);
6065 __ sub(
CSP,
CSP, Operand(qword_bytes));
6079 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
6083 "sub csp, csp, #0x1000\n"
6084 "fmovd v0, 21.000000\n"
6086 "sub csp, csp, #0x10\n"
6087 "fstrq v1, [sp, #-16]!\n"
6088 "fldrd v2, [sp], #8 !\n"
6089 "fldrd v3, [sp], #8 !\n"
6090 "faddd v0, v2, v3\n"
6097 __ LoadDImmediate(
V0, 21.0);
6104 __ sub(
CSP,
CSP, Operand(qword_bytes));
6127 EXPECT_EQ(84.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
6131 "sub csp, csp, #0x1000\n"
6132 "fmovd v0, 21.000000\n"
6135 "sub csp, csp, #0x10\n"
6136 "fstrq v1, [sp, #-16]!\n"
6137 "fldrs v3, [sp], #4 !\n"
6138 "fldrs v2, [sp], #4 !\n"
6139 "fldrs v1, [sp], #4 !\n"
6140 "fldrs v0, [sp], #4 !\n"
6145 "faddd v0, v1, v1\n"
6146 "faddd v0, v0, v2\n"
6147 "faddd v0, v0, v3\n"
6154 __ LoadDImmediate(
V5, 42.0);
6160 __ sub(
CSP,
CSP, Operand(qword_bytes));
6174 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
6178 "sub csp, csp, #0x1000\n"
6179 "movz tmp, #0x4045 lsl 48\n"
6181 "vinsd v1[1], v5[0]\n"
6182 "sub csp, csp, #0x10\n"
6183 "fstrq v1, [sp, #-16]!\n"
6184 "fldrd v2, [sp], #8 !\n"
6185 "fldrd v3, [sp], #8 !\n"
6194 __ LoadDImmediate(
V0, 21.0);
6200 __ LoadDImmediate(
V0, 0.0);
6208 __ sub(
CSP,
CSP, Operand(qword_bytes));
6231 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
6234 "sub csp, csp, #0x1000\n"
6235 "fmovd v0, 21.000000\n"
6237 "vinss v1[3], v0[0]\n"
6238 "vinss v1[1], v0[0]\n"
6241 "vinss v1[2], v0[0]\n"
6242 "vinss v1[0], v0[0]\n"
6243 "sub csp, csp, #0x10\n"
6244 "fstrq v1, [sp, #-16]!\n"
6245 "fldrs v3, [sp], #4 !\n"
6246 "fldrs v2, [sp], #4 !\n"
6247 "fldrs v1, [sp], #4 !\n"
6248 "fldrs v0, [sp], #4 !\n"
6253 "faddd v0, v0, v1\n"
6254 "faddd v0, v0, v2\n"
6255 "faddd v0, v0, v3\n"
6261 __ LoadDImmediate(
V1, 21.0);
6262 __ LoadImmediate(
R0, 0xffffffff);
6292 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
6294 "fmovd v1, 21.000000\n"
6295 "mov r0, 0xffffffff\n"
6297 "vinss v0[2], v0[0]\n"
6301 "vinss v3[0], v2[0]\n"
6302 "vinss v4[0], v2[1]\n"
6303 "vinss v5[0], v2[2]\n"
6304 "vinss v6[0], v2[3]\n"
6309 "vaddd v0, v3, v4\n"
6310 "vaddd v0, v0, v5\n"
6311 "vaddd v0, v0, v6\n"
6316 __ LoadDImmediate(
V1, 10.5);
6348 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
6350 "fmovd v1, 10.500000\n"
6353 "vinss v0[2], v0[0]\n"
6355 "vinss v1[1], v0[0]\n"
6356 "vinss v1[3], v0[0]\n"
6358 "vinss v3[0], v2[0]\n"
6359 "vinss v4[0], v2[1]\n"
6360 "vinss v5[0], v2[2]\n"
6361 "vinss v6[0], v2[3]\n"
6366 "vaddd v0, v3, v4\n"
6367 "vaddd v0, v0, v5\n"
6368 "vaddd v0, v0, v6\n"
6373 __ LoadImmediate(
R1, 0xffffffff);
6374 __ LoadImmediate(
R2, ~21);
6401 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
6403 "mov r1, 0xffffffff\n"
6414 "vmovrs r3, v0[0]\n"
6415 "vmovrs r4, v0[1]\n"
6416 "vmovrs r5, v0[2]\n"
6417 "vmovrs r6, v0[3]\n"
6425 __ LoadImmediate(
R4, 21);
6444 EXPECT_EQ(168, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
6449 "vaddw v0, v1, v2\n"
6450 "vmovrs r0, v0[0]\n"
6451 "vmovrs r1, v0[1]\n"
6452 "vmovrs r2, v0[2]\n"
6453 "vmovrs r3, v0[3]\n"
6461 __ LoadImmediate(
R4, 31);
6462 __ LoadImmediate(
R5, 10);
6481 EXPECT_EQ(84, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
6487 "vsubw v0, v1, v2\n"
6488 "vmovrs r0, v0[0]\n"
6489 "vmovrs r1, v0[1]\n"
6490 "vmovrs r2, v0[2]\n"
6491 "vmovrs r3, v0[3]\n"
6499 __ LoadImmediate(
R4, 21);
6514 EXPECT_EQ(84, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
6519 "vaddx v0, v1, v2\n"
6520 "vmovrd r0, v0[0]\n"
6521 "vmovrd r1, v0[1]\n"
6527 __ LoadImmediate(
R4, 31);
6528 __ LoadImmediate(
R5, 10);
6543 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
6549 "vsubx v0, v1, v2\n"
6550 "vmovrd r0, v0[0]\n"
6551 "vmovrd r1, v0[1]\n"
6557 __ LoadDImmediate(
V0, 42.0);
6558 __ LoadDImmediate(
V1, -42.0);
6584 EXPECT_EQ(0xfffffffe, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
6586 "movz tmp, #0x4045 lsl 48\n"
6588 "movz tmp, #0xc045 lsl 48\n"
6593 "vinss v3[0], v0[0]\n"
6594 "vinss v3[1], v1[0]\n"
6595 "vinss v3[2], v0[0]\n"
6596 "vinss v3[3], v1[0]\n"
6597 "vceqs v4, v2, v3\n"
6598 "vmovrs r1, v4[0]\n"
6599 "vmovrs r2, v4[1]\n"
6600 "vmovrs r3, v4[2]\n"
6601 "vmovrs r4, v4[3]\n"
6609 __ LoadDImmediate(
V0, 42.0);
6610 __ LoadDImmediate(
V1, -42.0);
6627 EXPECT_EQ(-1, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
6629 "movz tmp, #0x4045 lsl 48\n"
6631 "movz tmp, #0xc045 lsl 48\n"
6634 "vinsd v3[0], v0[0]\n"
6635 "vinsd v3[1], v1[0]\n"
6636 "vceqd v4, v2, v3\n"
6637 "vmovrd r1, v4[0]\n"
6638 "vmovrd r2, v4[1]\n"
6644 __ LoadDImmediate(
V0, 42.0);
6645 __ LoadDImmediate(
V1, -42.0);
6671 EXPECT_EQ(0xfffffffe, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
6673 "movz tmp, #0x4045 lsl 48\n"
6675 "movz tmp, #0xc045 lsl 48\n"
6680 "vinss v3[0], v0[0]\n"
6681 "vinss v3[1], v1[0]\n"
6682 "vinss v3[2], v0[0]\n"
6683 "vinss v3[3], v1[0]\n"
6684 "vcgts v4, v2, v3\n"
6685 "vmovrs r1, v4[0]\n"
6686 "vmovrs r2, v4[1]\n"
6687 "vmovrs r3, v4[2]\n"
6688 "vmovrs r4, v4[3]\n"
6696 __ LoadDImmediate(
V0, 42.0);
6697 __ LoadDImmediate(
V1, -42.0);
6714 EXPECT_EQ(-1, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
6716 "movz tmp, #0x4045 lsl 48\n"
6718 "movz tmp, #0xc045 lsl 48\n"
6721 "vinsd v3[0], v0[0]\n"
6722 "vinsd v3[1], v1[0]\n"
6723 "vcgtd v4, v2, v3\n"
6724 "vmovrd r1, v4[0]\n"
6725 "vmovrd r2, v4[1]\n"
6731 __ LoadDImmediate(
V0, 42.0);
6732 __ LoadDImmediate(
V1, 43.0);
6758 EXPECT_EQ(0xfffffffe, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
6760 "movz tmp, #0x4045 lsl 48\n"
6762 "movz tmp, #0x8000 lsl 32\n"
6763 "movk tmp, #0x4045 lsl 48\n"
6768 "vinss v3[0], v0[0]\n"
6769 "vinss v3[1], v1[0]\n"
6770 "vinss v3[2], v0[0]\n"
6771 "vinss v3[3], v1[0]\n"
6772 "vcges v4, v2, v3\n"
6773 "vmovrs r1, v4[0]\n"
6774 "vmovrs r2, v4[1]\n"
6775 "vmovrs r3, v4[2]\n"
6776 "vmovrs r4, v4[3]\n"
6784 __ LoadDImmediate(
V0, 42.0);
6785 __ LoadDImmediate(
V1, 43.0);
6802 EXPECT_EQ(-1, EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
6804 "movz tmp, #0x4045 lsl 48\n"
6806 "movz tmp, #0x8000 lsl 32\n"
6807 "movk tmp, #0x4045 lsl 48\n"
6810 "vinsd v3[0], v0[0]\n"
6811 "vinsd v3[1], v1[0]\n"
6812 "vcged v4, v2, v3\n"
6813 "vmovrd r1, v4[0]\n"
6814 "vmovrd r2, v4[1]\n"
6829 double d = EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry());
6830 EXPECT_EQ(
true, !signbit(
d) && (
d == 0.0));
6834 "vmaxs v0, v2, v1\n"
6839 __ LoadDImmediate(
V0, 10.5);
6840 __ LoadDImmediate(
V1, 10.0);
6871 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
6873 "fmovd v0, 10.500000\n"
6874 "fmovd v1, 10.000000\n"
6878 "vinss v3[0], v0[0]\n"
6879 "vinss v3[1], v1[0]\n"
6880 "vinss v3[2], v0[0]\n"
6881 "vinss v3[3], v1[0]\n"
6882 "vmaxs v4, v2, v3\n"
6883 "vinss v0[0], v4[0]\n"
6884 "vinss v1[0], v4[1]\n"
6885 "vinss v2[0], v4[2]\n"
6886 "vinss v3[0], v4[3]\n"
6891 "faddd v0, v0, v1\n"
6892 "faddd v0, v0, v2\n"
6893 "faddd v0, v0, v3\n"
6907 double d = EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry());
6908 EXPECT_EQ(
true, !signbit(
d) && (
d == 0.0));
6912 "vmaxd v0, v2, v1\n"
6917 __ LoadDImmediate(
V0, 21.0);
6918 __ LoadDImmediate(
V1, 20.5);
6935 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
6937 "fmovd v0, 21.000000\n"
6938 "movz tmp, #0x8000 lsl 32\n"
6939 "movk tmp, #0x4034 lsl 48\n"
6942 "vinsd v3[0], v0[0]\n"
6943 "vinsd v3[1], v1[0]\n"
6944 "vmaxd v4, v2, v3\n"
6945 "vinsd v0[0], v4[0]\n"
6946 "vinsd v1[0], v4[1]\n"
6947 "faddd v0, v0, v1\n"
6961 double d = EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry());
6962 fprintf(stderr,
"d: %f\n",
d);
6963 EXPECT_EQ(
true, signbit(
d) && (
d == 0.0));
6967 "vmins v0, v1, v2\n"
6972 __ LoadDImmediate(
V0, 10.5);
6973 __ LoadDImmediate(
V1, 11.0);
7004 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
7006 "fmovd v0, 10.500000\n"
7007 "fmovd v1, 11.000000\n"
7011 "vinss v3[0], v0[0]\n"
7012 "vinss v3[1], v1[0]\n"
7013 "vinss v3[2], v0[0]\n"
7014 "vinss v3[3], v1[0]\n"
7015 "vmins v4, v2, v3\n"
7016 "vinss v0[0], v4[0]\n"
7017 "vinss v1[0], v4[1]\n"
7018 "vinss v2[0], v4[2]\n"
7019 "vinss v3[0], v4[3]\n"
7024 "faddd v0, v0, v1\n"
7025 "faddd v0, v0, v2\n"
7026 "faddd v0, v0, v3\n"
7040 double d = EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry());
7041 fprintf(stderr,
"d: %f\n",
d);
7042 EXPECT_EQ(
true, signbit(
d) && (
d == 0.0));
7046 "vmind v0, v1, v2\n"
7051 __ LoadDImmediate(
V0, 21.0);
7052 __ LoadDImmediate(
V1, 21.5);
7069 EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
7071 "fmovd v0, 21.000000\n"
7072 "movz tmp, #0x8000 lsl 32\n"
7073 "movk tmp, #0x4035 lsl 48\n"
7076 "vinsd v3[0], v0[0]\n"
7077 "vinsd v3[1], v1[0]\n"
7078 "vmind v4, v2, v3\n"
7079 "vinsd v0[0], v4[0]\n"
7080 "vinsd v1[0], v4[1]\n"
7081 "faddd v0, v0, v1\n"
7086 __ LoadDImmediate(
V0, 64.0);
7087 __ LoadDImmediate(
V1, 49.0);
7110 EXPECT_EQ(15.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
7112 "movz tmp, #0x4050 lsl 48\n"
7114 "movz tmp, #0x8000 lsl 32\n"
7115 "movk tmp, #0x4048 lsl 48\n"
7120 "vinss v3[1], v0[0]\n"
7121 "vinss v3[3], v1[0]\n"
7123 "vinss v5[0], v4[1]\n"
7124 "vinss v6[0], v4[3]\n"
7127 "faddd v0, v5, v6\n"
7132 __ LoadDImmediate(
V0, 64.0);
7133 __ LoadDImmediate(
V1, 49.0);
7149 EXPECT_EQ(15.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry()));
7151 "movz tmp, #0x4050 lsl 48\n"
7153 "movz tmp, #0x8000 lsl 32\n"
7154 "movk tmp, #0x4048 lsl 48\n"
7156 "vinsd v3[0], v0[0]\n"
7157 "vinsd v3[1], v1[0]\n"
7159 "vinsd v5[0], v4[0]\n"
7160 "vinsd v6[0], v4[1]\n"
7161 "faddd v0, v5, v6\n"
7166static float arm_recip_estimate(
float a) {
7168 if (isinf(
a) || (fabs(
a) >= exp2f(126)))
7175 uint32_t a_bits = bit_cast<uint32_t, float>(
a);
7177 uint64_t scaled = (
static_cast<uint64_t
>(0x3fe) << 52) |
7178 ((
static_cast<uint64_t
>(a_bits) & 0x7fffff) << 29);
7180 int32_t result_exp = 253 - ((a_bits >> 23) & 0xff);
7181 ASSERT((result_exp >= 1) && (result_exp <= 252));
7183 double scaled_d = bit_cast<double, uint64_t>(scaled);
7184 ASSERT((scaled_d >= 0.5) && (scaled_d < 1.0));
7187 int32_t q =
static_cast<int32_t
>(scaled_d * 512.0);
7189 double r = 1.0 / ((
static_cast<double>(q) + 0.5) / 512.0);
7191 int32_t
s =
static_cast<int32_t
>(256.0 * r + 0.5);
7192 double estimate =
static_cast<double>(
s) / 256.0;
7193 ASSERT((estimate >= 1.0) && (estimate <= (511.0 / 256.0)));
7196 int32_t result_bits =
7197 (a_bits & 0x80000000) | ((result_exp & 0xff) << 23) |
7198 ((bit_cast<uint64_t, double>(estimate) >> 29) & 0x7fffff);
7199 return bit_cast<float, int32_t>(result_bits);
7203 __ LoadDImmediate(
V1, 147.0);
7217 float res = EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry());
7218 EXPECT_FLOAT_EQ(arm_recip_estimate(147.0), res, 0.0001);
7220 "movz tmp, #0x6000 lsl 32\n"
7221 "movk tmp, #0x4062 lsl 48\n"
7224 "vinss v2[0], v1[0]\n"
7225 "vinss v2[1], v1[0]\n"
7226 "vinss v2[2], v1[0]\n"
7227 "vinss v2[3], v1[0]\n"
7234 __ LoadDImmediate(
V1, 5.0);
7235 __ LoadDImmediate(
V2, 10.0);
7249 double res = EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry());
7250 EXPECT_FLOAT_EQ(2.0 - 10.0 * 5.0, res, 0.0001);
7252 "fmovd v1, 5.000000\n"
7253 "fmovd v2, 10.000000\n"
7256 "vrecpss v0, v1, v2\n"
7262 __ LoadDImmediate(
V0, 1.0 / 10.5);
7287 double res = EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry());
7288 EXPECT_FLOAT_EQ(42.0, res, 0.0001);
7290 "movz tmp, #0x8618\n"
7291 "movk tmp, #0x1861 lsl 16\n"
7292 "movk tmp, #0x6186 lsl 32\n"
7293 "movk tmp, #0x3fb8 lsl 48\n"
7298 "vrecpss v31, v1, v2\n"
7299 "vmuls v2, v2, v31\n"
7300 "vrecpss v31, v1, v2\n"
7301 "vmuls v2, v2, v31\n"
7302 "vinss v0[0], v2[0]\n"
7303 "vinss v1[0], v2[1]\n"
7304 "vinss v2[0], v2[2]\n"
7305 "vinss v3[0], v2[3]\n"
7310 "faddd v0, v0, v1\n"
7311 "faddd v0, v0, v2\n"
7312 "faddd v0, v0, v3\n"
7316static float arm_reciprocal_sqrt_estimate(
float a) {
7318 if (isinf(
a) || (fabs(
a) >= exp2f(126)))
7325 uint32_t a_bits = bit_cast<uint32_t, float>(
a);
7327 if (((a_bits >> 23) & 1) != 0) {
7329 scaled = (
static_cast<uint64_t
>(0x3fd) << 52) |
7330 ((
static_cast<uint64_t
>(a_bits) & 0x7fffff) << 29);
7333 scaled = (
static_cast<uint64_t
>(0x3fe) << 52) |
7334 ((
static_cast<uint64_t
>(a_bits) & 0x7fffff) << 29);
7337 int32_t result_exp = (380 - ((a_bits >> 23) & 0xff)) / 2;
7339 double scaled_d = bit_cast<double, uint64_t>(scaled);
7340 ASSERT((scaled_d >= 0.25) && (scaled_d < 1.0));
7343 if (scaled_d < 0.5) {
7347 int32_t q0 =
static_cast<int32_t
>(scaled_d * 512.0);
7349 r = 1.0 /
sqrt((
static_cast<double>(q0) + 0.5) / 512.0);
7354 int32_t q1 =
static_cast<int32_t
>(scaled_d * 256.0);
7356 r = 1.0 /
sqrt((
static_cast<double>(q1) + 0.5) / 256.0);
7359 int32_t
s =
static_cast<int>(256.0 * r + 0.5);
7360 double estimate =
static_cast<double>(
s) / 256.0;
7361 ASSERT((estimate >= 1.0) && (estimate <= (511.0 / 256.0)));
7364 int32_t result_bits =
7365 ((result_exp & 0xff) << 23) |
7366 ((bit_cast<uint64_t, double>(estimate) >> 29) & 0x7fffff);
7367 return bit_cast<float, int32_t>(result_bits);
7371 __ LoadDImmediate(
V1, 147.0);
7383 double res = EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry());
7384 EXPECT_FLOAT_EQ(arm_reciprocal_sqrt_estimate(147.0), res, 0.0001);
7386 "movz tmp, #0x6000 lsl 32\n"
7387 "movk tmp, #0x4062 lsl 48\n"
7396 __ LoadDImmediate(
V1, 5.0);
7397 __ LoadDImmediate(
V2, 10.0);
7411 double res = EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry());
7412 EXPECT_FLOAT_EQ((3.0 - 10.0 * 5.0) / 2.0, res, 0.0001);
7414 "fmovd v1, 5.000000\n"
7415 "fmovd v2, 10.000000\n"
7418 "vrsqrts v0, v1, v2\n"
7424 __ LoadDImmediate(
V1, 147000.0);
7436 double res = EXECUTE_TEST_CODE_DOUBLE(DoubleReturn,
test->entry());
7437 EXPECT_FLOAT_EQ(1.0 /
sqrt(147000.0), res, 0.0001);
7439 "movz tmp, #0xf1c0 lsl 32\n"
7440 "movk tmp, #0x4101 lsl 48\n"
7444 "vmuls v31, v0, v0\n"
7445 "vrsqrts v31, v1, v31\n"
7446 "vmuls v0, v0, v31\n"
7447 "vmuls v31, v0, v0\n"
7448 "vrsqrts v31, v1, v31\n"
7449 "vmuls v0, v0, v31\n"
7464 SPILLS_LR_TO_FRAME(
__ Push(
LR));
7468 __ StoreCompressedIntoObject(
7470 RESTORES_LR_FROM_FRAME(
__ Pop(
LR));
7481const intptr_t kMaxPushedNumber = 913;
7485 for (intptr_t
i = kMaxPushedNumber;
i >= 0;
i--) {
7486 __ PushImmediate(
i);
7488 __ Drop(kMaxPushedNumber);
7497 EXPECT_EQ(kMaxPushedNumber,
7498 EXECUTE_TEST_CODE_INT64(Int64Return,
test->entry()));
7507 typedef intptr_t (*IntPtrReturn)(intptr_t)
DART_UNUSED;
7508 EXPECT_EQ(0xfffffe00,
7509 EXECUTE_TEST_CODE_INTPTR_INTPTR(IntPtrReturn,
test->entry(), -42));
7510 EXPECT_EQ(0, EXECUTE_TEST_CODE_INTPTR_INTPTR(IntPtrReturn,
test->entry(), 0));
7512 EXECUTE_TEST_CODE_INTPTR_INTPTR(IntPtrReturn,
test->entry(), 42));
7514 "andw r0, r0, 0xfffffe00\n"
7524 typedef intptr_t (*IntPtrReturn)(intptr_t)
DART_UNUSED;
7525 EXPECT_EQ(0xffffffd6,
7526 EXECUTE_TEST_CODE_INTPTR_INTPTR(IntPtrReturn,
test->entry(), -42));
7527 EXPECT_EQ(0xfffffe00,
7528 EXECUTE_TEST_CODE_INTPTR_INTPTR(IntPtrReturn,
test->entry(), 0));
7529 EXPECT_EQ(0xfffffe2a,
7530 EXECUTE_TEST_CODE_INTPTR_INTPTR(IntPtrReturn,
test->entry(), 42));
7532 "orrw r0, r0, 0xfffffe00\n"
7542 typedef intptr_t (*IntPtrReturn)(intptr_t)
DART_UNUSED;
7544 EXECUTE_TEST_CODE_INTPTR_INTPTR(IntPtrReturn,
test->entry(), -42));
7545 EXPECT_EQ(0xfffffe00,
7546 EXECUTE_TEST_CODE_INTPTR_INTPTR(IntPtrReturn,
test->entry(), 0));
7547 EXPECT_EQ(0xfffffe2a,
7548 EXECUTE_TEST_CODE_INTPTR_INTPTR(IntPtrReturn,
test->entry(), 42));
7550 "eorw r0, r0, 0xfffffe00\n"
7558 __ LoadImmediate(
R0, 1);
7561 __ LoadImmediate(
R0, 0);
7566 typedef intptr_t (*IntPtrReturn)(intptr_t)
DART_UNUSED;
7568 EXECUTE_TEST_CODE_INTPTR_INTPTR(IntPtrReturn,
test->entry(), -42));
7569 EXPECT_EQ(0, EXECUTE_TEST_CODE_INTPTR_INTPTR(IntPtrReturn,
test->entry(), 0));
7571 EXECUTE_TEST_CODE_INTPTR_INTPTR(IntPtrReturn,
test->entry(), 42));
7573 "tstw r0, 0xfffffe00\n"
7585 __ LoadImmediate(
R0, 0);
7588 __ LoadImmediate(
R0, 1);
7593 typedef intptr_t (*IntPtrReturn)(intptr_t)
DART_UNUSED;
7595 EXECUTE_TEST_CODE_INTPTR_INTPTR(IntPtrReturn,
test->entry(), -513));
7597 EXECUTE_TEST_CODE_INTPTR_INTPTR(IntPtrReturn,
test->entry(), -512));
7599 EXECUTE_TEST_CODE_INTPTR_INTPTR(IntPtrReturn,
test->entry(), -511));
7610#if !defined(USING_THREAD_SANITIZER)
7615 __ LoadImmediate(
R1, 0);
7618 __ LoadImmediate(
R0, 0);
7619 __ StoreReleaseToOffset(
R1,
SP, 0);
7620 __ LoadAcquireFromOffset(
R0,
SP, 0);
7628 typedef intptr_t (*StoreReleaseLoadAcquire)(intptr_t)
DART_UNUSED;
7629 EXPECT_EQ(123, EXECUTE_TEST_CODE_INTPTR_INTPTR(StoreReleaseLoadAcquire,
7630 test->entry(), 123));
7633 "sub csp, csp, #0x1000\n"
7634 "str r1, [sp, #-8]!\n"
7636 "str r1, [sp, #-8]!\n"
7641 "ldr r1, [sp], #8 !\n"
7642 "ldr r1, [sp], #8 !\n"
7650 __ LoadImmediate(
R1, 0);
7653 __ LoadImmediate(
R0, 0);
7655 __ StoreReleaseToOffset(
R1,
SP, 1024);
7656 __ LoadAcquireFromOffset(
R0,
SP, 1024);
7665 typedef intptr_t (*StoreReleaseLoadAcquire1024)(intptr_t)
DART_UNUSED;
7666 EXPECT_EQ(123, EXECUTE_TEST_CODE_INTPTR_INTPTR(StoreReleaseLoadAcquire1024,
7667 test->entry(), 123));
7670 "sub csp, csp, #0x1000\n"
7671 "str r1, [sp, #-8]!\n"
7673 "str r1, [sp, #-8]!\n"
7676 "sub sp, sp, #0x2000\n"
7677 "add tmp2, sp, #0x400\n"
7679 "add tmp2, sp, #0x400\n"
7681 "add sp, sp, #0x2000\n"
7682 "ldr r1, [sp], #8 !\n"
7683 "ldr r1, [sp], #8 !\n"
7694 __ LoadImmediate(return_reg, Immediate(0));
7697 __ LoadImmediate(return_reg, Immediate(1));
7704 RangeCheck(assembler,
value, temp);
7709 result =
test->Invoke<intptr_t, intptr_t>(kErrorCid);
7711 result =
test->Invoke<intptr_t, intptr_t>(kUnwindErrorCid);
7713 result =
test->Invoke<intptr_t, intptr_t>(kFunctionCid);
7715 result =
test->Invoke<intptr_t, intptr_t>(kMintCid);
7722 RangeCheck(assembler,
value, temp);
7727 result =
test->Invoke<intptr_t, intptr_t>(kErrorCid);
7729 result =
test->Invoke<intptr_t, intptr_t>(kUnwindErrorCid);
7731 result =
test->Invoke<intptr_t, intptr_t>(kFunctionCid);
7733 result =
test->Invoke<intptr_t, intptr_t>(kMintCid);
7751 result =
test->Invoke<intptr_t, intptr_t>(kErrorCid);
7752 EXPECT_EQ(kErrorCid,
result);
7753 result =
test->Invoke<intptr_t, intptr_t>(kUnwindErrorCid);
7754 EXPECT_EQ(kUnwindErrorCid,
result);
7755 result =
test->Invoke<intptr_t, intptr_t>(kFunctionCid);
7756 EXPECT_EQ(kFunctionCid,
result);
7757 result =
test->Invoke<intptr_t, intptr_t>(kMintCid);
7758 EXPECT_EQ(kMintCid,
result);
7764 const auto& do_nothing_just_return =
7768 SPILLS_LR_TO_FRAME({
__ PushRegister(
LR); });
7770 const RegisterSet clobbered_regs(
7773 __ PushRegisters(clobbered_regs);
7777 const auto check_all_allocatable_registers_are_preserved_by_call = [&]() {
7779 __ LoadImmediate(reg,
static_cast<int32_t
>(reg));
7781 __ BranchLink(do_nothing_just_return);
7784 if (!FLAG_precompiled_mode && reg ==
CODE_REG)
continue;
7787 __ CompareImmediate(reg,
static_cast<int32_t
>(reg));
7789 __ LoadImmediate(
R0, reg);
7795 check_all_allocatable_registers_are_preserved_by_call();
7797 FLAG_precompiled_mode =
true;
7798 check_all_allocatable_registers_are_preserved_by_call();
7799 FLAG_precompiled_mode =
false;
7801 __ LoadImmediate(
R0, 42);
7803 __ PopRegisters(clobbered_regs);
7804 RESTORES_LR_FROM_FRAME({
__ PopRegister(
LR); });
7810 const intptr_t
result =
test->InvokeWithCodeAndThread<int64_t>();
static void done(const char *config, const char *src, const char *srcOptions, const char *name)
static bool ok(int result)
static const Code & Generate(const char *name, const std::function< void(compiler::Assembler *assembler)> &generator)
static const Bool & False()
static const Bool & True()
static const Register ArgumentRegisters[]
static constexpr Register kReturnReg
static intptr_t data_offset()
static intptr_t write_barrier_mask_offset()
static Address Pair(Register rn, int32_t offset=0, AddressType at=PairOffset)
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
const uint8_t uint32_t uint32_t GError ** error
static constexpr intptr_t kWordSize
static int Log2OperandSizeBytes(OperandSize os)
void LeaveTestFrame(Assembler *assembler)
ASSEMBLER_TEST_GENERATE(InstantiateTypeArgumentsHashKeys, assembler)
void EnterTestFrame(Assembler *assembler)
constexpr int64_t kMaxInt64
constexpr int64_t kMinInt64
static Utils::BitsRange< Register > RegisterRange(uint32_t regs)
constexpr int32_t kMinInt32
static const ClassId kLastErrorCid
static const ClassId kFirstErrorCid
constexpr RegList kDartAvailableCpuRegs
ASSEMBLER_TEST_RUN(StoreIntoObject, test)
constexpr int32_t kMaxInt32
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
static bool Bind(PassBindingsCacheMTL &pass, ShaderStage stage, size_t bind_index, const BufferView &view)
SIN Vec< N, float > sqrt(const Vec< N, float > &x)