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

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 391073: Changes to Intel shift functions... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 1 month 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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 Label* on_not_smi_result) { 1071 Label* on_not_smi_result) {
1072 ASSERT(!dst.is(rcx)); 1072 ASSERT(!dst.is(rcx));
1073 Label result_ok; 1073 Label result_ok;
1074 // Untag shift amount. 1074 // Untag shift amount.
1075 if (!dst.is(src1)) { 1075 if (!dst.is(src1)) {
1076 movq(dst, src1); 1076 movq(dst, src1);
1077 } 1077 }
1078 SmiToInteger32(rcx, src2); 1078 SmiToInteger32(rcx, src2);
1079 // Shift amount specified by lower 5 bits, not six as the shl opcode. 1079 // Shift amount specified by lower 5 bits, not six as the shl opcode.
1080 and_(rcx, Immediate(0x1f)); 1080 and_(rcx, Immediate(0x1f));
1081 shl(dst); 1081 shl_cl(dst);
1082 } 1082 }
1083 1083
1084 1084
1085 void MacroAssembler::SmiShiftLogicalRight(Register dst, 1085 void MacroAssembler::SmiShiftLogicalRight(Register dst,
1086 Register src1, 1086 Register src1,
1087 Register src2, 1087 Register src2,
1088 Label* on_not_smi_result) { 1088 Label* on_not_smi_result) {
1089 ASSERT(!dst.is(kScratchRegister)); 1089 ASSERT(!dst.is(kScratchRegister));
1090 ASSERT(!src1.is(kScratchRegister)); 1090 ASSERT(!src1.is(kScratchRegister));
1091 ASSERT(!src2.is(kScratchRegister)); 1091 ASSERT(!src2.is(kScratchRegister));
1092 ASSERT(!dst.is(rcx)); 1092 ASSERT(!dst.is(rcx));
1093 Label result_ok; 1093 Label result_ok;
1094 if (src1.is(rcx) || src2.is(rcx)) { 1094 if (src1.is(rcx) || src2.is(rcx)) {
1095 movq(kScratchRegister, rcx); 1095 movq(kScratchRegister, rcx);
1096 } 1096 }
1097 if (!dst.is(src1)) { 1097 if (!dst.is(src1)) {
1098 movq(dst, src1); 1098 movq(dst, src1);
1099 } 1099 }
1100 SmiToInteger32(rcx, src2); 1100 SmiToInteger32(rcx, src2);
1101 orl(rcx, Immediate(kSmiShift)); 1101 orl(rcx, Immediate(kSmiShift));
1102 shr(dst); // Shift is rcx modulo 0x1f + 32. 1102 shr_cl(dst); // Shift is rcx modulo 0x1f + 32.
1103 shl(dst, Immediate(kSmiShift)); 1103 shl(dst, Immediate(kSmiShift));
1104 testq(dst, dst); 1104 testq(dst, dst);
1105 if (src1.is(rcx) || src2.is(rcx)) { 1105 if (src1.is(rcx) || src2.is(rcx)) {
1106 Label positive_result; 1106 Label positive_result;
1107 j(positive, &positive_result); 1107 j(positive, &positive_result);
1108 if (src1.is(rcx)) { 1108 if (src1.is(rcx)) {
1109 movq(src1, kScratchRegister); 1109 movq(src1, kScratchRegister);
1110 } else { 1110 } else {
1111 movq(src2, kScratchRegister); 1111 movq(src2, kScratchRegister);
1112 } 1112 }
(...skipping 15 matching lines...) Expand all
1128 if (src1.is(rcx)) { 1128 if (src1.is(rcx)) {
1129 movq(kScratchRegister, src1); 1129 movq(kScratchRegister, src1);
1130 } else if (src2.is(rcx)) { 1130 } else if (src2.is(rcx)) {
1131 movq(kScratchRegister, src2); 1131 movq(kScratchRegister, src2);
1132 } 1132 }
1133 if (!dst.is(src1)) { 1133 if (!dst.is(src1)) {
1134 movq(dst, src1); 1134 movq(dst, src1);
1135 } 1135 }
1136 SmiToInteger32(rcx, src2); 1136 SmiToInteger32(rcx, src2);
1137 orl(rcx, Immediate(kSmiShift)); 1137 orl(rcx, Immediate(kSmiShift));
1138 sar(dst); // Shift 32 + original rcx & 0x1f. 1138 sar_cl(dst); // Shift 32 + original rcx & 0x1f.
1139 shl(dst, Immediate(kSmiShift)); 1139 shl(dst, Immediate(kSmiShift));
1140 if (src1.is(rcx)) { 1140 if (src1.is(rcx)) {
1141 movq(src1, kScratchRegister); 1141 movq(src1, kScratchRegister);
1142 } else if (src2.is(rcx)) { 1142 } else if (src2.is(rcx)) {
1143 movq(src2, kScratchRegister); 1143 movq(src2, kScratchRegister);
1144 } 1144 }
1145 } 1145 }
1146 1146
1147 1147
1148 void MacroAssembler::SelectNonSmi(Register dst, 1148 void MacroAssembler::SelectNonSmi(Register dst,
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
2241 CodePatcher::~CodePatcher() { 2241 CodePatcher::~CodePatcher() {
2242 // Indicate that code has changed. 2242 // Indicate that code has changed.
2243 CPU::FlushICache(address_, size_); 2243 CPU::FlushICache(address_, size_);
2244 2244
2245 // Check that the code was patched as expected. 2245 // Check that the code was patched as expected.
2246 ASSERT(masm_.pc_ == address_ + size_); 2246 ASSERT(masm_.pc_ == address_ + size_);
2247 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); 2247 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
2248 } 2248 }
2249 2249
2250 } } // namespace v8::internal 2250 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698