mirror of
https://github.com/VSadov/Satori.git
synced 2025-06-11 18:20:26 +09:00

* Faster unsigned division by constants * Fix Arm build and add some tests. * Improve register allocation * Fix ARM64 codegen * Fix MULHI flags * Remove ARM32 codegen * Widen 32bit UDIV to 64bit MULHI when possible. Improve register allocation. * Always widen 32bit UDIV to 64bit MUL/MULHI * Cleanup * Final optimization * Fix typo
96 lines
3.5 KiB
C#
96 lines
3.5 KiB
C#
// Licensed to the .NET Foundation under one or more agreements.
|
|
// The .NET Foundation licenses this file to you under the MIT license.
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
namespace System.MathBenchmarks
|
|
{
|
|
public partial class MathTests
|
|
{
|
|
public static int Main(string[] args)
|
|
{
|
|
var result = 100;
|
|
|
|
var doubleTests = new Double();
|
|
result += Test(doubleTests.Abs);
|
|
result += Test(doubleTests.Acos);
|
|
result += Test(doubleTests.Acosh);
|
|
result += Test(doubleTests.Asin);
|
|
result += Test(doubleTests.Asinh);
|
|
result += Test(doubleTests.Atan);
|
|
result += Test(doubleTests.Atanh);
|
|
result += Test(doubleTests.Atan2);
|
|
result += Test(doubleTests.Cbrt);
|
|
result += Test(doubleTests.Ceiling);
|
|
result += Test(doubleTests.CopySign);
|
|
result += Test(doubleTests.Cos);
|
|
result += Test(doubleTests.Cosh);
|
|
result += Test(doubleTests.Exp);
|
|
result += Test(doubleTests.Floor);
|
|
result += Test(doubleTests.FusedMultiplyAdd);
|
|
result += Test(doubleTests.ILogB);
|
|
result += Test(doubleTests.Log);
|
|
result += Test(doubleTests.Log2);
|
|
result += Test(doubleTests.Log10);
|
|
result += Test(doubleTests.Max);
|
|
result += Test(doubleTests.Min);
|
|
result += Test(doubleTests.Pow);
|
|
result += Test(doubleTests.Round);
|
|
result += Test(doubleTests.ScaleB);
|
|
result += Test(doubleTests.Sin);
|
|
result += Test(doubleTests.Sinh);
|
|
result += Test(doubleTests.Sqrt);
|
|
result += Test(doubleTests.Tan);
|
|
result += Test(doubleTests.Tanh);
|
|
|
|
var singleTests = new Single();
|
|
result += Test(singleTests.Abs);
|
|
result += Test(singleTests.Acos);
|
|
result += Test(singleTests.Acosh);
|
|
result += Test(singleTests.Asin);
|
|
result += Test(singleTests.Asinh);
|
|
result += Test(singleTests.Atan);
|
|
result += Test(singleTests.Atanh);
|
|
result += Test(singleTests.Atan2);
|
|
result += Test(singleTests.Cbrt);
|
|
result += Test(singleTests.Ceiling);
|
|
result += Test(singleTests.CopySign);
|
|
result += Test(singleTests.Cos);
|
|
result += Test(singleTests.Cosh);
|
|
result += Test(singleTests.Exp);
|
|
result += Test(singleTests.Floor);
|
|
result += Test(singleTests.FusedMultiplyAdd);
|
|
result += Test(singleTests.ILogB);
|
|
result += Test(singleTests.Log);
|
|
result += Test(singleTests.Log2);
|
|
result += Test(singleTests.Log10);
|
|
result += Test(singleTests.Max);
|
|
result += Test(singleTests.Min);
|
|
result += Test(singleTests.Pow);
|
|
result += Test(singleTests.Round);
|
|
result += Test(singleTests.ScaleB);
|
|
result += Test(singleTests.Sin);
|
|
result += Test(singleTests.Sinh);
|
|
result += Test(singleTests.Sqrt);
|
|
result += Test(singleTests.Tan);
|
|
result += Test(singleTests.Tanh);
|
|
|
|
result += Test(DivideByConst.Test);
|
|
|
|
return result;
|
|
}
|
|
|
|
private static int Test(Action action)
|
|
{
|
|
try
|
|
{
|
|
action();
|
|
}
|
|
catch
|
|
{
|
|
return -1;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
}
|
|
}
|