ack/mach/powerpc/libem/cuf8.s

27 lines
549 B
ArmAsm
Raw Normal View History

2007-11-02 18:56:58 +00:00
.sect .text
! Converts a 32-bit unsigned integer into a 64-bit double.
!
! Stack: ( uint -- double )
.define .cuf8
.cuf8:
addi sp, sp, -4 ! make space for the double
lis r3, 0x4330
2007-11-02 18:56:58 +00:00
stw r3, 0(sp) ! set high word to construct a double
2007-11-02 18:56:58 +00:00
lfd f0, 0(sp) ! load value
lis r3, ha16[pivot]
lfd f1, lo16[pivot](r3) ! load pivot value
2007-11-02 18:56:58 +00:00
fsub f0, f0, f1 ! adjust
2007-11-02 18:56:58 +00:00
stfd f0, 0(sp) ! save value again...
blr ! ...and return
2007-11-02 18:56:58 +00:00
.sect .rom
pivot:
.data4 0x43300000
.data4 0x00000000