cmpdi2.c 435 B

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