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

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

Issue 141653015: Simplify HUnaryMathOperation::Canonicalize. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Feedback Created 6 years, 11 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/ia32/lithium-ia32.cc ('k') | src/mips/lithium-mips.h » ('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 2012 the V8 project authors. All rights reserved.7 1 // Copyright 2012 the V8 project authors. All rights reserved.7
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 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 1059
1060 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { 1060 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) {
1061 GenerateOsrPrologue(); 1061 GenerateOsrPrologue();
1062 } 1062 }
1063 1063
1064 1064
1065 void LCodeGen::DoModI(LModI* instr) { 1065 void LCodeGen::DoModI(LModI* instr) {
1066 HMod* hmod = instr->hydrogen(); 1066 HMod* hmod = instr->hydrogen();
1067 HValue* left = hmod->left(); 1067 HValue* left = hmod->left();
1068 HValue* right = hmod->right(); 1068 HValue* right = hmod->right();
1069 if (hmod->HasPowerOf2Divisor()) { 1069 if (hmod->RightIsPowerOf2()) {
1070 const Register left_reg = ToRegister(instr->left()); 1070 const Register left_reg = ToRegister(instr->left());
1071 const Register result_reg = ToRegister(instr->result()); 1071 const Register result_reg = ToRegister(instr->result());
1072 1072
1073 // Note: The code below even works when right contains kMinInt. 1073 // Note: The code below even works when right contains kMinInt.
1074 int32_t divisor = Abs(right->GetInteger32Constant()); 1074 int32_t divisor = Abs(right->GetInteger32Constant());
1075 1075
1076 Label left_is_not_negative, done; 1076 Label left_is_not_negative, done;
1077 if (left->CanBeNegative()) { 1077 if (left->CanBeNegative()) {
1078 __ Branch(left_reg.is(result_reg) ? PROTECT : USE_DELAY_SLOT, 1078 __ Branch(left_reg.is(result_reg) ? PROTECT : USE_DELAY_SLOT,
1079 &left_is_not_negative, ge, left_reg, Operand(zero_reg)); 1079 &left_is_not_negative, ge, left_reg, Operand(zero_reg));
(...skipping 4736 matching lines...) Expand 10 before | Expand all | Expand 10 after
5816 __ Subu(scratch, result, scratch); 5816 __ Subu(scratch, result, scratch);
5817 __ lw(result, FieldMemOperand(scratch, 5817 __ lw(result, FieldMemOperand(scratch,
5818 FixedArray::kHeaderSize - kPointerSize)); 5818 FixedArray::kHeaderSize - kPointerSize));
5819 __ bind(&done); 5819 __ bind(&done);
5820 } 5820 }
5821 5821
5822 5822
5823 #undef __ 5823 #undef __
5824 5824
5825 } } // namespace v8::internal 5825 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | src/mips/lithium-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698