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

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

Issue 219213003: Fixed power-of-2 predicates, excluding 0. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 6 years, 8 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-codegen-ia32.cc ('k') | src/objects.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 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 DeoptimizeIf(eq, instr->environment(), result_reg, Operand(zero_reg)); 1167 DeoptimizeIf(eq, instr->environment(), result_reg, Operand(zero_reg));
1168 } 1168 }
1169 __ bind(&done); 1169 __ bind(&done);
1170 } 1170 }
1171 1171
1172 1172
1173 void LCodeGen::DoDivByPowerOf2I(LDivByPowerOf2I* instr) { 1173 void LCodeGen::DoDivByPowerOf2I(LDivByPowerOf2I* instr) {
1174 Register dividend = ToRegister(instr->dividend()); 1174 Register dividend = ToRegister(instr->dividend());
1175 int32_t divisor = instr->divisor(); 1175 int32_t divisor = instr->divisor();
1176 Register result = ToRegister(instr->result()); 1176 Register result = ToRegister(instr->result());
1177 ASSERT(divisor == kMinInt || (divisor != 0 && IsPowerOf2(Abs(divisor)))); 1177 ASSERT(divisor == kMinInt || IsPowerOf2(Abs(divisor)));
1178 ASSERT(!result.is(dividend)); 1178 ASSERT(!result.is(dividend));
1179 1179
1180 // Check for (0 / -x) that will produce negative zero. 1180 // Check for (0 / -x) that will produce negative zero.
1181 HDiv* hdiv = instr->hydrogen(); 1181 HDiv* hdiv = instr->hydrogen();
1182 if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) { 1182 if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) {
1183 DeoptimizeIf(eq, instr->environment(), dividend, Operand(zero_reg)); 1183 DeoptimizeIf(eq, instr->environment(), dividend, Operand(zero_reg));
1184 } 1184 }
1185 // Check for (kMinInt / -1). 1185 // Check for (kMinInt / -1).
1186 if (hdiv->CheckFlag(HValue::kCanOverflow) && divisor == -1) { 1186 if (hdiv->CheckFlag(HValue::kCanOverflow) && divisor == -1) {
1187 DeoptimizeIf(eq, instr->environment(), dividend, Operand(kMinInt)); 1187 DeoptimizeIf(eq, instr->environment(), dividend, Operand(kMinInt));
(...skipping 4675 matching lines...) Expand 10 before | Expand all | Expand 10 after
5863 __ lw(result, FieldMemOperand(scratch, 5863 __ lw(result, FieldMemOperand(scratch,
5864 FixedArray::kHeaderSize - kPointerSize)); 5864 FixedArray::kHeaderSize - kPointerSize));
5865 __ bind(deferred->exit()); 5865 __ bind(deferred->exit());
5866 __ bind(&done); 5866 __ bind(&done);
5867 } 5867 }
5868 5868
5869 5869
5870 #undef __ 5870 #undef __
5871 5871
5872 } } // namespace v8::internal 5872 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698