rem.S 318 B

1234567891011121314151617181920
  1. /*
  2. * Sparc v9 has divide.
  3. * As divx takes 68 cycles and sdivcc only 36,
  4. * we use sdivcc eventhough it is deprecated.
  5. */
  6. .text
  7. .align 32
  8. ENTRY(.rem)
  9. sra %o0, 31, %o2
  10. wr %o2, 0, %y
  11. sdivcc %o0, %o1, %o2
  12. xnor %o2, %g0, %o3
  13. movvs %icc, %o3, %o2
  14. smul %o2, %o1, %o2
  15. retl
  16. sub %o0, %o2, %o0
  17. END(.rem)