diff options
author | Sujin Kim <sjsujin.kim@samsung.com> | 2017-03-31 05:37:13 +0900 |
---|---|---|
committer | Bruce Forstall <brucefo@microsoft.com> | 2017-03-30 13:37:13 -0700 |
commit | f9380e912b105030cee06544338d6068fb7e97e7 (patch) | |
tree | 06ae0897988f7bb0b3af1a98d6f367f134770bcc /src/jit/emitarm.cpp | |
parent | 0278c8561f68937b010e091fe0f8acd8c1b6910d (diff) | |
download | coreclr-f9380e912b105030cee06544338d6068fb7e97e7.tar.gz coreclr-f9380e912b105030cee06544338d6068fb7e97e7.tar.bz2 coreclr-f9380e912b105030cee06544338d6068fb7e97e7.zip |
[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.
Diffstat (limited to 'src/jit/emitarm.cpp')
-rw-r--r-- | src/jit/emitarm.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/jit/emitarm.cpp b/src/jit/emitarm.cpp index f7943f2ffd..77ee3cfc18 100644 --- a/src/jit/emitarm.cpp +++ b/src/jit/emitarm.cpp @@ -1380,7 +1380,7 @@ DONE: /***************************************************************************** * - * emitIns_valid_imm_for_add() returns true when the immediate 'imm' + * emitins_valid_imm_for_add() returns true when the immediate 'imm' * can be encoded using a single add or sub instruction. */ /*static*/ bool emitter::emitIns_valid_imm_for_add(int imm, insFlags flags) @@ -1396,6 +1396,20 @@ DONE: /***************************************************************************** * + * emitins_valid_imm_for_cmp() returns true if this 'imm' + * can be encoded as a input operand to an cmp instruction. + */ +/*static*/ bool emitter::emitIns_valid_imm_for_cmp(int imm, insFlags flags) +{ + if (isModImmConst(imm)) // funky arm immediate + return true; + if (isModImmConst(-imm)) // funky arm immediate via sub + return true; + return false; +} + +/***************************************************************************** + * * emitIns_valid_imm_for_add_sp() returns true when the immediate 'imm' * can be encoded in "add Rd,SP,i10". */ |