__ucmpdi2.S 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* __ucmpdi2.S: 64-bit unsigned compare
  2. *
  3. * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. .text
  12. .p2align 4
  13. ###############################################################################
  14. #
  15. # int __ucmpdi2(unsigned long long a [GR8:GR9],
  16. # unsigned long long b [GR10:GR11])
  17. #
  18. # - returns 0, 1, or 2 as a <, =, > b respectively.
  19. #
  20. ###############################################################################
  21. .globl __ucmpdi2
  22. .type __ucmpdi2,@function
  23. __ucmpdi2:
  24. or.p gr8,gr0,gr4
  25. subcc gr8,gr10,gr0,icc0
  26. setlos.p #0,gr8
  27. bclr icc0,#2 ; a.msw < b.msw
  28. setlos.p #2,gr8
  29. bhilr icc0,#0 ; a.msw > b.msw
  30. subcc.p gr9,gr11,gr0,icc1
  31. setlos #0,gr8
  32. setlos.p #2,gr9
  33. setlos #1,gr7
  34. cknc icc1,cc6
  35. cor.p gr9,gr0,gr8, cc6,#1
  36. cckls icc1,cc4, cc6,#1
  37. andcr cc6,cc4,cc4
  38. cor gr7,gr0,gr8, cc4,#1
  39. bralr
  40. .size __ucmpdi2, .-__ucmpdi2