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

Side by Side Diff: src/arm/simulator-arm.cc

Issue 2821014: Add movw and movt support for ARMv7. This includes some code from... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 1841 matching lines...) Expand 10 before | Expand all | Expand 10 after
1852 } 1852 }
1853 1853
1854 case TST: { 1854 case TST: {
1855 if (instr->HasS()) { 1855 if (instr->HasS()) {
1856 // Format(instr, "tst'cond 'rn, 'shift_rm"); 1856 // Format(instr, "tst'cond 'rn, 'shift_rm");
1857 // Format(instr, "tst'cond 'rn, 'imm"); 1857 // Format(instr, "tst'cond 'rn, 'imm");
1858 alu_out = rn_val & shifter_operand; 1858 alu_out = rn_val & shifter_operand;
1859 SetNZFlags(alu_out); 1859 SetNZFlags(alu_out);
1860 SetCFlag(shifter_carry_out); 1860 SetCFlag(shifter_carry_out);
1861 } else { 1861 } else {
1862 UNIMPLEMENTED(); 1862 // Format(instr, "movw'cond 'rd, 'imm").
1863 alu_out = instr->ImmedMovwMovtField();
1864 set_register(rd, alu_out);
1863 } 1865 }
1864 break; 1866 break;
1865 } 1867 }
1866 1868
1867 case TEQ: { 1869 case TEQ: {
1868 if (instr->HasS()) { 1870 if (instr->HasS()) {
1869 // Format(instr, "teq'cond 'rn, 'shift_rm"); 1871 // Format(instr, "teq'cond 'rn, 'shift_rm");
1870 // Format(instr, "teq'cond 'rn, 'imm"); 1872 // Format(instr, "teq'cond 'rn, 'imm");
1871 alu_out = rn_val ^ shifter_operand; 1873 alu_out = rn_val ^ shifter_operand;
1872 SetNZFlags(alu_out); 1874 SetNZFlags(alu_out);
1873 SetCFlag(shifter_carry_out); 1875 SetCFlag(shifter_carry_out);
1874 } else { 1876 } else {
1875 // Other instructions matching this pattern are handled in the 1877 // Other instructions matching this pattern are handled in the
1876 // miscellaneous instructions part above. 1878 // miscellaneous instructions part above.
1877 UNREACHABLE(); 1879 UNREACHABLE();
1878 } 1880 }
1879 break; 1881 break;
1880 } 1882 }
1881 1883
1882 case CMP: { 1884 case CMP: {
1883 if (instr->HasS()) { 1885 if (instr->HasS()) {
1884 // Format(instr, "cmp'cond 'rn, 'shift_rm"); 1886 // Format(instr, "cmp'cond 'rn, 'shift_rm");
1885 // Format(instr, "cmp'cond 'rn, 'imm"); 1887 // Format(instr, "cmp'cond 'rn, 'imm");
1886 alu_out = rn_val - shifter_operand; 1888 alu_out = rn_val - shifter_operand;
1887 SetNZFlags(alu_out); 1889 SetNZFlags(alu_out);
1888 SetCFlag(!BorrowFrom(rn_val, shifter_operand)); 1890 SetCFlag(!BorrowFrom(rn_val, shifter_operand));
1889 SetVFlag(OverflowFrom(alu_out, rn_val, shifter_operand, false)); 1891 SetVFlag(OverflowFrom(alu_out, rn_val, shifter_operand, false));
1890 } else { 1892 } else {
1891 UNIMPLEMENTED(); 1893 // Format(instr, "movt'cond 'rd, 'imm").
1894 alu_out = (get_register(rd) & 0xffff) |
1895 (instr->ImmedMovwMovtField() << 16);
1896 set_register(rd, alu_out);
1892 } 1897 }
1893 break; 1898 break;
1894 } 1899 }
1895 1900
1896 case CMN: { 1901 case CMN: {
1897 if (instr->HasS()) { 1902 if (instr->HasS()) {
1898 // Format(instr, "cmn'cond 'rn, 'shift_rm"); 1903 // Format(instr, "cmn'cond 'rn, 'shift_rm");
1899 // Format(instr, "cmn'cond 'rn, 'imm"); 1904 // Format(instr, "cmn'cond 'rn, 'imm");
1900 alu_out = rn_val + shifter_operand; 1905 alu_out = rn_val + shifter_operand;
1901 SetNZFlags(alu_out); 1906 SetNZFlags(alu_out);
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
2757 uintptr_t address = *stack_slot; 2762 uintptr_t address = *stack_slot;
2758 set_register(sp, current_sp + sizeof(uintptr_t)); 2763 set_register(sp, current_sp + sizeof(uintptr_t));
2759 return address; 2764 return address;
2760 } 2765 }
2761 2766
2762 } } // namespace assembler::arm 2767 } } // namespace assembler::arm
2763 2768
2764 #endif // __arm__ 2769 #endif // __arm__
2765 2770
2766 #endif // V8_TARGET_ARCH_ARM 2771 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698