[RyuJIT/ARM32] Fix assertion when using invalid imm for INS_add (dotnet/coreclr#12162)
authorSujin Kim <sjsujin.kim@samsung.com>
Tue, 13 Jun 2017 17:31:50 +0000 (02:31 +0900)
committerBruce Forstall <brucefo@microsoft.com>
Tue, 13 Jun 2017 17:31:50 +0000 (10:31 -0700)
commitb178ea466241743d8049d9d1fae218d1dcfb2b8a
tree24ff2f076f7e356a30b05ddcbfe14115a07d4273
parent4c9567bb7c73207269de59ccbf34cfcd4191b535
[RyuJIT/ARM32] Fix assertion when using invalid imm for INS_add (dotnet/coreclr#12162)

* [RyuJIT/ARM32] Fix assertion when using invalid imm for INS_add

`JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b54611/b54611/b54611.sh`

Assertion failed '!"Instruction cannot be encoded" has been occurred.

INS_add couldn't process with the invalid imm of -273 on this test.
So in this PR, If it got the value that cannot be processed, moving to register that after changing status would be ran so that it can be processed.

* Modify 'Lowering::IsContainableImmed' to work normally.

insFlags when the function is called was always INS_FLAGS_DONT_CARE.
In this case, if the imm is such as -273, the result would be false.

The correct flags have to be set.

* add ifdef for the flags variable

Commit migrated from https://github.com/dotnet/coreclr/commit/92fab181d26b47bc564add2c547e01cb1fa4bd95
src/coreclr/src/jit/lowerarmarch.cpp