ARM64: Fix for casting long to ulong
authorKyungwoo Lee <kyulee@microsoft.com>
Fri, 26 Feb 2016 07:28:35 +0000 (23:28 -0800)
committerKyungwoo Lee <kyulee@microsoft.com>
Fri, 26 Feb 2016 07:41:30 +0000 (23:41 -0800)
commitb180cef309882d9a4b1bbeba3b3ce3ce30bff625
tree70d579d88a403ad4cb82d3bf550c17797c1217c3
parentc5146883f4dce3bd756f062fbe6e055ec9bcf3d5
ARM64: Fix for casting long to ulong

When converting long (i8) to ulong (u8) with overflow check,
JIT inadvertently inserts 4 byte mov which clears the upper bits.
This explicit conversion is only needed when converting from i4 to u8.

Before
IN0002: 000024      cmp     x0, dotnet/coreclr#0
IN0003: 000028      bge     G_M62889_IG03
IN0004: 00002C      bl      CORINFO_HELP_OVERFLOW
IN0005: 000030      mov     w0, w0   --> Incorrect conversion clearing the
upper 32 bits of x0.

After
IN0005: 000028      cmp     x0, dotnet/coreclr#0
IN0006: 00002C      bge     G_M62889_IG03
IN0007: 000030      bl      CORINFO_HELP_OVERFLOW

Commit migrated from https://github.com/dotnet/coreclr/commit/4ab7237cf21fe4b06d284b8998fb6ddb5d05b7bd
src/coreclr/src/jit/codegenarm64.cpp
src/coreclr/tests/arm64/Tests.lst