cmpdi2.c 471 B

12345678910111213141516171819202122232425262728
  1. // SPDX-License-Identifier: GPL-2.0
  2. #include <linux/module.h>
  3. #include "libgcc.h"
  4. word_type __cmpdi2(long long a, long long b)
  5. {
  6. const DWunion au = {
  7. .ll = a
  8. };
  9. const DWunion bu = {
  10. .ll = b
  11. };
  12. if (au.s.high < bu.s.high)
  13. return 0;
  14. else if (au.s.high > bu.s.high)
  15. return 2;
  16. if ((unsigned int) au.s.low < (unsigned int) bu.s.low)
  17. return 0;
  18. else if ((unsigned int) au.s.low > (unsigned int) bu.s.low)
  19. return 2;
  20. return 1;
  21. }
  22. EXPORT_SYMBOL(__cmpdi2);