x86/x64 port of Math.floor(x/y) to use integer division for specific divisor.
authoryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 20 Jun 2012 14:08:03 +0000 (14:08 +0000)
committeryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 20 Jun 2012 14:08:03 +0000 (14:08 +0000)
commite4f4aad2d13f87278b770674600d64612a51169a
tree15e0290bdebda738c83efb3076b37b5d331c2389
parentd31ed98428e499f3bed0f4f2676f5cb7b5fa710c
x86/x64 port of Math.floor(x/y) to use integer division for specific divisor.
Only handles when x is int32 and y is int32 constant.

BUG=v8:2038

Currently implemented by imul (not fpmul).
x86 and x64 algorithm differs a bit.
x86 implementation is kind of cumbersome, but I couldn't think of better ways.

Review URL: https://chromiumcodereview.appspot.com/10382033
Patch from Zheng Liu <zheng.z.liu@intel.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11887 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
12 files changed:
src/hydrogen-instructions.cc
src/hydrogen-instructions.h
src/ia32/disasm-ia32.cc
src/ia32/lithium-codegen-ia32.cc
src/ia32/lithium-ia32.cc
src/ia32/lithium-ia32.h
src/x64/disasm-x64.cc
src/x64/lithium-codegen-x64.cc
src/x64/lithium-x64.cc
src/x64/lithium-x64.h
test/mjsunit/math-floor-of-div-minus-zero.js [new file with mode: 0644]
test/mjsunit/mjsunit.status