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

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

Issue 142323009: A64: Add LSubS instruction. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: 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/a64/lithium-a64.h ('k') | src/a64/lithium-codegen-a64.cc » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 2254 matching lines...) Expand 10 before | Expand all | Expand 10 after
2265 ASSERT(instr->right()->representation().IsTagged()); 2265 ASSERT(instr->right()->representation().IsTagged());
2266 LOperand* left = UseFixed(instr->left(), x1); 2266 LOperand* left = UseFixed(instr->left(), x1);
2267 LOperand* right = UseFixed(instr->right(), x0); 2267 LOperand* right = UseFixed(instr->right(), x0);
2268 LStringCompareAndBranch* result = 2268 LStringCompareAndBranch* result =
2269 new(zone()) LStringCompareAndBranch(left, right); 2269 new(zone()) LStringCompareAndBranch(left, right);
2270 return MarkAsCall(result, instr); 2270 return MarkAsCall(result, instr);
2271 } 2271 }
2272 2272
2273 2273
2274 LInstruction* LChunkBuilder::DoSub(HSub* instr) { 2274 LInstruction* LChunkBuilder::DoSub(HSub* instr) {
2275 // TODO(jbramley): Add smi support. 2275 if (instr->representation().IsSmiOrInteger32()) {
2276 if (instr->representation().IsInteger32()) { 2276 ASSERT(instr->left()->representation().Equals(instr->representation()));
2277 ASSERT(instr->left()->representation().IsInteger32()); 2277 ASSERT(instr->right()->representation().Equals(instr->representation()));
2278 ASSERT(instr->right()->representation().IsInteger32());
2279
2280 LOperand *left; 2278 LOperand *left;
2281 if (instr->left()->IsConstant() && 2279 if (instr->left()->IsConstant() &&
2282 (HConstant::cast(instr->left())->Integer32Value() == 0)) { 2280 (HConstant::cast(instr->left())->Integer32Value() == 0)) {
2283 left = UseConstant(instr->left()); 2281 left = UseConstant(instr->left());
2284 } else { 2282 } else {
2285 left = UseRegisterAtStart(instr->left()); 2283 left = UseRegisterAtStart(instr->left());
2286 } 2284 }
2287 LOperand* right = UseRegisterOrConstantAtStart(instr->right()); 2285 LOperand* right = UseRegisterOrConstantAtStart(instr->right());
2288 LSubI* sub = new(zone()) LSubI(left, right); 2286 LInstruction* result = instr->representation().IsSmi() ?
2289 LInstruction* result = DefineAsRegister(sub); 2287 DefineAsRegister(new(zone()) LSubS(left, right)) :
2288 DefineAsRegister(new(zone()) LSubI(left, right));
2290 if (instr->CheckFlag(HValue::kCanOverflow)) { 2289 if (instr->CheckFlag(HValue::kCanOverflow)) {
2291 result = AssignEnvironment(result); 2290 result = AssignEnvironment(result);
2292 } 2291 }
2293 return result; 2292 return result;
2294 } else if (instr->representation().IsDouble()) { 2293 } else if (instr->representation().IsDouble()) {
2295 return DoArithmeticD(Token::SUB, instr); 2294 return DoArithmeticD(Token::SUB, instr);
2296 } else { 2295 } else {
2297 return DoArithmeticT(Token::SUB, instr); 2296 return DoArithmeticT(Token::SUB, instr);
2298 } 2297 }
2299 } 2298 }
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
2536 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { 2535 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) {
2537 LOperand* receiver = UseRegister(instr->receiver()); 2536 LOperand* receiver = UseRegister(instr->receiver());
2538 LOperand* function = UseRegisterAtStart(instr->function()); 2537 LOperand* function = UseRegisterAtStart(instr->function());
2539 LOperand* temp = TempRegister(); 2538 LOperand* temp = TempRegister();
2540 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function, temp); 2539 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function, temp);
2541 return AssignEnvironment(DefineAsRegister(result)); 2540 return AssignEnvironment(DefineAsRegister(result));
2542 } 2541 }
2543 2542
2544 2543
2545 } } // namespace v8::internal 2544 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/a64/lithium-a64.h ('k') | src/a64/lithium-codegen-a64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698