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

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

Issue 6594118: Add ArithmeticD(MOD) to x64 optimizing code generator. Minor changes to Arit... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 9 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-codegen-x64.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 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 ? AssignEnvironment(DefineSameAsFirst(result)) 864 ? AssignEnvironment(DefineSameAsFirst(result))
865 : DefineSameAsFirst(result); 865 : DefineSameAsFirst(result);
866 } 866 }
867 867
868 868
869 LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op, 869 LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op,
870 HArithmeticBinaryOperation* instr) { 870 HArithmeticBinaryOperation* instr) {
871 ASSERT(instr->representation().IsDouble()); 871 ASSERT(instr->representation().IsDouble());
872 ASSERT(instr->left()->representation().IsDouble()); 872 ASSERT(instr->left()->representation().IsDouble());
873 ASSERT(instr->right()->representation().IsDouble()); 873 ASSERT(instr->right()->representation().IsDouble());
874 if (op == Token::MOD) { 874 ASSERT(op != Token::MOD);
875 Abort("Unimplemented: %s", "DoArithmeticD MOD");
876 }
877 LOperand* left = UseRegisterAtStart(instr->left()); 875 LOperand* left = UseRegisterAtStart(instr->left());
878 LOperand* right = UseRegisterAtStart(instr->right()); 876 LOperand* right = UseRegisterAtStart(instr->right());
879 LArithmeticD* result = new LArithmeticD(op, left, right); 877 LArithmeticD* result = new LArithmeticD(op, left, right);
880 return DefineSameAsFirst(result); 878 return DefineSameAsFirst(result);
881 } 879 }
882 880
883 881
884 LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op, 882 LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op,
885 HArithmeticBinaryOperation* instr) { 883 HArithmeticBinaryOperation* instr) {
886 ASSERT(op == Token::ADD || 884 ASSERT(op == Token::ADD ||
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
1359 instr->CheckFlag(HValue::kCanBeDivByZero)) 1357 instr->CheckFlag(HValue::kCanBeDivByZero))
1360 ? AssignEnvironment(result) 1358 ? AssignEnvironment(result)
1361 : result; 1359 : result;
1362 } else if (instr->representation().IsTagged()) { 1360 } else if (instr->representation().IsTagged()) {
1363 return DoArithmeticT(Token::MOD, instr); 1361 return DoArithmeticT(Token::MOD, instr);
1364 } else { 1362 } else {
1365 ASSERT(instr->representation().IsDouble()); 1363 ASSERT(instr->representation().IsDouble());
1366 // We call a C function for double modulo. It can't trigger a GC. 1364 // We call a C function for double modulo. It can't trigger a GC.
1367 // We need to use fixed result register for the call. 1365 // We need to use fixed result register for the call.
1368 // TODO(fschneider): Allow any register as input registers. 1366 // TODO(fschneider): Allow any register as input registers.
1369 LOperand* left = UseFixedDouble(instr->left(), xmm1); 1367 LOperand* left = UseFixedDouble(instr->left(), xmm2);
1370 LOperand* right = UseFixedDouble(instr->right(), xmm2); 1368 LOperand* right = UseFixedDouble(instr->right(), xmm1);
1371 LArithmeticD* result = new LArithmeticD(Token::MOD, left, right); 1369 LArithmeticD* result = new LArithmeticD(Token::MOD, left, right);
1372 return MarkAsCall(DefineFixedDouble(result, xmm1), instr); 1370 return MarkAsCall(DefineFixedDouble(result, xmm1), instr);
1373 } 1371 }
1374 } 1372 }
1375 1373
1376 1374
1377 LInstruction* LChunkBuilder::DoMul(HMul* instr) { 1375 LInstruction* LChunkBuilder::DoMul(HMul* instr) {
1378 if (instr->representation().IsInteger32()) { 1376 if (instr->representation().IsInteger32()) {
1379 ASSERT(instr->left()->representation().IsInteger32()); 1377 ASSERT(instr->left()->representation().IsInteger32());
1380 ASSERT(instr->right()->representation().IsInteger32()); 1378 ASSERT(instr->right()->representation().IsInteger32());
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
2035 2033
2036 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { 2034 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {
2037 HEnvironment* outer = current_block_->last_environment()->outer(); 2035 HEnvironment* outer = current_block_->last_environment()->outer();
2038 current_block_->UpdateEnvironment(outer); 2036 current_block_->UpdateEnvironment(outer);
2039 return NULL; 2037 return NULL;
2040 } 2038 }
2041 2039
2042 } } // namespace v8::internal 2040 } } // namespace v8::internal
2043 2041
2044 #endif // V8_TARGET_ARCH_X64 2042 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698