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

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

Issue 11418149: Faster implementation of Math.exp() (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix Win build Created 8 years 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/math-exp-precision.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 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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 stream->Add("#%d / ", arity()); 292 stream->Add("#%d / ", arity());
293 } 293 }
294 294
295 295
296 void LUnaryMathOperation::PrintDataTo(StringStream* stream) { 296 void LUnaryMathOperation::PrintDataTo(StringStream* stream) {
297 stream->Add("/%s ", hydrogen()->OpName()); 297 stream->Add("/%s ", hydrogen()->OpName());
298 value()->PrintTo(stream); 298 value()->PrintTo(stream);
299 } 299 }
300 300
301 301
302 void LMathExp::PrintDataTo(StringStream* stream) {
303 value()->PrintTo(stream);
304 }
305
306
302 void LLoadContextSlot::PrintDataTo(StringStream* stream) { 307 void LLoadContextSlot::PrintDataTo(StringStream* stream) {
303 context()->PrintTo(stream); 308 context()->PrintTo(stream);
304 stream->Add("[%d]", slot_index()); 309 stream->Add("[%d]", slot_index());
305 } 310 }
306 311
307 312
308 void LStoreContextSlot::PrintDataTo(StringStream* stream) { 313 void LStoreContextSlot::PrintDataTo(StringStream* stream) {
309 context()->PrintTo(stream); 314 context()->PrintTo(stream);
310 stream->Add("[%d] <- ", slot_index()); 315 stream->Add("[%d] <- ", slot_index());
311 value()->PrintTo(stream); 316 value()->PrintTo(stream);
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
1039 return MarkAsCall(DefineFixed(result, rax), instr, CANNOT_DEOPTIMIZE_EAGERLY); 1044 return MarkAsCall(DefineFixed(result, rax), instr, CANNOT_DEOPTIMIZE_EAGERLY);
1040 } 1045 }
1041 1046
1042 1047
1043 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { 1048 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) {
1044 BuiltinFunctionId op = instr->op(); 1049 BuiltinFunctionId op = instr->op();
1045 if (op == kMathLog || op == kMathSin || op == kMathCos || op == kMathTan) { 1050 if (op == kMathLog || op == kMathSin || op == kMathCos || op == kMathTan) {
1046 LOperand* input = UseFixedDouble(instr->value(), xmm1); 1051 LOperand* input = UseFixedDouble(instr->value(), xmm1);
1047 LUnaryMathOperation* result = new(zone()) LUnaryMathOperation(input); 1052 LUnaryMathOperation* result = new(zone()) LUnaryMathOperation(input);
1048 return MarkAsCall(DefineFixedDouble(result, xmm1), instr); 1053 return MarkAsCall(DefineFixedDouble(result, xmm1), instr);
1054 } else if (op == kMathExp) {
1055 ASSERT(instr->representation().IsDouble());
1056 ASSERT(instr->value()->representation().IsDouble());
1057 LOperand* value = UseTempRegister(instr->value());
1058 LOperand* temp1 = TempRegister();
1059 LOperand* temp2 = TempRegister();
1060 LMathExp* result = new(zone()) LMathExp(value, temp1, temp2);
1061 return DefineAsRegister(result);
1049 } else { 1062 } else {
1050 LOperand* input = UseRegisterAtStart(instr->value()); 1063 LOperand* input = UseRegisterAtStart(instr->value());
1051 LUnaryMathOperation* result = new(zone()) LUnaryMathOperation(input); 1064 LUnaryMathOperation* result = new(zone()) LUnaryMathOperation(input);
1052 switch (op) { 1065 switch (op) {
1053 case kMathAbs: 1066 case kMathAbs:
1054 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); 1067 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result)));
1055 case kMathFloor: 1068 case kMathFloor:
1056 return AssignEnvironment(DefineAsRegister(result)); 1069 return AssignEnvironment(DefineAsRegister(result));
1057 case kMathRound: 1070 case kMathRound:
1058 return AssignEnvironment(DefineAsRegister(result)); 1071 return AssignEnvironment(DefineAsRegister(result));
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after
2278 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2291 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2279 LOperand* object = UseRegister(instr->object()); 2292 LOperand* object = UseRegister(instr->object());
2280 LOperand* index = UseTempRegister(instr->index()); 2293 LOperand* index = UseTempRegister(instr->index());
2281 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2294 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2282 } 2295 }
2283 2296
2284 2297
2285 } } // namespace v8::internal 2298 } } // namespace v8::internal
2286 2299
2287 #endif // V8_TARGET_ARCH_X64 2300 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-x64.h ('k') | test/mjsunit/math-exp-precision.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698