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

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

Issue 172533002: MIPS: Harmony: optimize Math.clz32. (Closed) Base URL: git@github.com:paul99/v8m-rb.git@master
Patch Set: Fixed nit. 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
« no previous file with comments | « src/mips/lithium-mips.h ('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 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after
1094 1094
1095 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { 1095 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) {
1096 switch (instr->op()) { 1096 switch (instr->op()) {
1097 case kMathFloor: return DoMathFloor(instr); 1097 case kMathFloor: return DoMathFloor(instr);
1098 case kMathRound: return DoMathRound(instr); 1098 case kMathRound: return DoMathRound(instr);
1099 case kMathAbs: return DoMathAbs(instr); 1099 case kMathAbs: return DoMathAbs(instr);
1100 case kMathLog: return DoMathLog(instr); 1100 case kMathLog: return DoMathLog(instr);
1101 case kMathExp: return DoMathExp(instr); 1101 case kMathExp: return DoMathExp(instr);
1102 case kMathSqrt: return DoMathSqrt(instr); 1102 case kMathSqrt: return DoMathSqrt(instr);
1103 case kMathPowHalf: return DoMathPowHalf(instr); 1103 case kMathPowHalf: return DoMathPowHalf(instr);
1104 case kMathClz32: return DoMathClz32(instr);
1104 default: 1105 default:
1105 UNREACHABLE(); 1106 UNREACHABLE();
1106 return NULL; 1107 return NULL;
1107 } 1108 }
1108 } 1109 }
1109 1110
1110 1111
1111 LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) { 1112 LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) {
1112 ASSERT(instr->representation().IsDouble()); 1113 ASSERT(instr->representation().IsDouble());
1113 ASSERT(instr->value()->representation().IsDouble()); 1114 ASSERT(instr->value()->representation().IsDouble());
1114 LOperand* input = UseFixedDouble(instr->value(), f4); 1115 LOperand* input = UseFixedDouble(instr->value(), f4);
1115 return MarkAsCall(DefineFixedDouble(new(zone()) LMathLog(input), f4), instr); 1116 return MarkAsCall(DefineFixedDouble(new(zone()) LMathLog(input), f4), instr);
1116 } 1117 }
1117 1118
1118 1119
1120 LInstruction* LChunkBuilder::DoMathClz32(HUnaryMathOperation* instr) {
1121 LOperand* input = UseRegisterAtStart(instr->value());
1122 LMathClz32* result = new(zone()) LMathClz32(input);
1123 return DefineAsRegister(result);
1124 }
1125
1126
1119 LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) { 1127 LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) {
1120 ASSERT(instr->representation().IsDouble()); 1128 ASSERT(instr->representation().IsDouble());
1121 ASSERT(instr->value()->representation().IsDouble()); 1129 ASSERT(instr->value()->representation().IsDouble());
1122 LOperand* input = UseRegister(instr->value()); 1130 LOperand* input = UseRegister(instr->value());
1123 LOperand* temp1 = TempRegister(); 1131 LOperand* temp1 = TempRegister();
1124 LOperand* temp2 = TempRegister(); 1132 LOperand* temp2 = TempRegister();
1125 LOperand* double_temp = FixedTemp(f6); // Chosen by fair dice roll. 1133 LOperand* double_temp = FixedTemp(f6); // Chosen by fair dice roll.
1126 LMathExp* result = new(zone()) LMathExp(input, double_temp, temp1, temp2); 1134 LMathExp* result = new(zone()) LMathExp(input, double_temp, temp1, temp2);
1127 return DefineAsRegister(result); 1135 return DefineAsRegister(result);
1128 } 1136 }
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after
2398 2406
2399 2407
2400 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2408 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2401 LOperand* object = UseRegister(instr->object()); 2409 LOperand* object = UseRegister(instr->object());
2402 LOperand* index = UseRegister(instr->index()); 2410 LOperand* index = UseRegister(instr->index());
2403 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); 2411 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index));
2404 } 2412 }
2405 2413
2406 2414
2407 } } // namespace v8::internal 2415 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/lithium-mips.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698