Fix GenerateShuffleArray to support cyclic shuffles (dotnet/coreclr#26169)
authorJUNG DONG-HEON <dheon.jung@samsung.com>
Thu, 28 May 2020 02:15:47 +0000 (11:15 +0900)
committer이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자 <leee.lee@samsung.com>
Wed, 17 Jun 2020 22:38:46 +0000 (07:38 +0900)
commit488be5d790020489f7f4dd7d43680f43b101dbd4
treee051d18299dfa580fabdb1ca32863f517f0ab356
parent45278569f1e32a5e3ab52f1643ee5f0f3b1f00c9
Fix GenerateShuffleArray to support cyclic shuffles (dotnet/coreclr#26169)

* Fix GenerateShuffleArray to support cyclic shuffles

The GenerateShuffleArray was not handling case when there was a cycle in
the register / stack slots shuffle and it resulted in an infinite loop
in this function. This issue is Unix Amd64 ABI specific.
To fix that, this change reworks the algorithm completely. Besides
fixing the issue, it has also better performance in some cases.
To fix the cyclic shuffling, I needed an extra helper register. However,
there was no available general purpose register available, so I had to
use xmm8 for this purpose.

* Remove special handling of the hang from ABI stress
src/vm/comdelegate.cpp
src/vm/comdelegate.h
src/vm/i386/stublinkerx86.cpp
src/vm/i386/stublinkerx86.h