From 97c5bef4a173d73dfb31f334a06a75f663f22379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sun, 22 May 2005 23:16:55 +0000 Subject: [PATCH] Added missing assembly functions for __swap_float() and __swap_double(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12767 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/libroot/os/arch/x86/byteorder.S | 23 ++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/system/libroot/os/arch/x86/byteorder.S b/src/system/libroot/os/arch/x86/byteorder.S index a6c7aaac73..90fd894992 100644 --- a/src/system/libroot/os/arch/x86/byteorder.S +++ b/src/system/libroot/os/arch/x86/byteorder.S @@ -1,7 +1,7 @@ -/* -** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved. -** Distributed under the terms of the OpenBeOS License. -*/ +/* + * Copyright 2003-2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Distributed under the terms of the MIT License. + */ #define FUNCTION(x) .global x; .type x,@function; x @@ -38,5 +38,20 @@ FUNCTION(__swap_int64): ret /* float __swap_float(float value) */ +FUNCTION(__swap_float): + movl 4(%esp), %eax + bswap %eax + movl %eax, 4(%esp) + fld 4(%esp) + ret /* double __swap_double(double value) */ +FUNCTION(__swap_double): + movl 4(%esp), %edx /* the 32-bits registers are swapped here */ + movl 8(%esp), %eax + bswap %eax + bswap %edx + movl %eax, 4(%esp) + movl %edx, 8(%esp) + fldl 4(%esp) + ret