cmpdi2.S 602 B

123456789101112131415161718192021222324252627282930313233
  1. ! Copyright (C) 2012 by Imagination Technologies Ltd.
  2. !
  3. ! 64-bit signed compare routine.
  4. !
  5. .text
  6. .global ___cmpdi2
  7. .type ___cmpdi2,function
  8. ! low high
  9. ! s64 a (D0Ar2, D1Ar1)
  10. ! s64 b (D0Ar4, D1Ar3)
  11. ___cmpdi2:
  12. ! start at 1 (equal) and conditionally increment or decrement
  13. MOV D0Re0,#1
  14. ! high words differ?
  15. CMP D1Ar1,D1Ar3
  16. BNE $Lhigh_differ
  17. ! unsigned compare low words
  18. CMP D0Ar2,D0Ar4
  19. SUBLO D0Re0,D0Re0,#1
  20. ADDHI D0Re0,D0Re0,#1
  21. MOV PC,D1RtP
  22. $Lhigh_differ:
  23. ! signed compare high words
  24. SUBLT D0Re0,D0Re0,#1
  25. ADDGT D0Re0,D0Re0,#1
  26. MOV PC,D1RtP
  27. .size ___cmpdi2,.-___cmpdi2