cuf8.s 640 B

123456789101112131415161718192021222324252627282930313233
  1. #
  2. ! $Source$
  3. ! $State$
  4. ! $Revision$
  5. #include "powerpc.h"
  6. .sect .text
  7. ! Converts a 32-bit unsigned integer into a 64-bit double.
  8. !
  9. ! Stack: ( uint -- double )
  10. .define .cuf8
  11. .cuf8:
  12. addi sp, sp, -4 ! make space for the double
  13. addis r3, r0, 0x4330
  14. stw r3, 0(sp) ! set high word to construct a double
  15. lfd f0, 0(sp) ! load value
  16. la (r3, pivot)
  17. lfd f1, 0(r3) ! load pivot value
  18. fsub f0, f0, f1 ! adjust
  19. stfd f0, 0(sp) ! save value again...
  20. bclr ALWAYS, 0, 0 ! ...and return
  21. .sect .rom
  22. pivot:
  23. .data4 0x43300000
  24. .data4 0x00000000