diff options
author | Michelle McDaniel <adiaaida@gmail.com> | 2016-10-20 23:50:23 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-20 23:50:23 -0400 |
commit | fd13c8956ac768649b41f50fd046dbc3547d36a4 (patch) | |
tree | bd15cbb199252b615e336a0f692764bb7393a500 /tests | |
parent | 21f4c8f7440fc2dddca366206356f3b9d57daf79 (diff) | |
parent | d24a3008cd1bbed78dd4e82414228da6e21361d2 (diff) | |
download | coreclr-fd13c8956ac768649b41f50fd046dbc3547d36a4.tar.gz coreclr-fd13c8956ac768649b41f50fd046dbc3547d36a4.tar.bz2 coreclr-fd13c8956ac768649b41f50fd046dbc3547d36a4.zip |
Merge pull request #7724 from adiaaida/implementDecomposeRotate
Implement DecomposeRotate
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/JIT/CodeGenBringUpTests/Rotate.cs | 70 |
1 files changed, 68 insertions, 2 deletions
diff --git a/tests/src/JIT/CodeGenBringUpTests/Rotate.cs b/tests/src/JIT/CodeGenBringUpTests/Rotate.cs index 74a936ef13..98ea563f85 100644 --- a/tests/src/JIT/CodeGenBringUpTests/Rotate.cs +++ b/tests/src/JIT/CodeGenBringUpTests/Rotate.cs @@ -102,12 +102,30 @@ public class Test [MethodImpl(MethodImplOptions.NoInlining)] static ulong rol64const() { - ulong value = flag() ? (ulong)0x123456789abcdef : (ulong)0x123456789abcdef; + ulong value = flag() ? (ulong)0x123456789abcdef : (ulong)0xabcdef123456789; int amount = 16; return (value >> (64 - amount)) | (value << amount); } [MethodImpl(MethodImplOptions.NoInlining)] + static ulong rol64_16(ulong value) + { + return (value >> (64 - 16)) | (value << 16); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + static ulong rol64_32(ulong value) + { + return (value >> (64 - 32)) | (value << 32); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + static ulong rol64_33(ulong value) + { + return (value >> (64 - 33)) | (value << 33); + } + + [MethodImpl(MethodImplOptions.NoInlining)] ulong rol64field(int amount) { return (field << amount) | (field >> (64 - amount)); @@ -128,12 +146,30 @@ public class Test [MethodImpl(MethodImplOptions.NoInlining)] static ulong ror64const() { - ulong value = flag() ? (ulong)0x123456789abcdef : (ulong)0x123456789abcdef; + ulong value = flag() ? (ulong)0x123456789abcdef : (ulong)0xabcdef123456789; int amount = flag() ? 5 : 5; return (value << (64 - amount)) | (value >> amount); } [MethodImpl(MethodImplOptions.NoInlining)] + static ulong ror64_5(ulong value) + { + return (value << (64 - 5)) | (value >> 5); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + static ulong ror64_32(ulong value) + { + return (value << (64 - 32)) | (value >> 32); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + static ulong ror64_33(ulong value) + { + return (value << (64 - 33)) | (value >> 33); + } + + [MethodImpl(MethodImplOptions.NoInlining)] static ulong ror64sfield(int amount) { return (s_field << (64 - amount)) | (s_field >> amount); @@ -244,6 +280,21 @@ public class Test return Fail; } + if (rol64_16(0x123456789abcdef) != 0x456789abcdef0123) + { + return Fail; + } + + if (rol64_32(0x123456789abcdef) != rol64(0x123456789abcdef, 32)) + { + return Fail; + } + + if (rol64_33(0x123456789abcdef) != rol64(0x123456789abcdef, 33)) + { + return Fail; + } + if (ror64(0x123456789abcdef, 0) != 0x123456789abcdef) { return Fail; @@ -259,6 +310,21 @@ public class Test return Fail; } + if (ror64_5(0x123456789abcdef) != 0x78091a2b3c4d5e6f) + { + return Fail; + } + + if (ror64_32(0x123456789abcdef) != ror64(0x123456789abcdef, 32)) + { + return Fail; + } + + if (ror64_33(0x123456789abcdef) != ror64(0x123456789abcdef, 33)) + { + return Fail; + } + if (rol32_call(0x12345678, 16) != 0x56781234) { return Fail; |