aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2018-03-14 01:59:22 -0300
committergdkchan <gab.dark.100@gmail.com>2018-03-14 01:59:22 -0300
commitb50bc46888cf9a8d94ae1590c0941be62a083533 (patch)
tree1ed79b142b9decaf2d605e7f48019acd6dbd4bc3
parentd067b4d5e0e7860702bb9a10c832a46d15176fd8 (diff)
CPU fix for the cases using a Mask with shift = 0
-rw-r--r--ChocolArm64/Decoder/AOpCodeSimdImm.cs9
-rw-r--r--ChocolArm64/Instruction/AInstEmitSimdShift.cs2
2 files changed, 9 insertions, 2 deletions
diff --git a/ChocolArm64/Decoder/AOpCodeSimdImm.cs b/ChocolArm64/Decoder/AOpCodeSimdImm.cs
index 2959aee6..e7dfe621 100644
--- a/ChocolArm64/Decoder/AOpCodeSimdImm.cs
+++ b/ChocolArm64/Decoder/AOpCodeSimdImm.cs
@@ -88,7 +88,14 @@ namespace ChocolArm64.Decoder
private static long ShlOnes(long Value, int Shift)
{
- return Value << Shift | (long)(ulong.MaxValue >> (64 - Shift));
+ if (Shift != 0)
+ {
+ return Value << Shift | (long)(ulong.MaxValue >> (64 - Shift));
+ }
+ else
+ {
+ return Value;
+ }
}
}
} \ No newline at end of file
diff --git a/ChocolArm64/Instruction/AInstEmitSimdShift.cs b/ChocolArm64/Instruction/AInstEmitSimdShift.cs
index bffed57e..24d35abe 100644
--- a/ChocolArm64/Instruction/AInstEmitSimdShift.cs
+++ b/ChocolArm64/Instruction/AInstEmitSimdShift.cs
@@ -58,7 +58,7 @@ namespace ChocolArm64.Instruction
int Shift = Op.Imm - (8 << Op.Size);
- ulong Mask = ulong.MaxValue >> (64 - Shift);
+ ulong Mask = Shift != 0 ? ulong.MaxValue >> (64 - Shift) : 0;
for (int Index = 0; Index < (Bytes >> Op.Size); Index++)
{