AsmJsMath.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft Corporation and contributors. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. #pragma once
  6. namespace Js
  7. {
  8. class AsmJsMath
  9. {
  10. public:
  11. template<typename T> static T Add( T aLeft, T aRight );
  12. template<typename T> static T Sub( T aLeft, T aRight );
  13. template<typename T> static T Mul( T aLeft, T aRight );
  14. template<typename T> static T Div( T aLeft, T aRight );
  15. template<typename T> static T Rem( T aLeft, T aRight );
  16. template<typename T> static T Min( T aLeft, T aRight );
  17. template<typename T> static T Max( T aLeft, T aRight );
  18. template<typename T> static T Abs( T aLeft );
  19. template<typename T = int> static T And( T aLeft, T aRight );
  20. template<typename T = int> static T Or( T aLeft, T aRight );
  21. template<typename T = int> static T Xor( T aLeft, T aRight );
  22. template<typename T = int> static T Shl( T aLeft, T aRight );
  23. template<typename T = int> static T Shr( T aLeft, T aRight );
  24. template<typename T = int> static T ShrU( T aLeft, T aRight );
  25. template<typename T> static T Neg( T aLeft);
  26. static int Not( int aLeft);
  27. static int LogNot( int aLeft);
  28. static int ToBool( int aLeft );
  29. static int Clz32( int value);
  30. template<typename T> static int CmpLt( T aLeft, T aRight );
  31. template<typename T> static int CmpLe( T aLeft, T aRight );
  32. template<typename T> static int CmpGt( T aLeft, T aRight );
  33. template<typename T> static int CmpGe( T aLeft, T aRight );
  34. template<typename T> static int CmpEq( T aLeft, T aRight );
  35. template<typename T> static int CmpNe( T aLeft, T aRight );
  36. };
  37. }
  38. #include "AsmJsMath.inl"