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

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

Issue 172133003: Harmony: optimize Math.clz32. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix Created 6 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/harmony/math-clz32.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 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 1099
1100 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { 1100 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) {
1101 switch (instr->op()) { 1101 switch (instr->op()) {
1102 case kMathFloor: return DoMathFloor(instr); 1102 case kMathFloor: return DoMathFloor(instr);
1103 case kMathRound: return DoMathRound(instr); 1103 case kMathRound: return DoMathRound(instr);
1104 case kMathAbs: return DoMathAbs(instr); 1104 case kMathAbs: return DoMathAbs(instr);
1105 case kMathLog: return DoMathLog(instr); 1105 case kMathLog: return DoMathLog(instr);
1106 case kMathExp: return DoMathExp(instr); 1106 case kMathExp: return DoMathExp(instr);
1107 case kMathSqrt: return DoMathSqrt(instr); 1107 case kMathSqrt: return DoMathSqrt(instr);
1108 case kMathPowHalf: return DoMathPowHalf(instr); 1108 case kMathPowHalf: return DoMathPowHalf(instr);
1109 case kMathClz32: return DoMathClz32(instr);
1109 default: 1110 default:
1110 UNREACHABLE(); 1111 UNREACHABLE();
1111 return NULL; 1112 return NULL;
1112 } 1113 }
1113 } 1114 }
1114 1115
1115 1116
1116 LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) { 1117 LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) {
1117 LOperand* input = UseRegisterAtStart(instr->value()); 1118 LOperand* input = UseRegisterAtStart(instr->value());
1118 LMathFloor* result = new(zone()) LMathFloor(input); 1119 LMathFloor* result = new(zone()) LMathFloor(input);
(...skipping 17 matching lines...) Expand all
1136 1137
1137 1138
1138 LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) { 1139 LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) {
1139 ASSERT(instr->representation().IsDouble()); 1140 ASSERT(instr->representation().IsDouble());
1140 ASSERT(instr->value()->representation().IsDouble()); 1141 ASSERT(instr->value()->representation().IsDouble());
1141 LOperand* input = UseRegisterAtStart(instr->value()); 1142 LOperand* input = UseRegisterAtStart(instr->value());
1142 return MarkAsCall(DefineSameAsFirst(new(zone()) LMathLog(input)), instr); 1143 return MarkAsCall(DefineSameAsFirst(new(zone()) LMathLog(input)), instr);
1143 } 1144 }
1144 1145
1145 1146
1147 LInstruction* LChunkBuilder::DoMathClz32(HUnaryMathOperation* instr) {
1148 LOperand* input = UseRegisterAtStart(instr->value());
1149 LMathClz32* result = new(zone()) LMathClz32(input);
1150 return DefineAsRegister(result);
1151 }
1152
1153
1146 LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) { 1154 LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) {
1147 ASSERT(instr->representation().IsDouble()); 1155 ASSERT(instr->representation().IsDouble());
1148 ASSERT(instr->value()->representation().IsDouble()); 1156 ASSERT(instr->value()->representation().IsDouble());
1149 LOperand* value = UseTempRegister(instr->value()); 1157 LOperand* value = UseTempRegister(instr->value());
1150 LOperand* temp1 = TempRegister(); 1158 LOperand* temp1 = TempRegister();
1151 LOperand* temp2 = TempRegister(); 1159 LOperand* temp2 = TempRegister();
1152 LMathExp* result = new(zone()) LMathExp(value, temp1, temp2); 1160 LMathExp* result = new(zone()) LMathExp(value, temp1, temp2);
1153 return DefineAsRegister(result); 1161 return DefineAsRegister(result);
1154 } 1162 }
1155 1163
(...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after
2428 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2436 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2429 LOperand* object = UseRegister(instr->object()); 2437 LOperand* object = UseRegister(instr->object());
2430 LOperand* index = UseTempRegister(instr->index()); 2438 LOperand* index = UseTempRegister(instr->index());
2431 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2439 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2432 } 2440 }
2433 2441
2434 2442
2435 } } // namespace v8::internal 2443 } } // namespace v8::internal
2436 2444
2437 #endif // V8_TARGET_ARCH_X64 2445 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-x64.h ('k') | test/mjsunit/harmony/math-clz32.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698