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

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

Issue 11198061: Fix ARM dissambler test problems with movw/movt. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Right diff this time Created 8 years, 2 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
« no previous file with comments | « no previous file | 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 (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions 5 // modification, are permitted provided that the following conditions
6 // are met: 6 // are met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 !fits_shifter(x.imm32_, &rotate_imm, &immed_8, &instr)) { 893 !fits_shifter(x.imm32_, &rotate_imm, &immed_8, &instr)) {
894 // The immediate operand cannot be encoded as a shifter operand, so load 894 // The immediate operand cannot be encoded as a shifter operand, so load
895 // it first to register ip and change the original instruction to use ip. 895 // it first to register ip and change the original instruction to use ip.
896 // However, if the original instruction is a 'mov rd, x' (not setting the 896 // However, if the original instruction is a 'mov rd, x' (not setting the
897 // condition code), then replace it with a 'ldr rd, [pc]'. 897 // condition code), then replace it with a 'ldr rd, [pc]'.
898 CHECK(!rn.is(ip)); // rn should never be ip, or will be trashed 898 CHECK(!rn.is(ip)); // rn should never be ip, or will be trashed
899 Condition cond = Instruction::ConditionField(instr); 899 Condition cond = Instruction::ConditionField(instr);
900 if ((instr & ~kCondMask) == 13*B21) { // mov, S not set 900 if ((instr & ~kCondMask) == 13*B21) { // mov, S not set
901 move_32_bit_immediate(cond, rd, LeaveCC, x); 901 move_32_bit_immediate(cond, rd, LeaveCC, x);
902 } else { 902 } else {
903 // If this is not a mov or mvn instruction we may still be able to avoid 903 if ((instr & kMovMvnMask) == kMovMvnPattern) {
904 // a constant pool entry by using mvn or movw. 904 // Moves need to use a constant pool entry.
905 if (!x.must_output_reloc_info(this) && 905 RecordRelocInfo(x.rmode_, x.imm32_, USE_CONSTANT_POOL);
906 (instr & kMovMvnMask) != kMovMvnPattern) { 906 ldr(ip, MemOperand(pc, 0), cond);
907 } else if (x.must_output_reloc_info(this)) {
908 // Otherwise, use most efficient form of fetching from constant pool.
909 move_32_bit_immediate(cond, ip, LeaveCC, x);
910 } else {
911 // If this is not a mov or mvn instruction we may still be able to
912 // avoid a constant pool entry by using mvn or movw.
907 mov(ip, x, LeaveCC, cond); 913 mov(ip, x, LeaveCC, cond);
908 } else {
909 move_32_bit_immediate(cond, ip, LeaveCC, x);
910 } 914 }
911 addrmod1(instr, rn, rd, Operand(ip)); 915 addrmod1(instr, rn, rd, Operand(ip));
912 } 916 }
913 return; 917 return;
914 } 918 }
915 instr |= I | rotate_imm*B8 | immed_8; 919 instr |= I | rotate_imm*B8 | immed_8;
916 } else if (!x.rs_.is_valid()) { 920 } else if (!x.rs_.is_valid()) {
917 // Immediate shift. 921 // Immediate shift.
918 instr |= x.shift_imm_*B7 | x.shift_op_ | x.rm_.code(); 922 instr |= x.shift_imm_*B7 | x.shift_op_ | x.rm_.code();
919 } else { 923 } else {
(...skipping 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after
2768 2772
2769 // Since a constant pool was just emitted, move the check offset forward by 2773 // Since a constant pool was just emitted, move the check offset forward by
2770 // the standard interval. 2774 // the standard interval.
2771 next_buffer_check_ = pc_offset() + kCheckPoolInterval; 2775 next_buffer_check_ = pc_offset() + kCheckPoolInterval;
2772 } 2776 }
2773 2777
2774 2778
2775 } } // namespace v8::internal 2779 } } // namespace v8::internal
2776 2780
2777 #endif // V8_TARGET_ARCH_ARM 2781 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698