IntConstMath.h 1.2 KB

1234567891011121314151617181920212223
  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. class IntConstMath
  7. {
  8. public:
  9. static bool Add(IntConstType left, IntConstType right, IRType type, IntConstType * result);
  10. static bool Sub(IntConstType left, IntConstType right, IRType type, IntConstType * result);
  11. static bool Mul(IntConstType left, IntConstType right, IRType type, IntConstType * result);
  12. static bool Div(IntConstType left, IntConstType right, IRType type, IntConstType * result);
  13. static bool Mod(IntConstType left, IntConstType right, IRType type, IntConstType * result);
  14. static bool Dec(IntConstType val, IRType type, IntConstType * result);
  15. static bool Inc(IntConstType val, IRType type, IntConstType * result);
  16. static bool Neg(IntConstType val, IRType type, IntConstType * result);
  17. private:
  18. static bool IsValid(IntConstType val, IRType type);
  19. };