Here is the extracted patch. I micro-benchmarked the different cases handled by the previous patch. It turns out that the integer division routine is generally slower than transitioning to VFP, so I removed that. I wished we had a SDIV... So on ARM we only handles division by a some constant divisors (see utils.h and the algorithm).
This should be very easily portable to other architectures, especially if an integer instruction is available. When this is done a few methods like LChunkBuilder::SupportsMathFloorOfDiv() can be removed. Alexandre On Thu, Mar 8, 2012 at 4:59 PM, <[email protected]> wrote: > Reviewers: danno, > > Message: > This supercedes our "optimise bitwise operations" patch. > > Description: > optimise Math.floor(x/y) to use integer divisiion for specific divisor. > > BUG=none > TEST=mjsunit/math-floor-of-**div.js > > > > Please review this at > http://codereview.chromium.**org/9638018/<http://codereview.chromium.org/9638018/> > > SVN Base: > http://v8.googlecode.com/svn/**branches/bleeding_edge/<http://v8.googlecode.com/svn/branches/bleeding_edge/> > > Affected files: > M src/arm/lithium-arm.h > M src/arm/lithium-arm.cc > M src/arm/lithium-codegen-arm.h > M src/arm/lithium-codegen-arm.cc > M src/arm/macro-assembler-arm.h > M src/arm/macro-assembler-arm.cc > M src/compiler-intrinsics.h > M src/frames.cc > M src/hydrogen-instructions.h > M src/hydrogen-instructions.cc > M src/ia32/lithium-ia32.h > M src/ia32/lithium-ia32.cc > M src/mips/lithium-mips.h > M src/mips/lithium-mips.cc > M src/utils.h > M src/utils.cc > M src/x64/lithium-x64.h > M src/x64/lithium-x64.cc > A test/mjsunit/math-floor-of-**div.js > > > -- > v8-dev mailing list > [email protected] > http://groups.google.com/**group/v8-dev<http://groups.google.com/group/v8-dev> -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
