From cb4467360679208995fb20f17a9e621557d4eb3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Mon, 22 Oct 2007 15:50:27 +0000 Subject: [PATCH] Naive swap_float/double. Not sure sizeof(double) is 8 on m68k... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22664 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/libroot/os/arch/m68k/byteorder.S | 51 ++------------------- 1 file changed, 5 insertions(+), 46 deletions(-) diff --git a/src/system/libroot/os/arch/m68k/byteorder.S b/src/system/libroot/os/arch/m68k/byteorder.S index 9c5d87eb75..fa0d6af5be 100644 --- a/src/system/libroot/os/arch/m68k/byteorder.S +++ b/src/system/libroot/os/arch/m68k/byteorder.S @@ -60,57 +60,16 @@ FUNCTION(__swap_int64): */ /* float __swap_float(float value) - * f1 */ FUNCTION(__swap_float): -XXX: TODO - // push a stack frame - stwu %r1, -32(%r1) - mflr %r0 - stw %r0, 36(%r1) + jmp __swap_int32 + //rts - // %f1 -> %r3 - stfs %f1, 20(%r1) - lwz %r3, 20(%r1) - // let __swap_int32 convert %r3 - bl __swap_int32 - - // %r3 -> %f1 - stw %r3, 20(%r1) - lfs %f1, 20(%r1) - - // pop the stack frame - lwz %r0, 36(%r1) - mtlr %r0 - addi %r1, %r1, 32 - blr /* double __swap_double(double value) - * f1 */ FUNCTION(__swap_double): -XXX: TODO - // push a stack frame - stwu %r1, -32(%r1) - mflr %r0 - stw %r0, 36(%r1) - - // %f1 -> (%r3:%r4) - stfd %f1, 20(%r1) - lwz %r3, 20(%r1) - lwz %r4, 24(%r1) - - // let __swap_int64 convert %r3:%r4 - bl __swap_int64 - - // (%r3:%r4) -> %f1 - stw %r3, 20(%r1) - stw %r4, 24(%r1) - lfd %f1, 20(%r1) - - // pop the stack frame - lwz %r0, 36(%r1) - mtlr %r0 - addi %r1, %r1, 32 - blr + jmp __swap_int32 + //rts + //XXX:check sizeof(double)