ucmpdi2.c 537 B

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