Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(411)

Side by Side Diff: test/cctest/test-disasm-arm.cc

Issue 1776933003: [arm] Basic simulation of msr and mrs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/cctest/test-assembler-arm.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 COMPARE(smmla(r0, r1, r2, r3), "e7503211 smmla r0, r1, r2, r3"); 446 COMPARE(smmla(r0, r1, r2, r3), "e7503211 smmla r0, r1, r2, r3");
447 COMPARE(smmla(r10, r9, r8, r7), "e75a7819 smmla r10, r9, r8, r7"); 447 COMPARE(smmla(r10, r9, r8, r7), "e75a7819 smmla r10, r9, r8, r7");
448 448
449 COMPARE(smmul(r0, r1, r2), "e750f211 smmul r0, r1, r2"); 449 COMPARE(smmul(r0, r1, r2), "e750f211 smmul r0, r1, r2");
450 COMPARE(smmul(r8, r9, r10), "e758fa19 smmul r8, r9, r10"); 450 COMPARE(smmul(r8, r9, r10), "e758fa19 smmul r8, r9, r10");
451 451
452 VERIFY_RUN(); 452 VERIFY_RUN();
453 } 453 }
454 454
455 455
456 TEST(msr_mrs_disasm) {
457 SET_UP();
458
459 SRegisterFieldMask CPSR_all = CPSR_f | CPSR_s | CPSR_x | CPSR_c;
460 SRegisterFieldMask SPSR_all = SPSR_f | SPSR_s | SPSR_x | SPSR_c;
461
462 COMPARE(msr(CPSR_f, Operand(r0)), "e128f000 msr CPSR_f, r0");
463 COMPARE(msr(CPSR_s, Operand(r1)), "e124f001 msr CPSR_s, r1");
464 COMPARE(msr(CPSR_x, Operand(r2)), "e122f002 msr CPSR_x, r2");
465 COMPARE(msr(CPSR_c, Operand(r3)), "e121f003 msr CPSR_c, r3");
466 COMPARE(msr(CPSR_all, Operand(ip)), "e12ff00c msr CPSR_fsxc, ip");
467 COMPARE(msr(SPSR_f, Operand(r0)), "e168f000 msr SPSR_f, r0");
468 COMPARE(msr(SPSR_s, Operand(r1)), "e164f001 msr SPSR_s, r1");
469 COMPARE(msr(SPSR_x, Operand(r2)), "e162f002 msr SPSR_x, r2");
470 COMPARE(msr(SPSR_c, Operand(r3)), "e161f003 msr SPSR_c, r3");
471 COMPARE(msr(SPSR_all, Operand(ip)), "e16ff00c msr SPSR_fsxc, ip");
472 COMPARE(msr(CPSR_f, Operand(r0), eq), "0128f000 msreq CPSR_f, r0");
473 COMPARE(msr(CPSR_s, Operand(r1), ne), "1124f001 msrne CPSR_s, r1");
474 COMPARE(msr(CPSR_x, Operand(r2), cs), "2122f002 msrcs CPSR_x, r2");
475 COMPARE(msr(CPSR_c, Operand(r3), cc), "3121f003 msrcc CPSR_c, r3");
476 COMPARE(msr(CPSR_all, Operand(ip), mi), "412ff00c msrmi CPSR_fsxc, ip");
477 COMPARE(msr(SPSR_f, Operand(r0), pl), "5168f000 msrpl SPSR_f, r0");
478 COMPARE(msr(SPSR_s, Operand(r1), vs), "6164f001 msrvs SPSR_s, r1");
479 COMPARE(msr(SPSR_x, Operand(r2), vc), "7162f002 msrvc SPSR_x, r2");
480 COMPARE(msr(SPSR_c, Operand(r3), hi), "8161f003 msrhi SPSR_c, r3");
481 COMPARE(msr(SPSR_all, Operand(ip), ls), "916ff00c msrls SPSR_fsxc, ip");
482
483 // Other combinations of mask bits.
484 COMPARE(msr(CPSR_s | CPSR_x, Operand(r4)),
485 "e126f004 msr CPSR_sx, r4");
486 COMPARE(msr(SPSR_s | SPSR_x | SPSR_c, Operand(r5)),
487 "e167f005 msr SPSR_sxc, r5");
488 COMPARE(msr(SPSR_s | SPSR_c, Operand(r6)),
489 "e165f006 msr SPSR_sc, r6");
490 COMPARE(msr(SPSR_f | SPSR_c, Operand(r7)),
491 "e169f007 msr SPSR_fc, r7");
492 // MSR with no mask is UNPREDICTABLE, and checked by the assembler, but check
493 // that the disassembler does something sensible.
494 COMPARE(dd(0xe120f008), "e120f008 msr CPSR_(none), r8");
495
496 COMPARE(mrs(r0, CPSR), "e10f0000 mrs r0, CPSR");
497 COMPARE(mrs(r1, SPSR), "e14f1000 mrs r1, SPSR");
498 COMPARE(mrs(r2, CPSR, ge), "a10f2000 mrsge r2, CPSR");
499 COMPARE(mrs(r3, SPSR, lt), "b14f3000 mrslt r3, SPSR");
500
501 VERIFY_RUN();
502 }
503
456 504
457 TEST(Vfp) { 505 TEST(Vfp) {
458 SET_UP(); 506 SET_UP();
459 507
460 if (CpuFeatures::IsSupported(VFP3)) { 508 if (CpuFeatures::IsSupported(VFP3)) {
461 CpuFeatureScope scope(&assm, VFP3); 509 CpuFeatureScope scope(&assm, VFP3);
462 COMPARE(vmov(d0, r2, r3), 510 COMPARE(vmov(d0, r2, r3),
463 "ec432b10 vmov d0, r2, r3"); 511 "ec432b10 vmov d0, r2, r3");
464 COMPARE(vmov(r2, r3, d0), 512 COMPARE(vmov(r2, r3, d0),
465 "ec532b10 vmov r2, r3, d0"); 513 "ec532b10 vmov r2, r3, d0");
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
1066 1114
1067 COMPARE(dsb(ISH), 1115 COMPARE(dsb(ISH),
1068 "f57ff04b dsb ish"); 1116 "f57ff04b dsb ish");
1069 1117
1070 COMPARE(isb(ISH), 1118 COMPARE(isb(ISH),
1071 "f57ff06b isb ish"); 1119 "f57ff06b isb ish");
1072 } 1120 }
1073 1121
1074 VERIFY_RUN(); 1122 VERIFY_RUN();
1075 } 1123 }
OLDNEW
« no previous file with comments | « test/cctest/test-assembler-arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698