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

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

Issue 12374046: Tweak register allocation for Math.round and do not use roundsd. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 return MarkAsCall(DefineFixedDouble(result, xmm1), instr); 1077 return MarkAsCall(DefineFixedDouble(result, xmm1), instr);
1078 } else if (op == kMathExp) { 1078 } else if (op == kMathExp) {
1079 ASSERT(instr->representation().IsDouble()); 1079 ASSERT(instr->representation().IsDouble());
1080 ASSERT(instr->value()->representation().IsDouble()); 1080 ASSERT(instr->value()->representation().IsDouble());
1081 LOperand* value = UseTempRegister(instr->value()); 1081 LOperand* value = UseTempRegister(instr->value());
1082 LOperand* temp1 = TempRegister(); 1082 LOperand* temp1 = TempRegister();
1083 LOperand* temp2 = TempRegister(); 1083 LOperand* temp2 = TempRegister();
1084 LMathExp* result = new(zone()) LMathExp(value, temp1, temp2); 1084 LMathExp* result = new(zone()) LMathExp(value, temp1, temp2);
1085 return DefineAsRegister(result); 1085 return DefineAsRegister(result);
1086 } else { 1086 } else {
1087 LOperand* input; 1087 LOperand* input = UseRegisterAtStart(instr->value());
1088 if (op == kMathRound &&
1089 (!CpuFeatures::IsSupported(SSE4_1) ||
1090 instr->CheckFlag(HValue::kBailoutOnMinusZero))) {
1091 // Math.round implemented without roundsd. Input may be overwritten.
1092 ASSERT(instr->value()->representation().IsDouble());
1093 input = UseTempRegister(instr->value());
1094 } else {
1095 input = UseRegisterAtStart(instr->value());
1096 }
1097 LUnaryMathOperation* result = new(zone()) LUnaryMathOperation(input); 1088 LUnaryMathOperation* result = new(zone()) LUnaryMathOperation(input);
1098 switch (op) { 1089 switch (op) {
1099 case kMathAbs: 1090 case kMathAbs:
1100 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); 1091 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result)));
1101 case kMathFloor: 1092 case kMathFloor:
1102 return AssignEnvironment(DefineAsRegister(result)); 1093 return AssignEnvironment(DefineAsRegister(result));
1103 case kMathRound: 1094 case kMathRound:
1104 return AssignEnvironment(DefineAsRegister(result)); 1095 return AssignEnvironment(DefineAsRegister(result));
1105 case kMathSqrt: 1096 case kMathSqrt:
1106 return DefineSameAsFirst(result); 1097 return DefineSameAsFirst(result);
(...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after
2417 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2408 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2418 LOperand* object = UseRegister(instr->object()); 2409 LOperand* object = UseRegister(instr->object());
2419 LOperand* index = UseTempRegister(instr->index()); 2410 LOperand* index = UseTempRegister(instr->index());
2420 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2411 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2421 } 2412 }
2422 2413
2423 2414
2424 } } // namespace v8::internal 2415 } } // namespace v8::internal
2425 2416
2426 #endif // V8_TARGET_ARCH_X64 2417 #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