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/ia32/lithium-ia32.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/ia32/lithium-codegen-ia32.cc ('k') | src/x64/lithium-codegen-x64.cc » ('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 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 ? AssignEnvironment(DefineSameAsFirst(result)) 863 ? AssignEnvironment(DefineSameAsFirst(result))
864 : DefineSameAsFirst(result); 864 : DefineSameAsFirst(result);
865 } 865 }
866 866
867 867
868 LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op, 868 LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op,
869 HArithmeticBinaryOperation* instr) { 869 HArithmeticBinaryOperation* instr) {
870 ASSERT(instr->representation().IsDouble()); 870 ASSERT(instr->representation().IsDouble());
871 ASSERT(instr->left()->representation().IsDouble()); 871 ASSERT(instr->left()->representation().IsDouble());
872 ASSERT(instr->right()->representation().IsDouble()); 872 ASSERT(instr->right()->representation().IsDouble());
873 if (op == Token::MOD) { 873 ASSERT(op != Token::MOD);
874 LOperand* left = UseFixedDouble(instr->left(), xmm2); 874 LOperand* left = UseRegisterAtStart(instr->left());
875 LOperand* right = UseFixedDouble(instr->right(), xmm1); 875 LOperand* right = UseRegisterAtStart(instr->right());
876 LArithmeticD* result = new LArithmeticD(op, left, right); 876 LArithmeticD* result = new LArithmeticD(op, left, right);
877 return MarkAsCall(DefineFixedDouble(result, xmm1), instr); 877 return DefineSameAsFirst(result);
878
879 } else {
880 LOperand* left = UseRegisterAtStart(instr->left());
881 LOperand* right = UseRegisterAtStart(instr->right());
882 LArithmeticD* result = new LArithmeticD(op, left, right);
883 return DefineSameAsFirst(result);
884 }
885 } 878 }
886 879
887 880
888 LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op, 881 LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op,
889 HArithmeticBinaryOperation* instr) { 882 HArithmeticBinaryOperation* instr) {
890 ASSERT(op == Token::ADD || 883 ASSERT(op == Token::ADD ||
891 op == Token::DIV || 884 op == Token::DIV ||
892 op == Token::MOD || 885 op == Token::MOD ||
893 op == Token::MUL || 886 op == Token::MUL ||
894 op == Token::SUB); 887 op == Token::SUB);
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
1384 instr->CheckFlag(HValue::kCanBeDivByZero)) 1377 instr->CheckFlag(HValue::kCanBeDivByZero))
1385 ? AssignEnvironment(result) 1378 ? AssignEnvironment(result)
1386 : result; 1379 : result;
1387 } else if (instr->representation().IsTagged()) { 1380 } else if (instr->representation().IsTagged()) {
1388 return DoArithmeticT(Token::MOD, instr); 1381 return DoArithmeticT(Token::MOD, instr);
1389 } else { 1382 } else {
1390 ASSERT(instr->representation().IsDouble()); 1383 ASSERT(instr->representation().IsDouble());
1391 // We call a C function for double modulo. It can't trigger a GC. 1384 // We call a C function for double modulo. It can't trigger a GC.
1392 // We need to use fixed result register for the call. 1385 // We need to use fixed result register for the call.
1393 // TODO(fschneider): Allow any register as input registers. 1386 // TODO(fschneider): Allow any register as input registers.
1394 LOperand* left = UseFixedDouble(instr->left(), xmm1); 1387 LOperand* left = UseFixedDouble(instr->left(), xmm2);
1395 LOperand* right = UseFixedDouble(instr->right(), xmm2); 1388 LOperand* right = UseFixedDouble(instr->right(), xmm1);
1396 LArithmeticD* result = new LArithmeticD(Token::MOD, left, right); 1389 LArithmeticD* result = new LArithmeticD(Token::MOD, left, right);
1397 return MarkAsCall(DefineFixedDouble(result, xmm1), instr); 1390 return MarkAsCall(DefineFixedDouble(result, xmm1), instr);
1398 } 1391 }
1399 } 1392 }
1400 1393
1401 1394
1402 LInstruction* LChunkBuilder::DoMul(HMul* instr) { 1395 LInstruction* LChunkBuilder::DoMul(HMul* instr) {
1403 if (instr->representation().IsInteger32()) { 1396 if (instr->representation().IsInteger32()) {
1404 ASSERT(instr->left()->representation().IsInteger32()); 1397 ASSERT(instr->left()->representation().IsInteger32());
1405 ASSERT(instr->right()->representation().IsInteger32()); 1398 ASSERT(instr->right()->representation().IsInteger32());
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
2086 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { 2079 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {
2087 HEnvironment* outer = current_block_->last_environment()->outer(); 2080 HEnvironment* outer = current_block_->last_environment()->outer();
2088 current_block_->UpdateEnvironment(outer); 2081 current_block_->UpdateEnvironment(outer);
2089 return NULL; 2082 return NULL;
2090 } 2083 }
2091 2084
2092 2085
2093 } } // namespace v8::internal 2086 } } // namespace v8::internal
2094 2087
2095 #endif // V8_TARGET_ARCH_IA32 2088 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698