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

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

Issue 10854053: MIPS: Refactor Math.min/max to be a single HInstruction. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 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
« src/mips/lithium-codegen-mips.cc ('K') | « 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 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 return result; 1289 return result;
1290 } else if (instr->representation().IsDouble()) { 1290 } else if (instr->representation().IsDouble()) {
1291 return DoArithmeticD(Token::ADD, instr); 1291 return DoArithmeticD(Token::ADD, instr);
1292 } else { 1292 } else {
1293 ASSERT(instr->representation().IsTagged()); 1293 ASSERT(instr->representation().IsTagged());
1294 return DoArithmeticT(Token::ADD, instr); 1294 return DoArithmeticT(Token::ADD, instr);
1295 } 1295 }
1296 } 1296 }
1297 1297
1298 1298
1299 LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) {
1300 LOperand* left = NULL;
1301 LOperand* right = NULL;
1302 if (instr->representation().IsInteger32()) {
1303 ASSERT(instr->left()->representation().IsInteger32());
1304 ASSERT(instr->right()->representation().IsInteger32());
1305 left = UseRegisterAtStart(instr->LeastConstantOperand());
1306 right = UseOrConstantAtStart(instr->MostConstantOperand());
1307 } else {
1308 ASSERT(instr->representation().IsDouble());
1309 ASSERT(instr->left()->representation().IsDouble());
1310 ASSERT(instr->right()->representation().IsDouble());
1311 left = UseRegisterAtStart(instr->left());
1312 right = UseRegisterAtStart(instr->right());
1313 }
1314 return DefineAsRegister(new(zone()) LMathMinMax(left, right));
1315 }
1316
1317
1299 LInstruction* LChunkBuilder::DoPower(HPower* instr) { 1318 LInstruction* LChunkBuilder::DoPower(HPower* instr) {
1300 ASSERT(instr->representation().IsDouble()); 1319 ASSERT(instr->representation().IsDouble());
1301 // We call a C function for double power. It can't trigger a GC. 1320 // We call a C function for double power. It can't trigger a GC.
1302 // We need to use fixed result register for the call. 1321 // We need to use fixed result register for the call.
1303 Representation exponent_type = instr->right()->representation(); 1322 Representation exponent_type = instr->right()->representation();
1304 ASSERT(instr->left()->representation().IsDouble()); 1323 ASSERT(instr->left()->representation().IsDouble());
1305 LOperand* left = UseFixedDouble(instr->left(), f2); 1324 LOperand* left = UseFixedDouble(instr->left(), f2);
1306 LOperand* right = exponent_type.IsDouble() ? 1325 LOperand* right = exponent_type.IsDouble() ?
1307 UseFixedDouble(instr->right(), f4) : 1326 UseFixedDouble(instr->right(), f4) :
1308 UseFixed(instr->right(), a2); 1327 UseFixed(instr->right(), a2);
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after
2220 2239
2221 2240
2222 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2241 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2223 LOperand* object = UseRegister(instr->object()); 2242 LOperand* object = UseRegister(instr->object());
2224 LOperand* index = UseRegister(instr->index()); 2243 LOperand* index = UseRegister(instr->index());
2225 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); 2244 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index));
2226 } 2245 }
2227 2246
2228 2247
2229 } } // namespace v8::internal 2248 } } // namespace v8::internal
OLDNEW
« src/mips/lithium-codegen-mips.cc ('K') | « src/mips/lithium-mips.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698