diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs index cc00b9f6db15c6..d8f9646f54e44b 100644 --- a/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs +++ b/src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs @@ -7929,25 +7929,25 @@ public static T XorRotateRight(T op1, T op2, int shift) where T : IBinaryInte public static sbyte SveShiftArithmeticSaturate(sbyte op1, sbyte op2) => ArithmeticShift(op1, (int)ShiftSat(-op2, 8), saturate: true); - public static sbyte SveShiftArithmeticRoundedSaturate(sbyte op1, sbyte op2) => SignedShift(op1, op2, rounding: true, saturating: true, shiftSat: true); + public static sbyte SveShiftArithmeticRoundedSaturate(sbyte op1, sbyte op2) => ArithmeticShift(op1, (int)ShiftSat(-op2, 8), rounding: true, saturate: true); public static short SveShiftArithmeticRounded(short op1, short op2) => SignedShift(op1, op2, rounding: true, shiftSat: true); public static short SveShiftArithmeticSaturate(short op1, short op2) => ArithmeticShift(op1, (int)ShiftSat(-op2, 16), saturate: true); - public static short SveShiftArithmeticRoundedSaturate(short op1, short op2) => SignedShift(op1, op2, rounding: true, saturating: true, shiftSat: true); + public static short SveShiftArithmeticRoundedSaturate(short op1, short op2) => ArithmeticShift(op1, (int)ShiftSat(-op2, 16), rounding: true, saturate: true); public static int SveShiftArithmeticRounded(int op1, int op2) => SignedShift(op1, op2, rounding: true, shiftSat: true); public static int SveShiftArithmeticSaturate(int op1, int op2) => ArithmeticShift(op1, (int)ShiftSat(-op2, 32), saturate: true); - public static int SveShiftArithmeticRoundedSaturate(int op1, int op2) => SignedShift(op1, op2, rounding: true, saturating: true, shiftSat: true); + public static int SveShiftArithmeticRoundedSaturate(int op1, int op2) => ArithmeticShift(op1, (int)ShiftSat(-op2, 32), rounding: true, saturate: true); public static long SveShiftArithmeticRounded(long op1, long op2) => SignedShift(op1, op2, rounding: true, shiftSat: true); public static long SveShiftArithmeticSaturate(long op1, long op2) => ArithmeticShift(op1, (int)ShiftSat(-op2, 64), saturate: true); - public static long SveShiftArithmeticRoundedSaturate(long op1, long op2) => SignedShift(op1, op2, rounding: true, saturating: true, shiftSat: true); + public static long SveShiftArithmeticRoundedSaturate(long op1, long op2) => ArithmeticShift(op1, (int)ShiftSat(-op2, 64), rounding: true, saturate: true); public static byte SveShiftLeftLogicalSaturate(byte op1, sbyte op2) => UnsignedShift(op1, op2, saturating: true, shiftSat: true); @@ -8015,14 +8015,13 @@ public static U ArithmeticShift(T value, int count, bool rounding = false, where U : IBinaryInteger, IMinMaxValue { BigInteger v = BigInteger.CreateChecked(value); - BigInteger shifted = new BigInteger(); + BigInteger shifted; if (count > 0) { if (rounding) { - long bias = 1L << (count - 1); - shifted = v >= 0 ? (v + bias) >> count - : (v - bias) >> count; + BigInteger bias = BigInteger.One << (count - 1); + shifted = (v + bias) >> count; } else {