[Ryujit/ARM32] Implement NYI related with overflow for ARM (#10491)
authorSujin Kim <sjsujin.kim@samsung.com>
Thu, 30 Mar 2017 20:37:13 +0000 (05:37 +0900)
committerBruce Forstall <brucefo@microsoft.com>
Thu, 30 Mar 2017 20:37:13 +0000 (13:37 -0700)
commitf9380e912b105030cee06544338d6068fb7e97e7
tree06ae0897988f7bb0b3af1a98d6f367f134770bcc
parent0278c8561f68937b010e091fe0f8acd8c1b6910d
[Ryujit/ARM32] Implement NYI related with overflow for ARM (#10491)

* Implement NYI(overflow checks) for ARM

On last comment of #8496, the NYI message of overflow checks is printed after running the CodeGenBringUpTests.

That was the message about temp register setup for overflow checks.

It was referenced
https://github.com/dotnet/coreclr/blob/master/src/jit/lsraarm64.cpp#L399

I think it doesn't make any problem even though writing it the same as arm64.

* modifiy for coding convention

* Implement NYI : Unimplmented GT_CAST:int <--> int with overflow

I think it doesn't make any problem even though writing it the same as arm64.
So I copied parts of CodeGen::genIntToIntCast() and modified some below codes.

```
if (emitter::emitIns_valid_imm_for_cmp(castInfo.typeMax, cmpSize))
```
-->
```
if (emitter::emitIns_valid_imm_for_cmp(castInfo.typeMax, INS_FLAGS_DONT_CARE))
```

* Implement NYI : genLongToIntCast: overflow check

I copied and pasted codes from codegenxarch.cpp.
But It seemed be necessary that conditional execution values are changed by each architectures.
So I used 'genJumpKindForOper' for getting the emitJumpKind value.

The sample app has been checked to work well.

* Modify the implementation of emitter::emitIns_valid_imm_for_cmp

According to reference manual, I figured out CMP and ADD have different mechanisms on ARM unlike ARM64.
So I defined "...for_cmp" function not just use "..for_add" in the function likes ARM64.
src/jit/codegenarm.cpp
src/jit/emitarm.cpp
src/jit/emitarm.h
src/jit/lsraarm.cpp