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

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

Issue 8806010: Refactor MathPowHalf on ia32. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: . Created 9 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/ia32/lithium-ia32.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 stream->Add("#%d / ", arity()); 291 stream->Add("#%d / ", arity());
292 } 292 }
293 293
294 294
295 void LUnaryMathOperation::PrintDataTo(StringStream* stream) { 295 void LUnaryMathOperation::PrintDataTo(StringStream* stream) {
296 stream->Add("/%s ", hydrogen()->OpName()); 296 stream->Add("/%s ", hydrogen()->OpName());
297 InputAt(0)->PrintTo(stream); 297 InputAt(0)->PrintTo(stream);
298 } 298 }
299 299
300 300
301 void LMathPowHalf::PrintDataTo(StringStream* stream) {
302 stream->Add("/pow_half ");
303 InputAt(0)->PrintTo(stream);
304 }
305
306
301 void LLoadContextSlot::PrintDataTo(StringStream* stream) { 307 void LLoadContextSlot::PrintDataTo(StringStream* stream) {
302 InputAt(0)->PrintTo(stream); 308 InputAt(0)->PrintTo(stream);
303 stream->Add("[%d]", slot_index()); 309 stream->Add("[%d]", slot_index());
304 } 310 }
305 311
306 312
307 void LStoreContextSlot::PrintDataTo(StringStream* stream) { 313 void LStoreContextSlot::PrintDataTo(StringStream* stream) {
308 InputAt(0)->PrintTo(stream); 314 InputAt(0)->PrintTo(stream);
309 stream->Add("[%d] <- ", slot_index()); 315 stream->Add("[%d] <- ", slot_index());
310 InputAt(1)->PrintTo(stream); 316 InputAt(1)->PrintTo(stream);
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 return DefineSameAsFirst(result); 1183 return DefineSameAsFirst(result);
1178 } else if (op == kMathSin || op == kMathCos) { 1184 } else if (op == kMathSin || op == kMathCos) {
1179 LOperand* context = UseFixed(instr->context(), esi); 1185 LOperand* context = UseFixed(instr->context(), esi);
1180 LOperand* input = UseFixedDouble(instr->value(), xmm1); 1186 LOperand* input = UseFixedDouble(instr->value(), xmm1);
1181 LUnaryMathOperation* result = new(zone()) LUnaryMathOperation(context, 1187 LUnaryMathOperation* result = new(zone()) LUnaryMathOperation(context,
1182 input); 1188 input);
1183 return MarkAsCall(DefineFixedDouble(result, xmm1), instr); 1189 return MarkAsCall(DefineFixedDouble(result, xmm1), instr);
1184 } else { 1190 } else {
1185 LOperand* input = UseRegisterAtStart(instr->value()); 1191 LOperand* input = UseRegisterAtStart(instr->value());
1186 LOperand* context = UseAny(instr->context()); // Deferred use by MathAbs. 1192 LOperand* context = UseAny(instr->context()); // Deferred use by MathAbs.
1193 if (op == kMathPowHalf) {
1194 LOperand* temp = TempRegister();
1195 LMathPowHalf* result = new(zone()) LMathPowHalf(context, input, temp);
1196 return DefineSameAsFirst(result);
1197 }
1187 LUnaryMathOperation* result = new(zone()) LUnaryMathOperation(context, 1198 LUnaryMathOperation* result = new(zone()) LUnaryMathOperation(context,
1188 input); 1199 input);
1189 switch (op) { 1200 switch (op) {
1190 case kMathAbs: 1201 case kMathAbs:
1191 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); 1202 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result)));
1192 case kMathFloor: 1203 case kMathFloor:
1193 return AssignEnvironment(DefineAsRegister(result)); 1204 return AssignEnvironment(DefineAsRegister(result));
1194 case kMathRound: 1205 case kMathRound:
1195 return AssignEnvironment(DefineAsRegister(result)); 1206 return AssignEnvironment(DefineAsRegister(result));
1196 case kMathSqrt: 1207 case kMathSqrt:
1197 return DefineSameAsFirst(result); 1208 return DefineSameAsFirst(result);
1198 case kMathPowHalf:
1199 return DefineSameAsFirst(result);
1200 default: 1209 default:
1201 UNREACHABLE(); 1210 UNREACHABLE();
1202 return NULL; 1211 return NULL;
1203 } 1212 }
1204 } 1213 }
1205 } 1214 }
1206 1215
1207 1216
1208 LInstruction* LChunkBuilder::DoCallKeyed(HCallKeyed* instr) { 1217 LInstruction* LChunkBuilder::DoCallKeyed(HCallKeyed* instr) {
1209 ASSERT(instr->key()->representation().IsTagged()); 1218 ASSERT(instr->key()->representation().IsTagged());
(...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after
2365 LOperand* key = UseOrConstantAtStart(instr->key()); 2374 LOperand* key = UseOrConstantAtStart(instr->key());
2366 LOperand* object = UseOrConstantAtStart(instr->object()); 2375 LOperand* object = UseOrConstantAtStart(instr->object());
2367 LIn* result = new(zone()) LIn(context, key, object); 2376 LIn* result = new(zone()) LIn(context, key, object);
2368 return MarkAsCall(DefineFixed(result, eax), instr); 2377 return MarkAsCall(DefineFixed(result, eax), instr);
2369 } 2378 }
2370 2379
2371 2380
2372 } } // namespace v8::internal 2381 } } // namespace v8::internal
2373 2382
2374 #endif // V8_TARGET_ARCH_IA32 2383 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698