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

Side by Side Diff: src/x64/lithium-codegen-x64.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/utils.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 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 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after
1202 if (divisor < 0) __ negl(rdx); 1202 if (divisor < 0) __ negl(rdx);
1203 __ decl(rdx); 1203 __ decl(rdx);
1204 __ bind(&done); 1204 __ bind(&done);
1205 } 1205 }
1206 1206
1207 1207
1208 void LCodeGen::DoDivByPowerOf2I(LDivByPowerOf2I* instr) { 1208 void LCodeGen::DoDivByPowerOf2I(LDivByPowerOf2I* instr) {
1209 Register dividend = ToRegister(instr->dividend()); 1209 Register dividend = ToRegister(instr->dividend());
1210 int32_t divisor = instr->divisor(); 1210 int32_t divisor = instr->divisor();
1211 Register result = ToRegister(instr->result()); 1211 Register result = ToRegister(instr->result());
1212 ASSERT(divisor == kMinInt || (divisor != 0 && IsPowerOf2(Abs(divisor)))); 1212 ASSERT(divisor == kMinInt || IsPowerOf2(Abs(divisor)));
1213 ASSERT(!result.is(dividend)); 1213 ASSERT(!result.is(dividend));
1214 1214
1215 // Check for (0 / -x) that will produce negative zero. 1215 // Check for (0 / -x) that will produce negative zero.
1216 HDiv* hdiv = instr->hydrogen(); 1216 HDiv* hdiv = instr->hydrogen();
1217 if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) { 1217 if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) {
1218 __ testl(dividend, dividend); 1218 __ testl(dividend, dividend);
1219 DeoptimizeIf(zero, instr->environment()); 1219 DeoptimizeIf(zero, instr->environment());
1220 } 1220 }
1221 // Check for (kMinInt / -1). 1221 // Check for (kMinInt / -1).
1222 if (hdiv->CheckFlag(HValue::kCanOverflow) && divisor == -1) { 1222 if (hdiv->CheckFlag(HValue::kCanOverflow) && divisor == -1) {
(...skipping 4410 matching lines...) Expand 10 before | Expand all | Expand 10 after
5633 __ bind(deferred->exit()); 5633 __ bind(deferred->exit());
5634 __ bind(&done); 5634 __ bind(&done);
5635 } 5635 }
5636 5636
5637 5637
5638 #undef __ 5638 #undef __
5639 5639
5640 } } // namespace v8::internal 5640 } } // namespace v8::internal
5641 5641
5642 #endif // V8_TARGET_ARCH_X64 5642 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698