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

Side by Side Diff: src/ia32/lithium-ia32.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/ia32/lithium-ia32.h ('k') | src/objects.h » ('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 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 1177
1178 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { 1178 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) {
1179 switch (instr->op()) { 1179 switch (instr->op()) {
1180 case kMathFloor: return DoMathFloor(instr); 1180 case kMathFloor: return DoMathFloor(instr);
1181 case kMathRound: return DoMathRound(instr); 1181 case kMathRound: return DoMathRound(instr);
1182 case kMathAbs: return DoMathAbs(instr); 1182 case kMathAbs: return DoMathAbs(instr);
1183 case kMathLog: return DoMathLog(instr); 1183 case kMathLog: return DoMathLog(instr);
1184 case kMathExp: return DoMathExp(instr); 1184 case kMathExp: return DoMathExp(instr);
1185 case kMathSqrt: return DoMathSqrt(instr); 1185 case kMathSqrt: return DoMathSqrt(instr);
1186 case kMathPowHalf: return DoMathPowHalf(instr); 1186 case kMathPowHalf: return DoMathPowHalf(instr);
1187 case kMathClz32: return DoMathClz32(instr);
1187 default: 1188 default:
1188 UNREACHABLE(); 1189 UNREACHABLE();
1189 return NULL; 1190 return NULL;
1190 } 1191 }
1191 } 1192 }
1192 1193
1193 1194
1194 LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) { 1195 LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) {
1195 LOperand* input = UseRegisterAtStart(instr->value()); 1196 LOperand* input = UseRegisterAtStart(instr->value());
1196 LMathFloor* result = new(zone()) LMathFloor(input); 1197 LMathFloor* result = new(zone()) LMathFloor(input);
(...skipping 18 matching lines...) Expand all
1215 1216
1216 1217
1217 LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) { 1218 LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) {
1218 ASSERT(instr->representation().IsDouble()); 1219 ASSERT(instr->representation().IsDouble());
1219 ASSERT(instr->value()->representation().IsDouble()); 1220 ASSERT(instr->value()->representation().IsDouble());
1220 LOperand* input = UseRegisterAtStart(instr->value()); 1221 LOperand* input = UseRegisterAtStart(instr->value());
1221 return MarkAsCall(DefineSameAsFirst(new(zone()) LMathLog(input)), instr); 1222 return MarkAsCall(DefineSameAsFirst(new(zone()) LMathLog(input)), instr);
1222 } 1223 }
1223 1224
1224 1225
1226 LInstruction* LChunkBuilder::DoMathClz32(HUnaryMathOperation* instr) {
1227 LOperand* input = UseRegisterAtStart(instr->value());
1228 LMathClz32* result = new(zone()) LMathClz32(input);
1229 return DefineAsRegister(result);
1230 }
1231
1232
1225 LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) { 1233 LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) {
1226 ASSERT(instr->representation().IsDouble()); 1234 ASSERT(instr->representation().IsDouble());
1227 ASSERT(instr->value()->representation().IsDouble()); 1235 ASSERT(instr->value()->representation().IsDouble());
1228 LOperand* value = UseTempRegister(instr->value()); 1236 LOperand* value = UseTempRegister(instr->value());
1229 LOperand* temp1 = TempRegister(); 1237 LOperand* temp1 = TempRegister();
1230 LOperand* temp2 = TempRegister(); 1238 LOperand* temp2 = TempRegister();
1231 LMathExp* result = new(zone()) LMathExp(value, temp1, temp2); 1239 LMathExp* result = new(zone()) LMathExp(value, temp1, temp2);
1232 return DefineAsRegister(result); 1240 return DefineAsRegister(result);
1233 } 1241 }
1234 1242
(...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after
2582 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2590 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2583 LOperand* object = UseRegister(instr->object()); 2591 LOperand* object = UseRegister(instr->object());
2584 LOperand* index = UseTempRegister(instr->index()); 2592 LOperand* index = UseTempRegister(instr->index());
2585 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2593 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2586 } 2594 }
2587 2595
2588 2596
2589 } } // namespace v8::internal 2597 } } // namespace v8::internal
2590 2598
2591 #endif // V8_TARGET_ARCH_IA32 2599 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698