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

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

Issue 6461021: Add a genuine unary minus instruction to Crankshaft.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 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
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 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 1298
1299 LInstruction* LChunkBuilder::DoBitNot(HBitNot* instr) { 1299 LInstruction* LChunkBuilder::DoBitNot(HBitNot* instr) {
1300 ASSERT(instr->value()->representation().IsInteger32()); 1300 ASSERT(instr->value()->representation().IsInteger32());
1301 ASSERT(instr->representation().IsInteger32()); 1301 ASSERT(instr->representation().IsInteger32());
1302 LOperand* input = UseRegisterAtStart(instr->value()); 1302 LOperand* input = UseRegisterAtStart(instr->value());
1303 LBitNotI* result = new LBitNotI(input); 1303 LBitNotI* result = new LBitNotI(input);
1304 return DefineSameAsFirst(result); 1304 return DefineSameAsFirst(result);
1305 } 1305 }
1306 1306
1307 1307
1308 LInstruction* LChunkBuilder::DoNeg(HNeg* instr) {
1309 Representation r = instr->representation();
1310 if (r.IsInteger32()) {
1311 LOperand* input = UseRegister(instr->value());
1312 LNegI* result = new LNegI(input);
1313 if (instr->CheckFlag(HValue::kBailoutOnMinusZero) ||
1314 instr->CheckFlag(HValue::kCanOverflow)) {
1315 AssignEnvironment(result);
1316 }
1317 return DefineSameAsFirst(result);
1318 } else if (r.IsDouble()) {
1319 LOperand* input = UseRegister(instr->value());
1320 LOperand* temp = TempRegister();
1321 return DefineSameAsFirst(new LNegD(input, temp));
1322 } else {
1323 ASSERT(r.IsTagged());
1324 LOperand* input = UseFixed(instr->value(), eax);
1325 LNegT* result = new LNegT(input);
1326 return MarkAsCall(DefineFixed(result, eax), instr);
1327 }
1328 }
1329
1330
1308 LInstruction* LChunkBuilder::DoBitOr(HBitOr* instr) { 1331 LInstruction* LChunkBuilder::DoBitOr(HBitOr* instr) {
1309 return DoBit(Token::BIT_OR, instr); 1332 return DoBit(Token::BIT_OR, instr);
1310 } 1333 }
1311 1334
1312 1335
1313 LInstruction* LChunkBuilder::DoBitXor(HBitXor* instr) { 1336 LInstruction* LChunkBuilder::DoBitXor(HBitXor* instr) {
1314 return DoBit(Token::BIT_XOR, instr); 1337 return DoBit(Token::BIT_XOR, instr);
1315 } 1338 }
1316 1339
1317 1340
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
1989 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { 2012 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {
1990 HEnvironment* outer = current_block_->last_environment()->outer(); 2013 HEnvironment* outer = current_block_->last_environment()->outer();
1991 current_block_->UpdateEnvironment(outer); 2014 current_block_->UpdateEnvironment(outer);
1992 return NULL; 2015 return NULL;
1993 } 2016 }
1994 2017
1995 2018
1996 } } // namespace v8::internal 2019 } } // namespace v8::internal
1997 2020
1998 #endif // V8_TARGET_ARCH_IA32 2021 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« src/ia32/lithium-ia32.h ('K') | « src/ia32/lithium-ia32.h ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698