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

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

Issue 1986113004: Add cmpxchg and lock instructions to x64 and ia32 {dis,}assemblers (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: merge master Created 4 years, 7 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-disasm-ia32.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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 __ shrxl(rax, Operand(rbx, rcx, times_4, 10000), rbx); 738 __ shrxl(rax, Operand(rbx, rcx, times_4, 10000), rbx);
739 __ rorxq(rax, rbx, 63); 739 __ rorxq(rax, rbx, 63);
740 __ rorxq(rax, Operand(rbx, rcx, times_4, 10000), 63); 740 __ rorxq(rax, Operand(rbx, rcx, times_4, 10000), 63);
741 __ rorxl(rax, rbx, 31); 741 __ rorxl(rax, rbx, 31);
742 __ rorxl(rax, Operand(rbx, rcx, times_4, 10000), 31); 742 __ rorxl(rax, Operand(rbx, rcx, times_4, 10000), 31);
743 } 743 }
744 } 744 }
745 745
746 // xchg. 746 // xchg.
747 { 747 {
748 __ xchgb(rax, Operand(rax, 8));
749 __ xchgw(rax, Operand(rbx, 8));
748 __ xchgq(rax, rax); 750 __ xchgq(rax, rax);
749 __ xchgq(rax, rbx); 751 __ xchgq(rax, rbx);
750 __ xchgq(rbx, rbx); 752 __ xchgq(rbx, rbx);
751 __ xchgq(rbx, Operand(rsp, 12)); 753 __ xchgq(rbx, Operand(rsp, 12));
752 } 754 }
753 755
756 // cmpxchg.
757 {
758 __ cmpxchgb(Operand(rsp, 12), rax);
759 __ cmpxchgw(Operand(rbx, rcx, times_4, 10000), rax);
760 __ cmpxchgl(Operand(rbx, rcx, times_4, 10000), rax);
761 __ cmpxchgq(Operand(rbx, rcx, times_4, 10000), rax);
762 }
763
764 // lock prefix.
765 {
766 __ lock();
767 __ cmpxchgl(Operand(rsp, 12), rbx);
768
769 __ lock();
770 __ xchgw(rax, Operand(rcx, 8));
771 }
772
754 // Nop instructions 773 // Nop instructions
755 for (int i = 0; i < 16; i++) { 774 for (int i = 0; i < 16; i++) {
756 __ Nop(i); 775 __ Nop(i);
757 } 776 }
758 777
759 __ ret(0); 778 __ ret(0);
760 779
761 CodeDesc desc; 780 CodeDesc desc;
762 assm.GetCode(&desc); 781 assm.GetCode(&desc);
763 Handle<Code> code = isolate->factory()->NewCode( 782 Handle<Code> code = isolate->factory()->NewCode(
764 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); 783 desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
765 USE(code); 784 USE(code);
766 #ifdef OBJECT_PRINT 785 #ifdef OBJECT_PRINT
767 OFStream os(stdout); 786 OFStream os(stdout);
768 code->Print(os); 787 code->Print(os);
769 byte* begin = code->instruction_start(); 788 byte* begin = code->instruction_start();
770 byte* end = begin + code->instruction_size(); 789 byte* end = begin + code->instruction_size();
771 disasm::Disassembler::Disassemble(stdout, begin, end); 790 disasm::Disassembler::Disassemble(stdout, begin, end);
772 #endif 791 #endif
773 } 792 }
774 793
775 #undef __ 794 #undef __
OLDNEW
« no previous file with comments | « test/cctest/test-disasm-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698