diff --git a/Decoder/AOpCodeSimdImm.cs b/Decoder/AOpCodeSimdImm.cs index 2959aee..e7dfe62 100644 --- a/Decoder/AOpCodeSimdImm.cs +++ b/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/Instruction/AInstEmitSimdShift.cs b/Instruction/AInstEmitSimdShift.cs index bffed57..24d35ab 100644 --- a/Instruction/AInstEmitSimdShift.cs +++ b/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++) {