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

Side by Side Diff: src/arm/lithium-codegen-arm.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 | « no previous file | src/arm64/lithium-codegen-arm64.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after
1286 } 1286 }
1287 __ bind(&done); 1287 __ bind(&done);
1288 } 1288 }
1289 } 1289 }
1290 1290
1291 1291
1292 void LCodeGen::DoDivByPowerOf2I(LDivByPowerOf2I* instr) { 1292 void LCodeGen::DoDivByPowerOf2I(LDivByPowerOf2I* instr) {
1293 Register dividend = ToRegister(instr->dividend()); 1293 Register dividend = ToRegister(instr->dividend());
1294 int32_t divisor = instr->divisor(); 1294 int32_t divisor = instr->divisor();
1295 Register result = ToRegister(instr->result()); 1295 Register result = ToRegister(instr->result());
1296 ASSERT(divisor == kMinInt || (divisor != 0 && IsPowerOf2(Abs(divisor)))); 1296 ASSERT(divisor == kMinInt || IsPowerOf2(Abs(divisor)));
1297 ASSERT(!result.is(dividend)); 1297 ASSERT(!result.is(dividend));
1298 1298
1299 // Check for (0 / -x) that will produce negative zero. 1299 // Check for (0 / -x) that will produce negative zero.
1300 HDiv* hdiv = instr->hydrogen(); 1300 HDiv* hdiv = instr->hydrogen();
1301 if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) { 1301 if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) {
1302 __ cmp(dividend, Operand::Zero()); 1302 __ cmp(dividend, Operand::Zero());
1303 DeoptimizeIf(eq, instr->environment()); 1303 DeoptimizeIf(eq, instr->environment());
1304 } 1304 }
1305 // Check for (kMinInt / -1). 1305 // Check for (kMinInt / -1).
1306 if (hdiv->CheckFlag(HValue::kCanOverflow) && divisor == -1) { 1306 if (hdiv->CheckFlag(HValue::kCanOverflow) && divisor == -1) {
(...skipping 4481 matching lines...) Expand 10 before | Expand all | Expand 10 after
5788 __ ldr(result, FieldMemOperand(scratch, 5788 __ ldr(result, FieldMemOperand(scratch,
5789 FixedArray::kHeaderSize - kPointerSize)); 5789 FixedArray::kHeaderSize - kPointerSize));
5790 __ bind(deferred->exit()); 5790 __ bind(deferred->exit());
5791 __ bind(&done); 5791 __ bind(&done);
5792 } 5792 }
5793 5793
5794 5794
5795 #undef __ 5795 #undef __
5796 5796
5797 } } // namespace v8::internal 5797 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/arm64/lithium-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698