From 9be7f36b4e238fb9cb47b2bc5a9fb901535171dd Mon Sep 17 00:00:00 2001 From: Hecate2 <2474101468@qq.com> Date: Fri, 13 Sep 2024 21:56:38 +0800 Subject: [PATCH] misc math optimizations (#1167) --- .../System/SystemCall.BigInteger.cs | 127 ++++++++++-------- .../MethodConvert/System/SystemCall.Int.cs | 41 +----- .../MethodConvert/System/SystemCall.Long.cs | 41 +----- .../MethodConvert/System/SystemCall.SByte.cs | 41 +----- .../MethodConvert/System/SystemCall.Short.cs | 41 +----- .../TestingArtifacts/Contract_BigInteger.cs | 4 +- .../TestingArtifacts/Contract_Integer.cs | 4 +- .../UnitTest_BigInteger.cs | 24 +--- .../UnitTest_Integer.cs | 123 ++++++++--------- 9 files changed, 155 insertions(+), 291 deletions(-) diff --git a/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.BigInteger.cs b/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.BigInteger.cs index 3ad882b3f..2bbfaa7f4 100644 --- a/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.BigInteger.cs +++ b/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.BigInteger.cs @@ -57,10 +57,13 @@ private static void HandleBigIntegerIsEven(MethodConvert methodConvert, Semantic methodConvert.ConvertExpression(model, instanceExpression); if (arguments is not null) methodConvert.PrepareArgumentsForMethod(model, symbol, arguments); - methodConvert.Push(1); - methodConvert.AddInstruction(OpCode.AND); - methodConvert.Push(0); - methodConvert.AddInstruction(OpCode.NUMEQUAL); + methodConvert.Push(2); + methodConvert.AddInstruction(OpCode.MOD); + methodConvert.AddInstruction(OpCode.NOT); // BigInteger GetBoolean() => !value.IsZero; + //methodConvert.Push(1); + //methodConvert.AddInstruction(OpCode.AND); + //methodConvert.Push(0); + //methodConvert.AddInstruction(OpCode.NUMEQUAL); } private static void HandleBigIntegerSign(MethodConvert methodConvert, SemanticModel model, IMethodSymbol symbol, ExpressionSyntax? instanceExpression, IReadOnlyList? arguments) @@ -333,10 +336,13 @@ private static void HandleBigIntegerIsOdd(MethodConvert methodConvert, SemanticM methodConvert.ConvertExpression(model, instanceExpression); if (arguments is not null) methodConvert.PrepareArgumentsForMethod(model, symbol, arguments); - methodConvert.Push(1); - methodConvert.AddInstruction(OpCode.AND); - methodConvert.Push(0); - methodConvert.AddInstruction(OpCode.NUMNOTEQUAL); + methodConvert.Push(2); + methodConvert.AddInstruction(OpCode.MOD); + methodConvert.AddInstruction(OpCode.NZ); + //methodConvert.Push(1); + //methodConvert.AddInstruction(OpCode.AND); + //methodConvert.Push(0); + //methodConvert.AddInstruction(OpCode.NUMNOTEQUAL); } // HandleBigIntegerIsNegative @@ -346,9 +352,17 @@ private static void HandleBigIntegerIsNegative(MethodConvert methodConvert, Sema methodConvert.ConvertExpression(model, instanceExpression); if (arguments is not null) methodConvert.PrepareArgumentsForMethod(model, symbol, arguments); - methodConvert.AddInstruction(OpCode.SIGN); + //methodConvert.AddInstruction(OpCode.SIGN); methodConvert.Push(0); methodConvert.AddInstruction(OpCode.LT); + // The following is cheaper than methodConvert.AddInstruction(OpCode.LT); + //JumpTarget isNegative = new(); + //JumpTarget end = new(); + //methodConvert.Jump(OpCode.JMPLT, isNegative); + //methodConvert.AddInstruction(OpCode.PUSHF); + //methodConvert.Jump(OpCode.JMP, end); + //isNegative.Instruction = methodConvert.AddInstruction(OpCode.PUSHT); + //end.Instruction = methodConvert.AddInstruction(OpCode.NOP); } // HandleBigIntegerIsPositive @@ -358,9 +372,19 @@ private static void HandleBigIntegerIsPositive(MethodConvert methodConvert, Sema methodConvert.ConvertExpression(model, instanceExpression); if (arguments is not null) methodConvert.PrepareArgumentsForMethod(model, symbol, arguments); - methodConvert.AddInstruction(OpCode.SIGN); + //methodConvert.AddInstruction(OpCode.SIGN); methodConvert.Push(0); methodConvert.AddInstruction(OpCode.GE); + // The following is cheaper than methodConvert.AddInstruction(OpCode.GE); + //JumpTarget isPositive = new(); + //JumpTarget end = new(); + //methodConvert.Jump(OpCode.JMPGE, isPositive); + //methodConvert.AddInstruction(OpCode.PUSHF); + //methodConvert.Jump(OpCode.JMP, end); + //isPositive.Instruction = methodConvert.AddInstruction(OpCode.PUSHT); + //end.Instruction = methodConvert.AddInstruction(OpCode.NOP); + // GE instead of GT, because C# BigInteger works like that + // https://github.com/dotnet/runtime/blob/5535e31a712343a63f5d7d796cd874e563e5ac14/src/libraries/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs#L4098C13-L4098C37 } //HandleBigIntegerIsPow2 @@ -370,6 +394,7 @@ private static void HandleBigIntegerIsPow2(MethodConvert methodConvert, Semantic methodConvert.ConvertExpression(model, instanceExpression); if (arguments is not null) methodConvert.PrepareArgumentsForMethod(model, symbol, arguments); + // (n & (n-1) == 0) and (n != 0) JumpTarget endFalse = new(); JumpTarget endTrue = new(); JumpTarget endTarget = new(); @@ -400,38 +425,33 @@ private static void HandleBigIntegerLog2(MethodConvert methodConvert, SemanticMo if (arguments is not null) methodConvert.PrepareArgumentsForMethod(model, symbol, arguments); - JumpTarget endLoop = new(); - JumpTarget negativeInput = new(); - JumpTarget zeroTarget = new(); + JumpTarget nonNegativeTarget = new(); + JumpTarget endMethod = new(); methodConvert.AddInstruction(OpCode.DUP);// 5 5 methodConvert.AddInstruction(OpCode.PUSH0); // 5 5 0 - methodConvert.Jump(OpCode.JMPEQ, zeroTarget); // 5 + methodConvert.Jump(OpCode.JMPGE, nonNegativeTarget); // 5 + methodConvert.AddInstruction(OpCode.THROW); + nonNegativeTarget.Instruction = methodConvert.AddInstruction(OpCode.NOP); methodConvert.AddInstruction(OpCode.DUP);// 5 5 methodConvert.AddInstruction(OpCode.PUSH0); // 5 5 0 - methodConvert.Jump(OpCode.JMPLT, negativeInput); // 5 - methodConvert.AddInstruction(OpCode.PUSHM1);// 5 -1 + methodConvert.Jump(OpCode.JMPEQ, endMethod); // 0 // return 0 when input is 0 + methodConvert.AddInstruction(OpCode.PUSH0);// 5 0 + //input = 5 > 0; result = 0; + //do + // result += 1 + //while (input >> result) > 0 + //result -= 1 JumpTarget loopStart = new(); - loopStart.Instruction = methodConvert.AddInstruction(OpCode.SWAP); // -1 5 - methodConvert.AddInstruction(OpCode.DUP); // -1 5 5 - methodConvert.AddInstruction(OpCode.PUSH0); // -1 5 5 0 - methodConvert.Jump(OpCode.JMPEQ, endLoop); // -1 5 - methodConvert.AddInstruction(OpCode.PUSH1); // -1 5 1 - methodConvert.AddInstruction(OpCode.SHR); // -1 5>>1 - methodConvert.AddInstruction(OpCode.SWAP); // 5>>1 -1 - methodConvert.AddInstruction(OpCode.INC); // 5>>1 -1+1 - methodConvert.Jump(OpCode.JMP, loopStart); - endLoop.Instruction = methodConvert.AddInstruction(OpCode.NOP); - methodConvert.AddInstruction(OpCode.DROP); // -1 - JumpTarget endMethod = new(); - methodConvert.Jump(OpCode.JMP, endMethod); - zeroTarget.Instruction = methodConvert.AddInstruction(OpCode.NOP); - methodConvert.AddInstruction(OpCode.DROP); - methodConvert.Push(0); - methodConvert.Jump(OpCode.JMP, endMethod); - negativeInput.Instruction = methodConvert.AddInstruction(OpCode.DROP); - methodConvert.AddInstruction(OpCode.THROW); + loopStart.Instruction = methodConvert.AddInstruction(OpCode.NOP); // 5 0 + methodConvert.AddInstruction(OpCode.INC);// 5 1 + methodConvert.AddInstruction(OpCode.OVER);// 5 1 5 + methodConvert.AddInstruction(OpCode.OVER);// 5 1 5 1 + methodConvert.AddInstruction(OpCode.SHR); // 5 1 5>>1 + methodConvert.AddInstruction(OpCode.PUSH0); // 5 1 5>>1 0 + methodConvert.Jump(OpCode.JMPGT, loopStart); // 5 1 + methodConvert.AddInstruction(OpCode.NIP); // 1 + methodConvert.AddInstruction(OpCode.DEC); // 0 endMethod.Instruction = methodConvert.AddInstruction(OpCode.NOP); - } // HandleBigIntegerCopySign @@ -443,30 +463,19 @@ private static void HandleBigIntegerCopySign(MethodConvert methodConvert, Semant methodConvert.ConvertExpression(model, instanceExpression); if (arguments is not null) methodConvert.PrepareArgumentsForMethod(model, symbol, arguments, CallingConvention.StdCall); - JumpTarget nonZeroTarget = new(); - JumpTarget nonZeroTarget2 = new(); - // a b - methodConvert.AddInstruction(OpCode.SIGN); // a 1 - methodConvert.AddInstruction(OpCode.DUP); // a 1 1 - methodConvert.Push(0); // a 1 1 0 - methodConvert.Jump(OpCode.JMPLT, nonZeroTarget); // a 1 - methodConvert.AddInstruction(OpCode.DROP); - methodConvert.Push(1); // a 1 - nonZeroTarget.Instruction = methodConvert.AddInstruction(OpCode.NOP); // a 1 - methodConvert.AddInstruction(OpCode.SWAP); // 1 a - methodConvert.AddInstruction(OpCode.DUP);// 1 a a - methodConvert.AddInstruction(OpCode.SIGN);// 1 a 0 - methodConvert.AddInstruction(OpCode.DUP);// 1 a 0 0 - methodConvert.Push(0); // 1 a 0 0 0 - methodConvert.Jump(OpCode.JMPLT, nonZeroTarget2); // 1 a 0 - methodConvert.AddInstruction(OpCode.DROP); - methodConvert.Push(1); - nonZeroTarget2.Instruction = methodConvert.AddInstruction(OpCode.NOP); // 1 a 1 - methodConvert.AddInstruction(OpCode.ROT);// a 1 1 - methodConvert.AddInstruction(OpCode.EQUAL);// a 1 1 + JumpTarget negativeTarget = new(); JumpTarget endTarget = new(); - methodConvert.Jump(OpCode.JMPIF, endTarget); // a - methodConvert.AddInstruction(OpCode.NEGATE); + // a b + // if a==0 return 0 + // if b==0 return abs(a) + // return value has abs(value)==abs(a), sign(value)==sign(b) + methodConvert.AddInstruction(OpCode.PUSH0); // a b 0 + methodConvert.Jump(OpCode.JMPLT, negativeTarget); // a + methodConvert.AddInstruction(OpCode.ABS); // abs(a) + methodConvert.Jump(OpCode.JMP, endTarget); // abs(a) + negativeTarget.Instruction = methodConvert.AddInstruction(OpCode.NOP); + methodConvert.AddInstruction(OpCode.ABS); // abs(a) + methodConvert.AddInstruction(OpCode.NEGATE);// -abs(a) endTarget.Instruction = methodConvert.AddInstruction(OpCode.NOP); } diff --git a/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.Int.cs b/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.Int.cs index 3a6ee4181..2c2aef18c 100644 --- a/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.Int.cs +++ b/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.Int.cs @@ -74,44 +74,13 @@ private static void HandleIntCopySign(MethodConvert methodConvert, SemanticModel IMethodSymbol symbol, ExpressionSyntax? instanceExpression, IReadOnlyList? arguments) { - if (instanceExpression is not null) - methodConvert.ConvertExpression(model, instanceExpression); - if (arguments is not null) - methodConvert.PrepareArgumentsForMethod(model, symbol, arguments, CallingConvention.StdCall); - JumpTarget nonZeroTarget = new(); - JumpTarget nonZeroTarget2 = new(); - // a b - methodConvert.AddInstruction(OpCode.SIGN); // a 1 - methodConvert.AddInstruction(OpCode.DUP); // a 1 1 - methodConvert.Push(0); // a 1 1 0 - methodConvert.Jump(OpCode.JMPLT, nonZeroTarget); // a 1 - methodConvert.AddInstruction(OpCode.DROP); - methodConvert.Push(1); // a 1 - nonZeroTarget.Instruction = methodConvert.AddInstruction(OpCode.NOP); // a 1 - methodConvert.AddInstruction(OpCode.SWAP); // 1 a - methodConvert.AddInstruction(OpCode.DUP);// 1 a a - methodConvert.AddInstruction(OpCode.SIGN);// 1 a 0 - methodConvert.AddInstruction(OpCode.DUP);// 1 a 0 0 - methodConvert.Push(0); // 1 a 0 0 0 - methodConvert.Jump(OpCode.JMPLT, nonZeroTarget2); // 1 a 0 - methodConvert.AddInstruction(OpCode.DROP); - methodConvert.Push(1); - nonZeroTarget2.Instruction = methodConvert.AddInstruction(OpCode.NOP); // 1 a 1 - methodConvert.AddInstruction(OpCode.ROT);// a 1 1 - methodConvert.AddInstruction(OpCode.EQUAL);// a 1 1 - JumpTarget endTarget = new(); - methodConvert.Jump(OpCode.JMPIF, endTarget); // a - methodConvert.AddInstruction(OpCode.NEGATE); - endTarget.Instruction = methodConvert.AddInstruction(OpCode.NOP); - - var endTarget2 = new JumpTarget(); + HandleBigIntegerCopySign(methodConvert, model, symbol, instanceExpression, arguments); + JumpTarget noOverflowTarget = new(); methodConvert.AddInstruction(OpCode.DUP); - methodConvert.Push(int.MinValue); - methodConvert.Push(new BigInteger(int.MaxValue) + 1); - methodConvert.AddInstruction(OpCode.WITHIN); - methodConvert.Jump(OpCode.JMPIF, endTarget2); + methodConvert.Push(int.MaxValue); + methodConvert.Jump(OpCode.JMPLE, noOverflowTarget); methodConvert.AddInstruction(OpCode.THROW); - endTarget2.Instruction = methodConvert.AddInstruction(OpCode.NOP); + noOverflowTarget.Instruction = methodConvert.AddInstruction(OpCode.NOP); } // HandleIntCreateChecked diff --git a/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.Long.cs b/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.Long.cs index eb89dcaee..ea9d5f336 100644 --- a/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.Long.cs +++ b/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.Long.cs @@ -76,44 +76,13 @@ private static void HandleLongCopySign(MethodConvert methodConvert, SemanticMode IMethodSymbol symbol, ExpressionSyntax? instanceExpression, IReadOnlyList? arguments) { - if (instanceExpression is not null) - methodConvert.ConvertExpression(model, instanceExpression); - if (arguments is not null) - methodConvert.PrepareArgumentsForMethod(model, symbol, arguments, CallingConvention.StdCall); - JumpTarget nonZeroTarget = new(); - JumpTarget nonZeroTarget2 = new(); - // a b - methodConvert.AddInstruction(OpCode.SIGN); // a 1 - methodConvert.AddInstruction(OpCode.DUP); // a 1 1 - methodConvert.Push(0); // a 1 1 0 - methodConvert.Jump(OpCode.JMPLT, nonZeroTarget); // a 1 - methodConvert.AddInstruction(OpCode.DROP); - methodConvert.Push(1); // a 1 - nonZeroTarget.Instruction = methodConvert.AddInstruction(OpCode.NOP); // a 1 - methodConvert.AddInstruction(OpCode.SWAP); // 1 a - methodConvert.AddInstruction(OpCode.DUP);// 1 a a - methodConvert.AddInstruction(OpCode.SIGN);// 1 a 0 - methodConvert.AddInstruction(OpCode.DUP);// 1 a 0 0 - methodConvert.Push(0); // 1 a 0 0 0 - methodConvert.Jump(OpCode.JMPLT, nonZeroTarget2); // 1 a 0 - methodConvert.AddInstruction(OpCode.DROP); - methodConvert.Push(1); - nonZeroTarget2.Instruction = methodConvert.AddInstruction(OpCode.NOP); // 1 a 1 - methodConvert.AddInstruction(OpCode.ROT);// a 1 1 - methodConvert.AddInstruction(OpCode.EQUAL);// a 1 1 - JumpTarget endTarget = new(); - methodConvert.Jump(OpCode.JMPIF, endTarget); // a - methodConvert.AddInstruction(OpCode.NEGATE); - endTarget.Instruction = methodConvert.AddInstruction(OpCode.NOP); - var endTarget2 = new JumpTarget(); + HandleBigIntegerCopySign(methodConvert, model, symbol, instanceExpression, arguments); + JumpTarget noOverflowTarget = new(); methodConvert.AddInstruction(OpCode.DUP); - methodConvert.Push(long.MinValue); - methodConvert.Push(new BigInteger(long.MaxValue) + 1); - methodConvert.AddInstruction(OpCode.WITHIN); - methodConvert.Jump(OpCode.JMPIF, endTarget2); + methodConvert.Push(long.MaxValue); + methodConvert.Jump(OpCode.JMPLE, noOverflowTarget); methodConvert.AddInstruction(OpCode.THROW); - endTarget2.Instruction = methodConvert.AddInstruction(OpCode.NOP); - + noOverflowTarget.Instruction = methodConvert.AddInstruction(OpCode.NOP); } // HandleLongCreateChecked diff --git a/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.SByte.cs b/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.SByte.cs index 40b1496bf..65b8e9a99 100644 --- a/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.SByte.cs +++ b/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.SByte.cs @@ -75,44 +75,13 @@ private static void HandleSByteCopySign(MethodConvert methodConvert, SemanticMod IMethodSymbol symbol, ExpressionSyntax? instanceExpression, IReadOnlyList? arguments) { - if (instanceExpression is not null) - methodConvert.ConvertExpression(model, instanceExpression); - if (arguments is not null) - methodConvert.PrepareArgumentsForMethod(model, symbol, arguments, CallingConvention.StdCall); - JumpTarget nonZeroTarget = new(); - JumpTarget nonZeroTarget2 = new(); - // a b - methodConvert.AddInstruction(OpCode.SIGN); // a 1 - methodConvert.AddInstruction(OpCode.DUP); // a 1 1 - methodConvert.Push(0); // a 1 1 0 - methodConvert.Jump(OpCode.JMPLT, nonZeroTarget); // a 1 - methodConvert.AddInstruction(OpCode.DROP); - methodConvert.Push(1); // a 1 - nonZeroTarget.Instruction = methodConvert.AddInstruction(OpCode.NOP); // a 1 - methodConvert.AddInstruction(OpCode.SWAP); // 1 a - methodConvert.AddInstruction(OpCode.DUP);// 1 a a - methodConvert.AddInstruction(OpCode.SIGN);// 1 a 0 - methodConvert.AddInstruction(OpCode.DUP);// 1 a 0 0 - methodConvert.Push(0); // 1 a 0 0 0 - methodConvert.Jump(OpCode.JMPLT, nonZeroTarget2); // 1 a 0 - methodConvert.AddInstruction(OpCode.DROP); - methodConvert.Push(1); - nonZeroTarget2.Instruction = methodConvert.AddInstruction(OpCode.NOP); // 1 a 1 - methodConvert.AddInstruction(OpCode.ROT);// a 1 1 - methodConvert.AddInstruction(OpCode.EQUAL);// a 1 1 - JumpTarget endTarget = new(); - methodConvert.Jump(OpCode.JMPIF, endTarget); // a - methodConvert.AddInstruction(OpCode.NEGATE); - endTarget.Instruction = methodConvert.AddInstruction(OpCode.NOP); - - var endTarget2 = new JumpTarget(); + HandleBigIntegerCopySign(methodConvert, model, symbol, instanceExpression, arguments); + JumpTarget noOverflowTarget = new(); methodConvert.AddInstruction(OpCode.DUP); - methodConvert.Push(sbyte.MinValue); - methodConvert.Push(new BigInteger(sbyte.MaxValue) + 1); - methodConvert.AddInstruction(OpCode.WITHIN); - methodConvert.Jump(OpCode.JMPIF, endTarget2); + methodConvert.Push(sbyte.MaxValue); + methodConvert.Jump(OpCode.JMPLE, noOverflowTarget); methodConvert.AddInstruction(OpCode.THROW); - endTarget2.Instruction = methodConvert.AddInstruction(OpCode.NOP); + noOverflowTarget.Instruction = methodConvert.AddInstruction(OpCode.NOP); } // HandleSByteCreateChecked diff --git a/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.Short.cs b/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.Short.cs index db90790cf..c234e9392 100644 --- a/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.Short.cs +++ b/src/Neo.Compiler.CSharp/MethodConvert/System/SystemCall.Short.cs @@ -79,44 +79,13 @@ private static void HandleShortCopySign(MethodConvert methodConvert, SemanticMod IMethodSymbol symbol, ExpressionSyntax? instanceExpression, IReadOnlyList? arguments) { - if (instanceExpression is not null) - methodConvert.ConvertExpression(model, instanceExpression); - if (arguments is not null) - methodConvert.PrepareArgumentsForMethod(model, symbol, arguments, CallingConvention.StdCall); - JumpTarget nonZeroTarget = new(); - JumpTarget nonZeroTarget2 = new(); - // a b - methodConvert.AddInstruction(OpCode.SIGN); // a 1 - methodConvert.AddInstruction(OpCode.DUP); // a 1 1 - methodConvert.Push(0); // a 1 1 0 - methodConvert.Jump(OpCode.JMPLT, nonZeroTarget); // a 1 - methodConvert.AddInstruction(OpCode.DROP); - methodConvert.Push(1); // a 1 - nonZeroTarget.Instruction = methodConvert.AddInstruction(OpCode.NOP); // a 1 - methodConvert.AddInstruction(OpCode.SWAP); // 1 a - methodConvert.AddInstruction(OpCode.DUP);// 1 a a - methodConvert.AddInstruction(OpCode.SIGN);// 1 a 0 - methodConvert.AddInstruction(OpCode.DUP);// 1 a 0 0 - methodConvert.Push(0); // 1 a 0 0 0 - methodConvert.Jump(OpCode.JMPLT, nonZeroTarget2); // 1 a 0 - methodConvert.AddInstruction(OpCode.DROP); - methodConvert.Push(1); - nonZeroTarget2.Instruction = methodConvert.AddInstruction(OpCode.NOP); // 1 a 1 - methodConvert.AddInstruction(OpCode.ROT);// a 1 1 - methodConvert.AddInstruction(OpCode.EQUAL);// a 1 1 - JumpTarget endTarget = new(); - methodConvert.Jump(OpCode.JMPIF, endTarget); // a - methodConvert.AddInstruction(OpCode.NEGATE); - endTarget.Instruction = methodConvert.AddInstruction(OpCode.NOP); - - var endTarget2 = new JumpTarget(); + HandleBigIntegerCopySign(methodConvert, model, symbol, instanceExpression, arguments); + JumpTarget noOverflowTarget = new(); methodConvert.AddInstruction(OpCode.DUP); - methodConvert.Push(short.MinValue); - methodConvert.Push(new BigInteger(short.MaxValue) + 1); - methodConvert.AddInstruction(OpCode.WITHIN); - methodConvert.Jump(OpCode.JMPIF, endTarget2); + methodConvert.Push(short.MaxValue); + methodConvert.Jump(OpCode.JMPLE, noOverflowTarget); methodConvert.AddInstruction(OpCode.THROW); - endTarget2.Instruction = methodConvert.AddInstruction(OpCode.NOP); + noOverflowTarget.Instruction = methodConvert.AddInstruction(OpCode.NOP); } // HandleShortCreateChecked diff --git a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_BigInteger.cs b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_BigInteger.cs index e2c7b2845..cda7f855f 100644 --- a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_BigInteger.cs +++ b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_BigInteger.cs @@ -10,12 +10,12 @@ public abstract class Contract_BigInteger(Neo.SmartContract.Testing.SmartContrac { #region Compiled data - public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_BigInteger"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""testPow"",""parameters"":[{""name"":""x"",""type"":""Integer""},{""name"":""y"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":0,""safe"":false},{""name"":""testSqrt"",""parameters"":[{""name"":""x"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":7,""safe"":false},{""name"":""testsbyte"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":13,""safe"":false},{""name"":""testbyte"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":48,""safe"":false},{""name"":""testshort"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":82,""safe"":false},{""name"":""testushort"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":120,""safe"":false},{""name"":""testint"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":156,""safe"":false},{""name"":""testuint"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":200,""safe"":false},{""name"":""testlong"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":240,""safe"":false},{""name"":""testulong"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":296,""safe"":false},{""name"":""testchar"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":344,""safe"":false},{""name"":""testchartostring"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""String"",""offset"":380,""safe"":false},{""name"":""testIsEven"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":400,""safe"":false},{""name"":""testIsZero"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":409,""safe"":false},{""name"":""testIsOne"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":416,""safe"":false},{""name"":""testSign"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":423,""safe"":false},{""name"":""testAdd"",""parameters"":[{""name"":""x"",""type"":""Integer""},{""name"":""y"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":429,""safe"":false},{""name"":""testSubtract"",""parameters"":[{""name"":""x"",""type"":""Integer""},{""name"":""y"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":436,""safe"":false},{""name"":""testNegate"",""parameters"":[{""name"":""x"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":443,""safe"":false},{""name"":""testMultiply"",""parameters"":[{""name"":""x"",""type"":""Integer""},{""name"":""y"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":449,""safe"":false},{""name"":""testDivide"",""parameters"":[{""name"":""x"",""type"":""Integer""},{""name"":""y"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":456,""safe"":false},{""name"":""testRemainder"",""parameters"":[{""name"":""x"",""type"":""Integer""},{""name"":""y"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":463,""safe"":false},{""name"":""testCompare"",""parameters"":[{""name"":""x"",""type"":""Integer""},{""name"":""y"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":470,""safe"":false},{""name"":""testGreatestCommonDivisor"",""parameters"":[{""name"":""x"",""type"":""Integer""},{""name"":""y"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":478,""safe"":false},{""name"":""testEquals"",""parameters"":[{""name"":""x"",""type"":""Integer""},{""name"":""y"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":495,""safe"":false},{""name"":""testModPow"",""parameters"":[],""returntype"":""Integer"",""offset"":502,""safe"":false}],""events"":[]},""permissions"":[],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); + public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_BigInteger"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""testPow"",""parameters"":[{""name"":""x"",""type"":""Integer""},{""name"":""y"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":0,""safe"":false},{""name"":""testSqrt"",""parameters"":[{""name"":""x"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":7,""safe"":false},{""name"":""testsbyte"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":13,""safe"":false},{""name"":""testbyte"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":48,""safe"":false},{""name"":""testshort"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":82,""safe"":false},{""name"":""testushort"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":120,""safe"":false},{""name"":""testint"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":156,""safe"":false},{""name"":""testuint"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":200,""safe"":false},{""name"":""testlong"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":240,""safe"":false},{""name"":""testulong"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":296,""safe"":false},{""name"":""testchar"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":344,""safe"":false},{""name"":""testchartostring"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""String"",""offset"":380,""safe"":false},{""name"":""testIsEven"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":400,""safe"":false},{""name"":""testIsZero"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":408,""safe"":false},{""name"":""testIsOne"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":415,""safe"":false},{""name"":""testSign"",""parameters"":[{""name"":""input"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":422,""safe"":false},{""name"":""testAdd"",""parameters"":[{""name"":""x"",""type"":""Integer""},{""name"":""y"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":428,""safe"":false},{""name"":""testSubtract"",""parameters"":[{""name"":""x"",""type"":""Integer""},{""name"":""y"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":435,""safe"":false},{""name"":""testNegate"",""parameters"":[{""name"":""x"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":442,""safe"":false},{""name"":""testMultiply"",""parameters"":[{""name"":""x"",""type"":""Integer""},{""name"":""y"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":448,""safe"":false},{""name"":""testDivide"",""parameters"":[{""name"":""x"",""type"":""Integer""},{""name"":""y"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":455,""safe"":false},{""name"":""testRemainder"",""parameters"":[{""name"":""x"",""type"":""Integer""},{""name"":""y"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":462,""safe"":false},{""name"":""testCompare"",""parameters"":[{""name"":""x"",""type"":""Integer""},{""name"":""y"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":469,""safe"":false},{""name"":""testGreatestCommonDivisor"",""parameters"":[{""name"":""x"",""type"":""Integer""},{""name"":""y"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":477,""safe"":false},{""name"":""testEquals"",""parameters"":[{""name"":""x"",""type"":""Integer""},{""name"":""y"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":494,""safe"":false},{""name"":""testModPow"",""parameters"":[],""returntype"":""Integer"",""offset"":501,""safe"":false}],""events"":[]},""permissions"":[],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP0FAlcAAnh5o0BXAAF4pEBXAQE7EgB4SgCAAYAAuyQDOnBoPQ9wDAlleGNlcHRpb246QFcBATsRAHhKEAEAAbskAzpwaD0PcAwJZXhjZXB0aW9uOkBXAQE7FQB4SgEAgAIAgAAAuyQDOnBoPQ9wDAlleGNlcHRpb246QFcBATsTAHhKEAIAAAEAuyQDOnBoPQ9wDAlleGNlcHRpb246QFcBATsbAHhKAgAAAIADAAAAgAAAAAC7JAM6cGg9D3AMCWV4Y2VwdGlvbjpAVwEBOxcAeEoQ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AAAQC7JAM6cGg9D3AMCWV4Y2VwdGlvbjpAVwEBeEoQAgAAAQC7JAM6cGjbKEBXAAF4EqKqQFcAAXgQs0BXAAF4EbNAVwABeJlAVwACeHmeQFcAAnh5n0BXAAF4m0BXAAJ4eaBAVwACeHmhQFcAAnh5okBXAAJ4eZ+ZQFcAAnh5SlNQokoQsyb5RZpAVwACeHmzQFcDABpwE3EAHnJoaWqmQFE+Nos=")); #endregion diff --git a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Integer.cs b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Integer.cs index 3883374eb..efaa57daa 100644 --- a/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Integer.cs +++ b/tests/Neo.Compiler.CSharp.UnitTests/TestingArtifacts/Contract_Integer.cs @@ -10,12 +10,12 @@ public abstract class Contract_Integer(Neo.SmartContract.Testing.SmartContractIn { #region Compiled data - public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Integer"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""divRemByte"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":0,""safe"":false},{""name"":""divRemShort"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":27,""safe"":false},{""name"":""divRemInt"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":58,""safe"":false},{""name"":""divRemLong"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":95,""safe"":false},{""name"":""divRemSbyte"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":144,""safe"":false},{""name"":""divRemUshort"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":172,""safe"":false},{""name"":""divRemUint"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":201,""safe"":false},{""name"":""divRemUlong"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":234,""safe"":false},{""name"":""clampByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":275,""safe"":false},{""name"":""clampSByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":290,""safe"":false},{""name"":""clampShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":305,""safe"":false},{""name"":""clampUShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":320,""safe"":false},{""name"":""clampInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":335,""safe"":false},{""name"":""clampUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":350,""safe"":false},{""name"":""clampLong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":365,""safe"":false},{""name"":""clampULong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":380,""safe"":false},{""name"":""clampBigInteger"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":395,""safe"":false},{""name"":""copySignInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""sign"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":410,""safe"":false},{""name"":""copySignSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""sign"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":456,""safe"":false},{""name"":""copySignShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""sign"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":493,""safe"":false},{""name"":""copySignLong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""sign"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":533,""safe"":false},{""name"":""createCheckedInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":591,""safe"":false},{""name"":""createCheckedByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":615,""safe"":false},{""name"":""createCheckedLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":629,""safe"":false},{""name"":""createCheckedUlong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":665,""safe"":false},{""name"":""createCheckedChar"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":693,""safe"":false},{""name"":""createCheckedShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":709,""safe"":false},{""name"":""createCheckedSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":727,""safe"":false},{""name"":""createSaturatingInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":742,""safe"":false},{""name"":""createSaturatingByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":786,""safe"":false},{""name"":""createSaturatingLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":824,""safe"":false},{""name"":""createSaturatingUlong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":876,""safe"":false},{""name"":""createSaturatingChar"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":928,""safe"":false},{""name"":""createSaturatingSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":968,""safe"":false},{""name"":""isEvenIntegerInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1006,""safe"":false},{""name"":""isEventUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1015,""safe"":false},{""name"":""isEvenLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1024,""safe"":false},{""name"":""isEvenUlong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1033,""safe"":false},{""name"":""isEvenShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1042,""safe"":false},{""name"":""isEvenUshort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1051,""safe"":false},{""name"":""isEvenByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1060,""safe"":false},{""name"":""isEvenSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1069,""safe"":false},{""name"":""isOddIntegerInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1078,""safe"":false},{""name"":""isOddUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1087,""safe"":false},{""name"":""isOddLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1096,""safe"":false},{""name"":""isOddUlong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1105,""safe"":false},{""name"":""isOddShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1114,""safe"":false},{""name"":""isOddUshort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1123,""safe"":false},{""name"":""isOddByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1132,""safe"":false},{""name"":""isOddSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1141,""safe"":false},{""name"":""isNegativeInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1150,""safe"":false},{""name"":""isNegativeLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1158,""safe"":false},{""name"":""isNegativeShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1166,""safe"":false},{""name"":""isNegativeSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1174,""safe"":false},{""name"":""isPositiveInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1182,""safe"":false},{""name"":""isPositiveLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1190,""safe"":false},{""name"":""isPositiveShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1198,""safe"":false},{""name"":""isPositiveSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1206,""safe"":false},{""name"":""isPow2Int"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1214,""safe"":false},{""name"":""isPow2UInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1235,""safe"":false},{""name"":""isPow2Long"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1256,""safe"":false},{""name"":""isPow2Ulong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1277,""safe"":false},{""name"":""isPow2Short"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1298,""safe"":false},{""name"":""isPow2Ushort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1319,""safe"":false},{""name"":""isPow2Byte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1340,""safe"":false},{""name"":""isPow2Sbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1361,""safe"":false},{""name"":""leadingZeroCountInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1382,""safe"":false},{""name"":""leadingZeroCountUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1411,""safe"":false},{""name"":""leadingZeroCountLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1433,""safe"":false},{""name"":""leadingZeroCountShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1462,""safe"":false},{""name"":""leadingZeroCountUshort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1490,""safe"":false},{""name"":""leadingZeroCountByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1511,""safe"":false},{""name"":""leadingZeroCountSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1532,""safe"":false},{""name"":""log2Int"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1560,""safe"":false},{""name"":""log2UInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1591,""safe"":false},{""name"":""log2Long"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1622,""safe"":false},{""name"":""log2Short"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1653,""safe"":false},{""name"":""log2Ushort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1684,""safe"":false},{""name"":""log2Byte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1715,""safe"":false},{""name"":""log2Sbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1746,""safe"":false},{""name"":""rotateLeftInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1777,""safe"":false},{""name"":""rotateLeftUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1852,""safe"":false},{""name"":""rotateLeftLong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1915,""safe"":false},{""name"":""rotateLeftULong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2030,""safe"":false},{""name"":""rotateLeftShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2125,""safe"":false},{""name"":""rotateLeftUShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2177,""safe"":false},{""name"":""rotateLeftByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2221,""safe"":false},{""name"":""rotateLeftSByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2257,""safe"":false},{""name"":""rotateRightInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2299,""safe"":false},{""name"":""rotateRightUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2388,""safe"":false},{""name"":""rotateRightLong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2418,""safe"":false},{""name"":""rotateRightULong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2547,""safe"":false},{""name"":""rotateRightShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2585,""safe"":false},{""name"":""rotateRightUShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2647,""safe"":false},{""name"":""rotateRightByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2670,""safe"":false},{""name"":""rotateRightSByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2691,""safe"":false},{""name"":""popCountByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2743,""safe"":false},{""name"":""popCountSByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2769,""safe"":false},{""name"":""popCountShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2795,""safe"":false},{""name"":""popCountUShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2823,""safe"":false},{""name"":""popCountInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2851,""safe"":false},{""name"":""popCountUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2883,""safe"":false},{""name"":""popCountLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2915,""safe"":false},{""name"":""popCountULong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2955,""safe"":false},{""name"":""popCountBigInteger"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2995,""safe"":false}],""events"":[]},""permissions"":[],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); + public static Neo.SmartContract.Manifest.ContractManifest Manifest => Neo.SmartContract.Manifest.ContractManifest.Parse(@"{""name"":""Contract_Integer"",""groups"":[],""features"":{},""supportedstandards"":[],""abi"":{""methods"":[{""name"":""divRemByte"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":0,""safe"":false},{""name"":""divRemShort"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":27,""safe"":false},{""name"":""divRemInt"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":58,""safe"":false},{""name"":""divRemLong"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":95,""safe"":false},{""name"":""divRemSbyte"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":144,""safe"":false},{""name"":""divRemUshort"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":172,""safe"":false},{""name"":""divRemUint"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":201,""safe"":false},{""name"":""divRemUlong"",""parameters"":[{""name"":""left"",""type"":""Integer""},{""name"":""right"",""type"":""Integer""}],""returntype"":""Array"",""offset"":234,""safe"":false},{""name"":""clampByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":275,""safe"":false},{""name"":""clampSByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":290,""safe"":false},{""name"":""clampShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":305,""safe"":false},{""name"":""clampUShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":320,""safe"":false},{""name"":""clampInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":335,""safe"":false},{""name"":""clampUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":350,""safe"":false},{""name"":""clampLong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":365,""safe"":false},{""name"":""clampULong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":380,""safe"":false},{""name"":""clampBigInteger"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""min"",""type"":""Integer""},{""name"":""max"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":395,""safe"":false},{""name"":""copySignInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""sign"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":410,""safe"":false},{""name"":""copySignSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""sign"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":433,""safe"":false},{""name"":""copySignShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""sign"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":453,""safe"":false},{""name"":""copySignLong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""sign"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":474,""safe"":false},{""name"":""createCheckedInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":501,""safe"":false},{""name"":""createCheckedByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":525,""safe"":false},{""name"":""createCheckedLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":539,""safe"":false},{""name"":""createCheckedUlong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":575,""safe"":false},{""name"":""createCheckedChar"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":603,""safe"":false},{""name"":""createCheckedShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":619,""safe"":false},{""name"":""createCheckedSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":637,""safe"":false},{""name"":""createSaturatingInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":652,""safe"":false},{""name"":""createSaturatingByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":696,""safe"":false},{""name"":""createSaturatingLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":734,""safe"":false},{""name"":""createSaturatingUlong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":786,""safe"":false},{""name"":""createSaturatingChar"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":838,""safe"":false},{""name"":""createSaturatingSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":878,""safe"":false},{""name"":""isEvenIntegerInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":916,""safe"":false},{""name"":""isEventUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":924,""safe"":false},{""name"":""isEvenLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":932,""safe"":false},{""name"":""isEvenUlong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":940,""safe"":false},{""name"":""isEvenShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":948,""safe"":false},{""name"":""isEvenUshort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":956,""safe"":false},{""name"":""isEvenByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":964,""safe"":false},{""name"":""isEvenSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":972,""safe"":false},{""name"":""isOddIntegerInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":980,""safe"":false},{""name"":""isOddUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":988,""safe"":false},{""name"":""isOddLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":996,""safe"":false},{""name"":""isOddUlong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1004,""safe"":false},{""name"":""isOddShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1012,""safe"":false},{""name"":""isOddUshort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1020,""safe"":false},{""name"":""isOddByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1028,""safe"":false},{""name"":""isOddSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1036,""safe"":false},{""name"":""isNegativeInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1044,""safe"":false},{""name"":""isNegativeLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1051,""safe"":false},{""name"":""isNegativeShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1058,""safe"":false},{""name"":""isNegativeSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1065,""safe"":false},{""name"":""isPositiveInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1072,""safe"":false},{""name"":""isPositiveLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1079,""safe"":false},{""name"":""isPositiveShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1086,""safe"":false},{""name"":""isPositiveSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1093,""safe"":false},{""name"":""isPow2Int"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1100,""safe"":false},{""name"":""isPow2UInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1121,""safe"":false},{""name"":""isPow2Long"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1142,""safe"":false},{""name"":""isPow2Ulong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1163,""safe"":false},{""name"":""isPow2Short"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1184,""safe"":false},{""name"":""isPow2Ushort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1205,""safe"":false},{""name"":""isPow2Byte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1226,""safe"":false},{""name"":""isPow2Sbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Boolean"",""offset"":1247,""safe"":false},{""name"":""leadingZeroCountInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1268,""safe"":false},{""name"":""leadingZeroCountUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1297,""safe"":false},{""name"":""leadingZeroCountLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1319,""safe"":false},{""name"":""leadingZeroCountShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1348,""safe"":false},{""name"":""leadingZeroCountUshort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1376,""safe"":false},{""name"":""leadingZeroCountByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1397,""safe"":false},{""name"":""leadingZeroCountSbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1418,""safe"":false},{""name"":""log2Int"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1446,""safe"":false},{""name"":""log2UInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1470,""safe"":false},{""name"":""log2Long"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1494,""safe"":false},{""name"":""log2Short"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1518,""safe"":false},{""name"":""log2Ushort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1542,""safe"":false},{""name"":""log2Byte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1566,""safe"":false},{""name"":""log2Sbyte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1590,""safe"":false},{""name"":""rotateLeftInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1614,""safe"":false},{""name"":""rotateLeftUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1689,""safe"":false},{""name"":""rotateLeftLong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1752,""safe"":false},{""name"":""rotateLeftULong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1867,""safe"":false},{""name"":""rotateLeftShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":1962,""safe"":false},{""name"":""rotateLeftUShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2014,""safe"":false},{""name"":""rotateLeftByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2058,""safe"":false},{""name"":""rotateLeftSByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2094,""safe"":false},{""name"":""rotateRightInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2136,""safe"":false},{""name"":""rotateRightUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2225,""safe"":false},{""name"":""rotateRightLong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2255,""safe"":false},{""name"":""rotateRightULong"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2384,""safe"":false},{""name"":""rotateRightShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2422,""safe"":false},{""name"":""rotateRightUShort"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2484,""safe"":false},{""name"":""rotateRightByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2507,""safe"":false},{""name"":""rotateRightSByte"",""parameters"":[{""name"":""value"",""type"":""Integer""},{""name"":""offset"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2528,""safe"":false},{""name"":""popCountByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2580,""safe"":false},{""name"":""popCountSByte"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2606,""safe"":false},{""name"":""popCountShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2632,""safe"":false},{""name"":""popCountUShort"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2660,""safe"":false},{""name"":""popCountInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2688,""safe"":false},{""name"":""popCountUInt"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2720,""safe"":false},{""name"":""popCountLong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2752,""safe"":false},{""name"":""popCountULong"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2792,""safe"":false},{""name"":""popCountBigInteger"",""parameters"":[{""name"":""value"",""type"":""Integer""}],""returntype"":""Integer"",""offset"":2832,""safe"":false}],""events"":[]},""permissions"":[],""trusts"":[],""extra"":{""nef"":{""optimization"":""All""}}}"); /// /// Optimization: "All" /// - public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP0sDFcAAnl4SlFOoUpRoFFQn0oQAQABuyQDOhLAQFcAAnl4SlFOoUpRoFFQn0oBAIACAIAAALskAzoSwEBXAAJ5eEpRTqFKUaBRUJ9KAgAAAIADAAAAgAAAAAC7JAM6EsBAVwACeXhKUU6hSlGgUVCfSgMAAAAAAAAAgAQAAAAAAAAAgAAAAAAAAAAAuyQDOhLAQFcAAnl4SlFOoUpRoFFQn0oAgAGAALskAzoSw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JF5ACBQnwAfkamSSgMAAACAAAAAADAMAwAAAAABAAAAn0BXAAJ4eQAfkVAD/////wAAAACRUKgD/////wAAAACReAP/////AAAAAJF5ACBQnwAfkamSA/////8AAAAAkUBXAAJ4eQA/kVAE//////////8AAAAAAAAAAJFQqAT//////////wAAAAAAAAAAkXgE//////////8AAAAAAAAAAJF5AEBQnwA/kamSSgQAAAAAAAAAgAAAAAAAAAAAMBQEAAAAAAAAAAABAAAAAAAAAJ9AVwACeHkAP5FQBP//////////AAAAAAAAAACRUKgE//////////8AAAAAAAAAAJF4BP//////////AAAAAAAAAACReQBAUJ8AP5GpkgT//////////wAAAAAAAAAAkUBXAAJ4eR+RUAL//wAAkVCoAv//AACReAL//wAAkXkgUJ8fkamSSgIAgAAAMAgCAAABAJ9AVwACeHkfkVAC//8AAJFQqAL//wAAkXgC//8AAJF5IFCfH5GpkgL//wAAkUBXAAJ4eReRUAH/AJFQqAH/AJF4Af8AkXkYUJ8XkamSAf8AkUBXAAJ4eReRUAH/AJFQqAH/AJF4Af8AkXkYUJ8XkamSSgGAADAGAQABn0BXAAJ4eQAfkQAgogAgUJ9QA/////8AAAAAkVCoA/////8AAAAAkXgD/////wAAAACReQAgogAgUJ8AIFCfAB+RqZJKAwAAAIAAAAAAMAwDAAAAAAEAAACfQFcAAnh5AB+RqXgAIHmfAB+RqJID/////wAAAACRQFcAAnh5AD+RAECiAEBQn1AE//////////8AAAAAAAAAAJFQqAT//////////wAAAAAAAAAAkXgE//////////8AAAAAAAAAAJF5AECiAEBQnwBAUJ8AP5GpkkoEAAAAAAAAAIAAAAAAAAAAADAUBAAAAAAAAAAAAQAAAAAAAACfQFcAAnh5AD+RqXgAQHmfAD+RqJIE//////////8AAAAAAAAAAJFAVwACeHkfkSCiIFCfUAL//wAAkVCoAv//AACReAL//wAAkXkgoiBQnyBQnx+RqZJKAgCAAAAwCAIAAAEAn0BXAAJ4eR+RqXggeZ8fkaiSAv//AACRQFcAAnh5F5GpeBh5nxeRqJIB/wCRQFcAAnh5F5EYohhQn1AB/wCRUKgB/wCReAH/AJF5GKIYUJ8YUJ8XkamSSgGAADAGAQABn0BXAAF4Af8AkRBQShAoDEoRkVGeUBGpIvRFQFcAAXgB/wCREFBKECgMShGRUZ5QEaki9EVAVwABeAL//wAAkRBQShAoDEoRkVGeUBGpIvRFQFcAAXgC//8AAJEQUEoQKAxKEZFRnlARqSL0RUBXAAF4A/////8AAAAAkRBQShAoDEoRkVGeUBGpIvRFQFcAAXgD/////wAAAACREFBKECgMShGRUZ5QEaki9EVAVwABeAT//////////wAAAAAAAAAAkRBQShAoDEoRkVGeUBGpIvRFQFcAAXgE//////////8AAAAAAAAAAJEQUEoQKAxKEZFRnlARqSL0RUBXAAF4SgIAAACAAwAAAIAAAAAAuyYOA/////8AAAAAkSJHDEJWYWx1ZSBvdXQgb2YgcmFuZ2UsIG11c3QgYmUgYmV0d2VlbiBpbnQuTWluVmFsdWUgYW5kIGludC5NYXhWYWx1ZS46EFBKECgMShGRUZ5QEaki9EVAN7f03A==")); + public static Neo.SmartContract.NefFile Nef => Neo.IO.Helper.AsSerializable(Convert.FromBase64String(@"TkVGM1Rlc3RpbmdFbmdpbmUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP2JC1cAAnl4SlFOoUpRoFFQn0oQAQABuyQDOhLAQFcAAnl4SlFOoUpRoFFQn0oBAIACAIAAALskAzoSwEBXAAJ5eEpRTqFKUaBRUJ9KAgAAAIADAAAAgAAAAAC7JAM6EsBAVwACeXhKUU6hSlGgUVCfSgMAAAAAAAAAgAQAAAAAAAAAgAAAAAAAAAAAuyQDOhLAQFcAAnl4SlFOoUpRoFFQn0oAgAGAALskAzoSwEBXAAJ5eEpRTqFKUaBRUJ9KEAIAAAEAuyQDOhLAQFcAAnl4SlFOoUpRoFFQn0oQAwAAAAABAAAAuyQDOhLAQFcAAnl4SlFOoUpRoFFQn0oQBAAAAAAAA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AAJF5AEBQnwA/kamSBP//////////AAAAAAAAAACRQFcAAnh5H5FQAv//AACRUKgC//8AAJF4Av//AACReSBQnx+RqZJKAgCAAAAwCAIAAAEAn0BXAAJ4eR+RUAL//wAAkVCoAv//AACReAL//wAAkXkgUJ8fkamSAv//AACRQFcAAnh5F5FQAf8AkVCoAf8AkXgB/wCReRhQnxeRqZIB/wCRQFcAAnh5F5FQAf8AkVCoAf8AkXgB/wCReRhQnxeRqZJKAYAAMAYBAAGfQFcAAnh5AB+RACCiACBQn1AD/////wAAAACRUKgD/////wAAAACReAP/////AAAAAJF5ACCiACBQnwAgUJ8AH5GpkkoDAAAAgAAAAAAwDAMAAAAAAQAAAJ9AVwACeHkAH5GpeAAgeZ8AH5GokgP/////AAAAAJFAVwACeHkAP5EAQKIAQFCfUAT//////////wAAAAAAAAAAkVCoBP//////////AAAAAAAAAACReAT//////////wAAAAAAAAAAkXkAQKIAQFCfAEBQnwA/kamSSgQAAAAAAAAAgAAAAAAAAAAAMBQEAAAAAAAAAAABAAAAAAAAAJ9AVwACeHkAP5GpeABAeZ8AP5GokgT//////////wAAAAAAAAAAkUBXAAJ4eR+RIKIgUJ9QAv//AACRUKgC//8AAJF4Av//AACReSCiIFCfIFCfH5GpkkoCAIAAADAIAgAAAQCfQFcAAnh5H5GpeCB5nx+RqJIC//8AAJFAVwACeHkXkal4GHmfF5GokgH/AJFAVwACeHkXkRiiGFCfUAH/AJFQqAH/AJF4Af8AkXkYohhQnxhQnxeRqZJKAYAAMAYBAAGfQFcAAXgB/wCREFBKECgMShGRUZ5QEaki9EVAVwABeAH/AJEQUEoQKAxKEZFRnlARqSL0RUBXAAF4Av//AACREFBKECgMShGRUZ5QEaki9EVAVwABeAL//wAAkRBQShAoDEoRkVGeUBGpIvRFQFcAAXgD/////wAAAACREFBKECgMShGRUZ5QEaki9EVAVwABeAP/////AAAAAJEQUEoQKAxKEZFRnlARqSL0RUBXAAF4BP//////////AAAAAAAAAACREFBKECgMShGRUZ5QEaki9EVAVwABeAT//////////wAAAAAAAAAAkRBQShAoDEoRkVGeUBGpIvRFQFcAAXhKAgAAAIADAAAAgAAAAAC7Jg4D/////wAAAACRIkcMQlZhbHVlIG91dCBvZiByYW5nZSwgbXVzdCBiZSBiZXR3ZWVuIGludC5NaW5WYWx1ZSBhbmQgaW50Lk1heFZhbHVlLjoQUEoQKAxKEZFRnlARqSL0RUAduQXF")); #endregion diff --git a/tests/Neo.Compiler.CSharp.UnitTests/UnitTest_BigInteger.cs b/tests/Neo.Compiler.CSharp.UnitTests/UnitTest_BigInteger.cs index 46d7f5799..bd852768f 100644 --- a/tests/Neo.Compiler.CSharp.UnitTests/UnitTest_BigInteger.cs +++ b/tests/Neo.Compiler.CSharp.UnitTests/UnitTest_BigInteger.cs @@ -143,25 +143,11 @@ public void Test_char() [TestMethod] public void Test_IsEven() { - // Test 0 - Assert.AreEqual(new BigInteger(0).IsEven, Contract.TestIsEven(0)); - AssertGasConsumed(1047570); - - // Test 1 - Assert.AreEqual(new BigInteger(1).IsEven, Contract.TestIsEven(1)); - AssertGasConsumed(1047570); - - // Test 2 - Assert.AreEqual(new BigInteger(2).IsEven, Contract.TestIsEven(2)); - AssertGasConsumed(1047570); - - // Test -1 - Assert.AreEqual(new BigInteger(-1).IsEven, Contract.TestIsEven(-1)); - AssertGasConsumed(1047570); - - // Test -2 - Assert.AreEqual(new BigInteger(-2).IsEven, Contract.TestIsEven(-2)); - AssertGasConsumed(1047570); + for (int i = -2; i <= 2; ++i) + { + Assert.AreEqual(new BigInteger(i).IsEven, Contract.TestIsEven(i)); + AssertGasConsumed(1047420); + } } [TestMethod] diff --git a/tests/Neo.Compiler.CSharp.UnitTests/UnitTest_Integer.cs b/tests/Neo.Compiler.CSharp.UnitTests/UnitTest_Integer.cs index 32bf5fd41..576fa60be 100644 --- a/tests/Neo.Compiler.CSharp.UnitTests/UnitTest_Integer.cs +++ b/tests/Neo.Compiler.CSharp.UnitTests/UnitTest_Integer.cs @@ -417,40 +417,40 @@ public void TestMethodIntCopySign() { // Test with notmal and edge cases Assert.AreEqual(int.CopySign(5, 1), Contract.CopySignInt(5, 1)); - AssertGasConsumed(1049460); + AssertGasConsumed(1047540); Assert.AreEqual(int.CopySign(5, -1), Contract.CopySignInt(5, -1)); - AssertGasConsumed(1049490); + AssertGasConsumed(1047600); Assert.AreEqual(int.CopySign(-5, 1), Contract.CopySignInt(-5, 1)); - AssertGasConsumed(1049490); + AssertGasConsumed(1047540); Assert.AreEqual(int.CopySign(-5, -1), Contract.CopySignInt(-5, -1)); - AssertGasConsumed(1049280); + AssertGasConsumed(1047600); // Test with max values Assert.AreEqual(int.CopySign(int.MaxValue, 1), Contract.CopySignInt(int.MaxValue, 1)); - AssertGasConsumed(1049460); + AssertGasConsumed(1047540); Assert.AreEqual(int.CopySign(int.MaxValue, -1), Contract.CopySignInt(int.MaxValue, -1)); - AssertGasConsumed(1049490); + AssertGasConsumed(1047600); Assert.ThrowsException(() => Contract.CopySignInt(int.MinValue, 1)); - AssertGasConsumed(1064850); + AssertGasConsumed(1062900); Assert.AreEqual(int.CopySign(int.MinValue, -1), Contract.CopySignInt(int.MinValue, -1)); - AssertGasConsumed(1049280); + AssertGasConsumed(1047600); // Test with min values Assert.AreEqual(int.MaxValue, Contract.CopySignInt(int.MaxValue, 1)); - AssertGasConsumed(1049460); + AssertGasConsumed(1047540); Assert.AreEqual(-int.MaxValue, Contract.CopySignInt(int.MaxValue, -1)); - AssertGasConsumed(1049490); + AssertGasConsumed(1047600); Assert.ThrowsException(() => Contract.CopySignInt(int.MinValue, 1)); - AssertGasConsumed(1064850); + AssertGasConsumed(1062900); Assert.AreEqual(int.MinValue, Contract.CopySignInt(int.MinValue, -1)); - AssertGasConsumed(1049280); + AssertGasConsumed(1047600); // Test with zero Assert.AreEqual(0, Contract.CopySignInt(0, 1)); - AssertGasConsumed(1049460); + AssertGasConsumed(1047540); Assert.AreEqual(0, Contract.CopySignInt(0, -1)); - AssertGasConsumed(1049490); + AssertGasConsumed(1047600); } [TestMethod] @@ -458,29 +458,29 @@ public void TestMethodSByteCopySign() { // Test with normal and edge cases Assert.AreEqual(sbyte.CopySign(5, 1), Contract.CopySignSbyte(5, 1)); - AssertGasConsumed(1049460); + AssertGasConsumed(1047540); Assert.AreEqual(sbyte.CopySign(5, 0), Contract.CopySignSbyte(5U, 0)); - AssertGasConsumed(1049460); + AssertGasConsumed(1047540); // Test with max values Assert.AreEqual(sbyte.CopySign(sbyte.MaxValue, 1), Contract.CopySignSbyte(sbyte.MaxValue, 1)); - AssertGasConsumed(1049460); + AssertGasConsumed(1047540); Assert.AreEqual(sbyte.CopySign(sbyte.MaxValue, 0), Contract.CopySignSbyte(sbyte.MaxValue, 0)); - AssertGasConsumed(1049460); + AssertGasConsumed(1047540); Assert.ThrowsException(() => Contract.CopySignSbyte(sbyte.MinValue, 0)); - AssertGasConsumed(1064850); + AssertGasConsumed(1062900); Assert.AreEqual(sbyte.CopySign(sbyte.MaxValue, 0), Contract.CopySignSbyte(sbyte.MaxValue, 0)); - AssertGasConsumed(1049460); + AssertGasConsumed(1047540); // Test with zero Assert.AreEqual(0U, Contract.CopySignSbyte(0U, 1)); - AssertGasConsumed(1049460); + AssertGasConsumed(1047540); Assert.AreEqual(0U, Contract.CopySignSbyte(0U, 0)); - AssertGasConsumed(1049460); + AssertGasConsumed(1047540); // Test with negative values Assert.AreEqual(sbyte.CopySign(5, -1), Contract.CopySignSbyte(5U, -1)); - AssertGasConsumed(1049490); + AssertGasConsumed(1047600); } [TestMethod] @@ -488,23 +488,23 @@ public void TestMethodShortCopySign() { // Test with notmal and edge cases Assert.AreEqual(short.CopySign(5, 1), Contract.CopySignShort(5, 1)); - AssertGasConsumed(1049460); + AssertGasConsumed(1047540); Assert.AreEqual(short.CopySign(5, -1), Contract.CopySignShort(5, -1)); - AssertGasConsumed(1049490); + AssertGasConsumed(1047600); Assert.AreEqual(short.CopySign(-5, 1), Contract.CopySignShort(-5, 1)); - AssertGasConsumed(1049490); + AssertGasConsumed(1047540); Assert.AreEqual(short.CopySign(-5, -1), Contract.CopySignShort(-5, -1)); - AssertGasConsumed(1049280); + AssertGasConsumed(1047600); // Test with max values Assert.AreEqual(short.CopySign(short.MaxValue, 1), Contract.CopySignShort(short.MaxValue, 1)); - AssertGasConsumed(1049460); + AssertGasConsumed(1047540); Assert.AreEqual(short.CopySign(short.MaxValue, -1), Contract.CopySignShort(short.MaxValue, -1)); - AssertGasConsumed(1049490); + AssertGasConsumed(1047600); Assert.ThrowsException(() => Contract.CopySignShort(short.MinValue, 1)); - AssertGasConsumed(1064850); + AssertGasConsumed(1062900); Assert.AreEqual(short.CopySign(short.MinValue, -1), Contract.CopySignShort(short.MinValue, -1)); - AssertGasConsumed(1049280); + AssertGasConsumed(1047600); } [TestMethod] @@ -566,65 +566,58 @@ public void TestMethodIntCreateSaturating() [TestMethod] public void TestMethodIntIsEvenInteger() { - Assert.AreEqual(int.IsEvenInteger(0), Contract.IsEvenIntegerInt(0)); - AssertGasConsumed(1047570); - Assert.AreEqual(int.IsEvenInteger(1), Contract.IsEvenIntegerInt(1)); - AssertGasConsumed(1047570); - Assert.AreEqual(int.IsEvenInteger(2), Contract.IsEvenIntegerInt(2)); - AssertGasConsumed(1047570); - Assert.AreEqual(int.IsEvenInteger(3), Contract.IsEvenIntegerInt(3)); - AssertGasConsumed(1047570); - Assert.AreEqual(int.IsEvenInteger(4), Contract.IsEvenIntegerInt(4)); - AssertGasConsumed(1047570); - Assert.AreEqual(int.IsEvenInteger(5), Contract.IsEvenIntegerInt(5)); - AssertGasConsumed(1047570); + for (int i = 0; i < 6; ++i) + { + Assert.AreEqual(int.IsEvenInteger(i), Contract.IsEvenIntegerInt(i)); + AssertGasConsumed(1047420); + } } [TestMethod] public void TestIsOddIntegerInt() { Assert.AreEqual(false, Contract.IsOddIntegerInt(0)); - AssertGasConsumed(1047570); + AssertGasConsumed(1047420); Assert.AreEqual(true, Contract.IsOddIntegerInt(1)); - AssertGasConsumed(1047570); + AssertGasConsumed(1047420); Assert.AreEqual(false, Contract.IsOddIntegerInt(2)); - AssertGasConsumed(1047570); + AssertGasConsumed(1047420); Assert.AreEqual(true, Contract.IsOddIntegerInt(3)); - AssertGasConsumed(1047570); + AssertGasConsumed(1047420); Assert.AreEqual(false, Contract.IsOddIntegerInt(4)); - AssertGasConsumed(1047570); + AssertGasConsumed(1047420); Assert.AreEqual(true, Contract.IsOddIntegerInt(5)); - AssertGasConsumed(1047570); + AssertGasConsumed(1047420); } [TestMethod] public void TestIsNegativeInt() { Assert.AreEqual(int.IsNegative(0), Contract.IsNegativeInt(0)); - AssertGasConsumed(1047420); + AssertGasConsumed(1047300); Assert.AreEqual(int.IsNegative(1), Contract.IsNegativeInt(1)); - AssertGasConsumed(1047420); + AssertGasConsumed(1047300); Assert.AreEqual(int.IsNegative(-1), Contract.IsNegativeInt(-1)); - AssertGasConsumed(1047420); + AssertGasConsumed(1047300); Assert.AreEqual(int.IsNegative(int.MaxValue), Contract.IsNegativeInt(int.MaxValue)); - AssertGasConsumed(1047420); + AssertGasConsumed(1047300); Assert.AreEqual(int.IsNegative(int.MinValue), Contract.IsNegativeInt(int.MinValue)); - AssertGasConsumed(1047420); + AssertGasConsumed(1047300); } [TestMethod] public void TestIsPositiveInt() { Assert.AreEqual(int.IsPositive(0), Contract.IsPositiveInt(0)); - AssertGasConsumed(1047420); + AssertGasConsumed(1047300); Assert.AreEqual(int.IsPositive(1), Contract.IsPositiveInt(1)); - AssertGasConsumed(1047420); + AssertGasConsumed(1047300); Assert.AreEqual(int.IsPositive(-1), Contract.IsPositiveInt(-1)); - AssertGasConsumed(1047420); + AssertGasConsumed(1047300); Assert.AreEqual(int.IsPositive(int.MaxValue), Contract.IsPositiveInt(int.MaxValue)); - AssertGasConsumed(1047420); + AssertGasConsumed(1047300); Assert.AreEqual(int.IsPositive(int.MinValue), Contract.IsPositiveInt(int.MinValue)); - AssertGasConsumed(1047420); + AssertGasConsumed(1047300); } [TestMethod] @@ -646,25 +639,25 @@ public void TestIsPow2Int() public void TestMethodsInt() { Assert.AreEqual(int.CopySign(5, -1), Contract.CopySignInt(5, -1)); - AssertGasConsumed(1049490); + AssertGasConsumed(1047600); Assert.AreEqual(int.CreateChecked(5), Contract.CreateCheckedInt(5)); AssertGasConsumed(1047450); Assert.AreEqual(int.CreateSaturating(5), Contract.CreateSaturatingInt(5)); AssertGasConsumed(1048170); Assert.AreEqual(int.IsEvenInteger(5), Contract.IsEvenIntegerInt(5)); - AssertGasConsumed(1047570); + AssertGasConsumed(1047420); Assert.AreEqual(int.IsOddInteger(5), Contract.IsOddIntegerInt(5)); - AssertGasConsumed(1047570); - Assert.AreEqual(int.IsNegative(5), Contract.IsNegativeInt(5)); AssertGasConsumed(1047420); + Assert.AreEqual(int.IsNegative(5), Contract.IsNegativeInt(5)); + AssertGasConsumed(1047300); Assert.AreEqual(int.IsPositive(5), Contract.IsPositiveInt(5)); - AssertGasConsumed(1047420); + AssertGasConsumed(1047300); Assert.AreEqual(int.IsPow2(5), Contract.IsPow2Int(5)); AssertGasConsumed(1047720); Assert.AreEqual(int.LeadingZeroCount(5), Contract.LeadingZeroCountInt(5)); AssertGasConsumed(1049970); Assert.AreEqual(int.Log2(5), Contract.Log2Int(5)); - AssertGasConsumed(1049790); + AssertGasConsumed(1049250); } [TestMethod]