Faster unsigned division by constants (#52893)
authorPent Ploompuu <kaalikas@gmail.com>
Tue, 18 May 2021 15:39:23 +0000 (18:39 +0300)
committerGitHub <noreply@github.com>
Tue, 18 May 2021 15:39:23 +0000 (08:39 -0700)
commitfdbef6ca18d902d78299dec50fe91fbbd16a94c9
tree5ddfdd66688813c8e3729e420429e83f197ca42b
parent7b7954aac35ff34e747a45ee51d58d56868f0aba
Faster unsigned division by constants (#52893)

* Faster unsigned division by constants

* Fix Arm build and add some tests.

* Improve register allocation

* Fix ARM64 codegen

* Fix MULHI flags

* Remove ARM32 codegen

* Widen 32bit UDIV to 64bit MULHI when possible. Improve register allocation.

* Always widen 32bit UDIV to 64bit MUL/MULHI

* Cleanup

* Final optimization

* Fix typo

* Rebase and use inst_Mov instead of inst_RV_RV(INS_mov)

* Fix formatting (1 space)
15 files changed:
THIRD-PARTY-NOTICES.TXT
src/coreclr/jit/assertionprop.cpp
src/coreclr/jit/codegen.h
src/coreclr/jit/codegenarm64.cpp
src/coreclr/jit/codegenarmarch.cpp
src/coreclr/jit/codegenxarch.cpp
src/coreclr/jit/compiler.h
src/coreclr/jit/compiler.hpp
src/coreclr/jit/gentree.cpp
src/coreclr/jit/gtlist.h
src/coreclr/jit/lower.cpp
src/coreclr/jit/utils.cpp
src/coreclr/jit/utils.h
src/tests/JIT/Math/Functions/DivideByConst.cs [new file with mode: 0644]
src/tests/JIT/Math/Functions/Program.cs