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

Side by Side Diff: src/x64/lithium-x64.cc

Issue 6448001: x64: Add MulI and DivI to lithium instructions. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 10 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 | « src/x64/lithium-x64.h ('k') | test/mjsunit/regress/regress-1117.js » ('j') | 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 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 return DoBit(Token::BIT_OR, instr); 1255 return DoBit(Token::BIT_OR, instr);
1256 } 1256 }
1257 1257
1258 1258
1259 LInstruction* LChunkBuilder::DoBitXor(HBitXor* instr) { 1259 LInstruction* LChunkBuilder::DoBitXor(HBitXor* instr) {
1260 return DoBit(Token::BIT_XOR, instr); 1260 return DoBit(Token::BIT_XOR, instr);
1261 } 1261 }
1262 1262
1263 1263
1264 LInstruction* LChunkBuilder::DoDiv(HDiv* instr) { 1264 LInstruction* LChunkBuilder::DoDiv(HDiv* instr) {
1265 Abort("Unimplemented: %s", "DoDiv"); 1265 if (instr->representation().IsDouble()) {
1266 return NULL; 1266 return DoArithmeticD(Token::DIV, instr);
1267 } else if (instr->representation().IsInteger32()) {
1268 // The temporary operand is necessary to ensure that right is not allocated
1269 // into rdx.
1270 LOperand* temp = FixedTemp(rdx);
1271 LOperand* dividend = UseFixed(instr->left(), rax);
1272 LOperand* divisor = UseRegister(instr->right());
1273 LDivI* result = new LDivI(dividend, divisor, temp);
1274 return AssignEnvironment(DefineFixed(result, rax));
1275 } else {
1276 ASSERT(instr->representation().IsTagged());
1277 return DoArithmeticT(Token::DIV, instr);
1278 }
1267 } 1279 }
1268 1280
1269 1281
1270 LInstruction* LChunkBuilder::DoMod(HMod* instr) { 1282 LInstruction* LChunkBuilder::DoMod(HMod* instr) {
1271 Abort("Unimplemented: %s", "DoMod"); 1283 Abort("Unimplemented: %s", "DoMod");
1272 return NULL; 1284 return NULL;
1273 } 1285 }
1274 1286
1275 1287
1276 LInstruction* LChunkBuilder::DoMul(HMul* instr) { 1288 LInstruction* LChunkBuilder::DoMul(HMul* instr) {
1277 Abort("Unimplemented: %s", "DoMul"); 1289 if (instr->representation().IsInteger32()) {
1278 return NULL; 1290 ASSERT(instr->left()->representation().IsInteger32());
1291 ASSERT(instr->right()->representation().IsInteger32());
1292 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
1293 LOperand* right = UseOrConstant(instr->MostConstantOperand());
1294 LMulI* mul = new LMulI(left, right);
1295 return AssignEnvironment(DefineSameAsFirst(mul));
1296 } else if (instr->representation().IsDouble()) {
1297 return DoArithmeticD(Token::MUL, instr);
1298 } else {
1299 ASSERT(instr->representation().IsTagged());
1300 return DoArithmeticT(Token::MUL, instr);
1301 }
1279 } 1302 }
1280 1303
1281 1304
1282 LInstruction* LChunkBuilder::DoSub(HSub* instr) { 1305 LInstruction* LChunkBuilder::DoSub(HSub* instr) {
1283 if (instr->representation().IsInteger32()) { 1306 if (instr->representation().IsInteger32()) {
1284 ASSERT(instr->left()->representation().IsInteger32()); 1307 ASSERT(instr->left()->representation().IsInteger32());
1285 ASSERT(instr->right()->representation().IsInteger32()); 1308 ASSERT(instr->right()->representation().IsInteger32());
1286 LOperand* left = UseRegisterAtStart(instr->left()); 1309 LOperand* left = UseRegisterAtStart(instr->left());
1287 LOperand* right = UseOrConstantAtStart(instr->right()); 1310 LOperand* right = UseOrConstantAtStart(instr->right());
1288 LSubI* sub = new LSubI(left, right); 1311 LSubI* sub = new LSubI(left, right);
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
1827 1850
1828 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { 1851 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {
1829 HEnvironment* outer = current_block_->last_environment()->outer(); 1852 HEnvironment* outer = current_block_->last_environment()->outer();
1830 current_block_->UpdateEnvironment(outer); 1853 current_block_->UpdateEnvironment(outer);
1831 return NULL; 1854 return NULL;
1832 } 1855 }
1833 1856
1834 } } // namespace v8::internal 1857 } } // namespace v8::internal
1835 1858
1836 #endif // V8_TARGET_ARCH_X64 1859 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-x64.h ('k') | test/mjsunit/regress/regress-1117.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698