umodti3.c 717 B

12345678910111213141516171819202122232425
  1. //===-- umodti3.c - Implement __umodti3 -----------------------------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // This file implements __umodti3 for the compiler_rt library.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. #include "int_lib.h"
  13. #ifdef CRT_HAS_128BIT
  14. // Returns: a % b
  15. COMPILER_RT_ABI tu_int __umodti3(tu_int a, tu_int b) {
  16. tu_int r;
  17. __udivmodti4(a, b, &r);
  18. return r;
  19. }
  20. #endif // CRT_HAS_128BIT