Index: uspace/Makefile
===================================================================
--- uspace/Makefile	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ uspace/Makefile	(revision 954c0240b720c64358bccbdcdcb035fdd5a6f347)
@@ -218,6 +218,4 @@
 	lib/c \
 	lib/cpp \
-	lib/softint \
-	lib/softfloat \
 	lib/untar
 
@@ -290,7 +288,4 @@
 	$(MAKE) -r -C $(@D) deps.mk SELF_TARGET="$(@D).build"
 
-# Special case for base libraries.
-lib/c.build: lib/softfloat.build lib/softint.build
-
 $(BUILDS): $(BASE_BUILDS)
 
Index: uspace/Makefile.common
===================================================================
--- uspace/Makefile.common	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ uspace/Makefile.common	(revision 954c0240b720c64358bccbdcdcb035fdd5a6f347)
@@ -105,7 +105,4 @@
 LIBCPP_PREFIX = $(LIB_PREFIX)/cpp
 LIBCPP_INCLUDES_FLAGS = -I$(LIBCPP_PREFIX)/include
-
-LIBSOFTFLOAT_PREFIX = $(LIB_PREFIX)/softfloat
-LIBSOFTINT_PREFIX = $(LIB_PREFIX)/softint
 
 LIBDLTEST_PREFIX = $(LIB_PREFIX)/dltest
@@ -144,5 +141,5 @@
 endif
 
-BASE_LIBS += $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a $(LIBSOFTINT_PREFIX)/libsoftint.a
+BASE_LIBS += -lgcc
 
 ifneq ($(LINK_DYNAMIC),y)
Index: uspace/app/tester/Makefile
===================================================================
--- uspace/app/tester/Makefile	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ uspace/app/tester/Makefile	(revision 954c0240b720c64358bccbdcdcb035fdd5a6f347)
@@ -30,7 +30,5 @@
 USPACE_PREFIX = ../..
 
-# TODO: softfloat testing should be done via unit tests.
-LIBS = block softfloat drv math
-EXTRA_CFLAGS = -I$(LIBSOFTFLOAT_PREFIX)
+LIBS = block drv math
 
 BINARY = tester
@@ -57,5 +55,4 @@
 	float/float1.c \
 	float/float2.c \
-	float/softfloat1.c \
 	vfs/vfs1.c \
 	ipc/ping_pong.c \
Index: uspace/app/tester/float/softfloat1.c
===================================================================
--- uspace/app/tester/float/softfloat1.c	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,418 +1,0 @@
-/*
- * Copyright (c) 2012 Martin Decky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdbool.h>
-#include <stddef.h>
-#include <inttypes.h>
-#include <mathtypes.h>
-#include <add.h>
-#include <sub.h>
-#include <mul.h>
-#include <div.h>
-#include <comparison.h>
-#include <conversion.h>
-#include "../tester.h"
-
-#define add_float  __addsf3
-#define sub_float  __subsf3
-#define mul_float  __mulsf3
-#define div_float  __divsf3
-
-#define is_float_lt  __ltsf2
-#define is_float_gt  __gtsf2
-#define is_float_eq  __eqsf2
-
-#define add_double  __adddf3
-#define sub_double  __subdf3
-#define mul_double  __muldf3
-#define div_double  __divdf3
-
-#define is_double_lt  __ltdf2
-#define is_double_gt  __gtdf2
-#define is_double_eq  __eqdf2
-
-#define uint_to_double  __floatsidf
-#define double_to_uint  __fixunsdfsi
-#define double_to_int   __fixdfsi
-
-#define OPERANDS   10
-#define PRECISION  1000
-
-#define PRIdCMPTYPE  PRId32
-
-typedef int32_t cmptype_t;
-
-typedef void (*uint_to_double_op_t)(unsigned int, double *, double *);
-typedef void (*double_to_uint_op_t)(double, unsigned int *, unsigned int *);
-typedef void (*float_binary_op_t)(float, float, float *, float *);
-typedef void (*float_cmp_op_t)(float, float, cmptype_t *, cmptype_t *);
-typedef void (*double_binary_op_t)(double, double, double *, double *);
-typedef void (*double_cmp_op_t)(double, double, cmptype_t *, cmptype_t *);
-
-typedef void (*template_unary_t)(void *, unsigned, cmptype_t *, cmptype_t *);
-typedef void (*template_binary_t)(void *, unsigned, unsigned, cmptype_t *,
-    cmptype_t *);
-
-#define NUMBERS \
-	3.5, -2.1, 100.0, 50.0, -1024.0, 0.0, 768.3156, 1080.499999, -600.0, 1.0
-
-static float fop_a[OPERANDS] = {
-	NUMBERS
-};
-
-static double dop_a[OPERANDS] = {
-	NUMBERS
-};
-
-static unsigned int uop_a[OPERANDS] = {
-	4, 2, 100, 50, 1024, 0, 1000000, 1, 0x8000000, 500
-};
-
-static int fcmp(float a, float b)
-{
-	if (a < b)
-		return -1;
-
-	if (a > b)
-		return 1;
-
-	return 0;
-}
-
-static int dcmp(double a, double b)
-{
-	if (a < b)
-		return -1;
-
-	if (a > b)
-		return 1;
-
-	return 0;
-}
-
-static void uint_to_double_template(void *f, unsigned i, cmptype_t *pic,
-    cmptype_t *pisc)
-{
-	uint_to_double_op_t op = (uint_to_double_op_t) f;
-
-	double c;
-	double sc;
-	op(uop_a[i], &c, &sc);
-
-	*pic = (cmptype_t) (c * PRECISION);
-	*pisc = (cmptype_t) (sc * PRECISION);
-}
-
-static void double_to_uint_template(void *f, unsigned i, cmptype_t *pic,
-    cmptype_t *pisc)
-{
-	double_to_uint_op_t op = (double_to_uint_op_t) f;
-
-	unsigned int c;
-	unsigned int sc;
-	op(dop_a[i], &c, &sc);
-
-	*pic = (cmptype_t) c;
-	*pisc = (cmptype_t) sc;
-}
-
-static void float_template_binary(void *f, unsigned i, unsigned j,
-    cmptype_t *pic, cmptype_t *pisc)
-{
-	float_binary_op_t op = (float_binary_op_t) f;
-
-	float c;
-	float sc;
-	op(fop_a[i], fop_a[j], &c, &sc);
-
-	*pic = (cmptype_t) (c * PRECISION);
-	*pisc = (cmptype_t) (sc * PRECISION);
-}
-
-static void float_compare_template(void *f, unsigned i, unsigned j,
-    cmptype_t *pis, cmptype_t *piss)
-{
-	float_cmp_op_t op = (float_cmp_op_t) f;
-
-	op(dop_a[i], dop_a[j], pis, piss);
-}
-
-static void double_template_binary(void *f, unsigned i, unsigned j,
-    cmptype_t *pic, cmptype_t *pisc)
-{
-	double_binary_op_t op = (double_binary_op_t) f;
-
-	double c;
-	double sc;
-	op(dop_a[i], dop_a[j], &c, &sc);
-
-	*pic = (cmptype_t) (c * PRECISION);
-	*pisc = (cmptype_t) (sc * PRECISION);
-}
-
-static void double_compare_template(void *f, unsigned i, unsigned j,
-    cmptype_t *pis, cmptype_t *piss)
-{
-	double_cmp_op_t op = (double_cmp_op_t) f;
-
-	op(dop_a[i], dop_a[j], pis, piss);
-}
-
-static bool test_template_unary(template_unary_t template, void *f)
-{
-	bool correct = true;
-
-	for (unsigned int i = 0; i < OPERANDS; i++) {
-		cmptype_t ic;
-		cmptype_t isc;
-
-		template(f, i, &ic, &isc);
-		cmptype_t diff = ic - isc;
-
-		if (diff != 0) {
-			TPRINTF("i=%u ic=%" PRIdCMPTYPE " isc=%" PRIdCMPTYPE "\n",
-			    i, ic, isc);
-			correct = false;
-		}
-	}
-
-	return correct;
-}
-
-static bool test_template_binary(template_binary_t template, void *f)
-{
-	bool correct = true;
-
-	for (unsigned int i = 0; i < OPERANDS; i++) {
-		for (unsigned int j = 0; j < OPERANDS; j++) {
-			cmptype_t ic;
-			cmptype_t isc;
-
-			template(f, i, j, &ic, &isc);
-			cmptype_t diff = ic - isc;
-
-			if (diff != 0) {
-				TPRINTF("i=%u, j=%u ic=%" PRIdCMPTYPE
-				    " isc=%" PRIdCMPTYPE "\n", i, j, ic, isc);
-				correct = false;
-			}
-		}
-	}
-
-	return correct;
-}
-
-static void uint_to_double_operator(unsigned int a, double *pc, double *psc)
-{
-	*pc = (double) a;
-	*psc = uint_to_double(a);
-}
-
-static void double_to_uint_operator(double a, unsigned int *pc,
-    unsigned int *psc)
-{
-	*pc = (unsigned int) a;
-	*psc = double_to_uint(a);
-}
-
-static void double_to_int_operator(double a, unsigned int *pc,
-    unsigned int *psc)
-{
-	*pc = (int) a;
-	*psc = double_to_int(a);
-}
-
-static void float_add_operator(float a, float b, float *pc, float *psc)
-{
-	*pc = a + b;
-	*psc = add_float(a, b);
-}
-
-static void float_sub_operator(float a, float b, float *pc, float *psc)
-{
-	*pc = a - b;
-	*psc = sub_float(a, b);
-}
-
-static void float_mul_operator(float a, float b, float *pc, float *psc)
-{
-	*pc = a * b;
-	*psc = mul_float(a, b);
-}
-
-static void float_div_operator(float a, float b, float *pc, float *psc)
-{
-	if ((cmptype_t) b == 0) {
-		*pc = 0.0;
-		*psc = 0.0;
-		return;
-	}
-
-	*pc = a / b;
-	*psc = div_float(a, b);
-}
-
-static void float_cmp_operator(float a, float b, cmptype_t *pis,
-    cmptype_t *piss)
-{
-	*pis = fcmp(a, b);
-
-	if (is_float_lt(a, b) == -1)
-		*piss = -1;
-	else if (is_float_gt(a, b) == 1)
-		*piss = 1;
-	else if (is_float_eq(a, b) == 0)
-		*piss = 0;
-	else
-		*piss = 42;
-}
-
-static void double_add_operator(double a, double b, double *pc, double *psc)
-{
-	*pc = a + b;
-	*psc = add_double(a, b);
-}
-
-static void double_sub_operator(double a, double b, double *pc, double *psc)
-{
-	*pc = a - b;
-	*psc = sub_double(a, b);
-}
-
-static void double_mul_operator(double a, double b, double *pc, double *psc)
-{
-	*pc = a * b;
-	*psc = mul_double(a, b);
-}
-
-static void double_div_operator(double a, double b, double *pc, double *psc)
-{
-	if ((cmptype_t) b == 0) {
-		*pc = 0.0;
-		*psc = 0.0;
-		return;
-	}
-
-	*pc = a / b;
-	*psc = div_double(a, b);
-}
-
-static void double_cmp_operator(double a, double b, cmptype_t *pis,
-    cmptype_t *piss)
-{
-	*pis = dcmp(a, b);
-
-	if (is_double_lt(a, b) == -1)
-		*piss = -1;
-	else if (is_double_gt(a, b) == 1)
-		*piss = 1;
-	else if (is_double_eq(a, b) == 0)
-		*piss = 0;
-	else
-		*piss = 42;
-}
-
-const char *test_softfloat1(void)
-{
-	bool err = false;
-
-	if (!test_template_binary(float_template_binary, float_add_operator)) {
-		err = true;
-		TPRINTF("%s\n", "Float addition failed");
-	}
-
-	if (!test_template_binary(float_template_binary, float_sub_operator)) {
-		err = true;
-		TPRINTF("%s\n", "Float addition failed");
-	}
-
-	if (!test_template_binary(float_template_binary, float_mul_operator)) {
-		err = true;
-		TPRINTF("%s\n", "Float multiplication failed");
-	}
-
-	if (!test_template_binary(float_template_binary, float_div_operator)) {
-		err = true;
-		TPRINTF("%s\n", "Float division failed");
-	}
-
-	if (!test_template_binary(float_compare_template, float_cmp_operator)) {
-		err = true;
-		TPRINTF("%s\n", "Float comparison failed");
-	}
-
-	if (!test_template_binary(double_template_binary, double_add_operator)) {
-		err = true;
-		TPRINTF("%s\n", "Double addition failed");
-	}
-
-	if (!test_template_binary(double_template_binary, double_sub_operator)) {
-		err = true;
-		TPRINTF("%s\n", "Double addition failed");
-	}
-
-	if (!test_template_binary(double_template_binary, double_mul_operator)) {
-		err = true;
-		TPRINTF("%s\n", "Double multiplication failed");
-	}
-
-	if (!test_template_binary(double_template_binary, double_div_operator)) {
-		err = true;
-		TPRINTF("%s\n", "Double division failed");
-	}
-
-	if (!test_template_binary(double_compare_template, double_cmp_operator)) {
-		err = true;
-		TPRINTF("%s\n", "Double comparison failed");
-	}
-
-	if (!test_template_unary(uint_to_double_template,
-	    uint_to_double_operator)) {
-		err = true;
-		TPRINTF("%s\n", "Conversion from unsigned int to double failed");
-	}
-
-	if (!test_template_unary(double_to_uint_template,
-	    double_to_uint_operator)) {
-		err = true;
-		TPRINTF("%s\n", "Conversion from double to unsigned int failed");
-	}
-
-	if (!test_template_unary(double_to_uint_template,
-	    double_to_int_operator)) {
-		err = true;
-		TPRINTF("%s\n", "Conversion from double to signed int failed");
-	}
-
-	if (err)
-		return "Software floating point imprecision";
-
-	return NULL;
-}
Index: uspace/app/tester/float/softfloat1.def
===================================================================
--- uspace/app/tester/float/softfloat1.def	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,6 +1,0 @@
-{
-	"softfloat1",
-	"Software floating point computation",
-	&test_softfloat1,
-	true
-},
Index: uspace/app/tester/tester.c
===================================================================
--- uspace/app/tester/tester.c	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ uspace/app/tester/tester.c	(revision 954c0240b720c64358bccbdcdcb035fdd5a6f347)
@@ -65,5 +65,4 @@
 #include "float/float1.def"
 #include "float/float2.def"
-#include "float/softfloat1.def"
 #include "vfs/vfs1.def"
 #include "ipc/ping_pong.def"
Index: uspace/app/tester/tester.h
===================================================================
--- uspace/app/tester/tester.h	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ uspace/app/tester/tester.h	(revision 954c0240b720c64358bccbdcdcb035fdd5a6f347)
@@ -97,5 +97,4 @@
 extern const char *test_float1(void);
 extern const char *test_float2(void);
-extern const char *test_softfloat1(void);
 extern const char *test_vfs1(void);
 extern const char *test_ping_pong(void);
Index: uspace/lib/c/arch/arm32/src/eabi.S
===================================================================
--- uspace/lib/c/arch/arm32/src/eabi.S	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ uspace/lib/c/arch/arm32/src/eabi.S	(revision 954c0240b720c64358bccbdcdcb035fdd5a6f347)
@@ -35,62 +35,2 @@
 	mov pc, lr
 FUNCTION_END(__aeabi_read_tp)
-
-FUNCTION_BEGIN(__aeabi_idiv)
-	push {lr}
-	bl __divsi3
-	pop {lr}
-	mov pc, lr
-FUNCTION_END(__aeabi_idiv)
-
-FUNCTION_BEGIN(__aeabi_uidiv)
-	push {lr}
-	bl __udivsi3
-	pop {lr}
-	mov pc, lr
-FUNCTION_END(__aeabi_uidiv)
-
-FUNCTION_BEGIN(__aeabi_idivmod)
-	push {lr}
-	sub sp, sp, #12
-	add r2, sp, #4
-	bl __udivmodsi3
-	ldr r1, [sp, #4]
-	add sp, sp, #12
-	pop {lr}
-	mov pc, lr
-FUNCTION_END(__aeabi_idivmod)
-
-FUNCTION_BEGIN(__aeabi_uidivmod)
-	push {lr}
-	sub sp, sp, #12
-	add r2, sp, #4
-	bl __udivmodsi3
-	ldr r1, [sp, #4]
-	add sp, sp, #12
-	pop {lr}
-	mov pc, lr
-FUNCTION_END(__aeabi_uidivmod)
-
-FUNCTION_BEGIN(__aeabi_ldivmod)
-	push {lr}
-	sub sp, sp, #24
-	push {sp}
-	bl __divmoddi3
-	add sp, sp, #4
-	pop {r2, r3}
-	add sp, sp, #16
-	pop {lr}
-	mov pc, lr
-FUNCTION_END(__aeabi_ldivmod)
-
-FUNCTION_BEGIN(__aeabi_uldivmod)
-	push {lr}
-	sub sp, sp, #24
-	push {sp}
-	bl __udivmoddi3
-	add sp, sp, #4
-	pop {r2, r3}
-	add sp, sp, #16
-	pop {lr}
-	mov pc, lr
-FUNCTION_END(__aeabi_uldivmod)
Index: uspace/lib/c/arch/sparc64/Makefile.common
===================================================================
--- uspace/lib/c/arch/sparc64/Makefile.common	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ uspace/lib/c/arch/sparc64/Makefile.common	(revision 954c0240b720c64358bccbdcdcb035fdd5a6f347)
@@ -33,5 +33,5 @@
 endif
 
-COMMON_CFLAGS += -m64 -mcmodel=medlow
+COMMON_CFLAGS += -m64 -mcmodel=medlow -mhard-float -m$(QUADFLOAT)-quad-float
 
 LDFLAGS += -Wl,-no-check-sections,--gc-sections
Index: uspace/lib/posix/Makefile
===================================================================
--- uspace/lib/posix/Makefile	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ uspace/lib/posix/Makefile	(revision 954c0240b720c64358bccbdcdcb035fdd5a6f347)
@@ -40,6 +40,4 @@
 	../math/libmath.a \
 	../clui/libclui.a \
-	$(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a \
-	$(LIBSOFTINT_PREFIX)/libsoftint.a \
 	$(LIBC_PREFIX)/libc.a \
 	$(LIBC_PREFIX)/crt0.o \
@@ -93,5 +91,5 @@
 
 EXPORT_LDLIBS = \
-	-Wl,--start-group -lposix -lmath -lc -lsoftfloat -lsoftint -Wl,--end-group
+	-Wl,--start-group -lposix -lmath -lc -lgcc -Wl,--end-group
 
 EXPORT_CFLAGS = \
Index: uspace/lib/softfloat/Makefile
===================================================================
--- uspace/lib/softfloat/Makefile	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,43 +1,0 @@
-#
-# Copyright (c) 2005 Martin Decky
-# Copyright (c) 2007 Jakub Jermar
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# - Redistributions of source code must retain the above copyright
-#   notice, this list of conditions and the following disclaimer.
-# - Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in the
-#   documentation and/or other materials provided with the distribution.
-# - The name of the author may not be used to endorse or promote products
-#   derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-USPACE_PREFIX = ../..
-LIBRARY = libsoftfloat
-
-SOURCES = \
-	common.c \
-	add.c \
-	sub.c \
-	div.c \
-	mul.c \
-	neg.c \
-	comparison.c \
-	conversion.c
-
-include $(USPACE_PREFIX)/Makefile.common
Index: uspace/lib/softfloat/add.c
===================================================================
--- uspace/lib/softfloat/add.c	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,553 +1,0 @@
-/*
- * Copyright (c) 2005 Josef Cejka
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softfloat
- * @{
- */
-/** @file Addition functions.
- */
-
-#include "add.h"
-#include "comparison.h"
-#include "common.h"
-#include "sub.h"
-
-/** Add two single-precision floats with the same sign.
- *
- * @param a First input operand.
- * @param b Second input operand.
- * @return Result of addition.
- */
-float32 add_float32(float32 a, float32 b)
-{
-	int expdiff;
-	uint32_t exp1, exp2, frac1, frac2;
-
-	expdiff = a.parts.exp - b.parts.exp;
-	if (expdiff < 0) {
-		if (is_float32_nan(b)) {
-			/* TODO: fix SigNaN */
-			if (is_float32_signan(b)) {
-			}
-
-			return b;
-		}
-
-		if (b.parts.exp == FLOAT32_MAX_EXPONENT) {
-			return b;
-		}
-
-		frac1 = b.parts.fraction;
-		exp1 = b.parts.exp;
-		frac2 = a.parts.fraction;
-		exp2 = a.parts.exp;
-		expdiff *= -1;
-	} else {
-		if ((is_float32_nan(a)) || (is_float32_nan(b))) {
-			/* TODO: fix SigNaN */
-			if (is_float32_signan(a) || is_float32_signan(b)) {
-			}
-			return (is_float32_nan(a) ? a : b);
-		}
-
-		if (a.parts.exp == FLOAT32_MAX_EXPONENT) {
-			return a;
-		}
-
-		frac1 = a.parts.fraction;
-		exp1 = a.parts.exp;
-		frac2 = b.parts.fraction;
-		exp2 = b.parts.exp;
-	}
-
-	if (exp1 == 0) {
-		/* both are denormalized */
-		frac1 += frac2;
-		if (frac1 & FLOAT32_HIDDEN_BIT_MASK) {
-			/* result is not denormalized */
-			a.parts.exp = 1;
-		}
-		a.parts.fraction = frac1;
-		return a;
-	}
-
-	frac1 |= FLOAT32_HIDDEN_BIT_MASK; /* add hidden bit */
-
-	if (exp2 == 0) {
-		/* second operand is denormalized */
-		--expdiff;
-	} else {
-		/* add hidden bit to second operand */
-		frac2 |= FLOAT32_HIDDEN_BIT_MASK;
-	}
-
-	/* create some space for rounding */
-	frac1 <<= 6;
-	frac2 <<= 6;
-
-	if (expdiff < (FLOAT32_FRACTION_SIZE + 2)) {
-		frac2 >>= expdiff;
-		frac1 += frac2;
-	} else {
-		a.parts.exp = exp1;
-		a.parts.fraction = (frac1 >> 6) & (~(FLOAT32_HIDDEN_BIT_MASK));
-		return a;
-	}
-
-	if (frac1 & (FLOAT32_HIDDEN_BIT_MASK << 7)) {
-		++exp1;
-		frac1 >>= 1;
-	}
-
-	/* rounding - if first bit after fraction is set then round up */
-	frac1 += (0x1 << 5);
-
-	if (frac1 & (FLOAT32_HIDDEN_BIT_MASK << 7)) {
-		/* rounding overflow */
-		++exp1;
-		frac1 >>= 1;
-	}
-
-	if ((exp1 == FLOAT32_MAX_EXPONENT) || (exp2 > exp1)) {
-		/* overflow - set infinity as result */
-		a.parts.exp = FLOAT32_MAX_EXPONENT;
-		a.parts.fraction = 0;
-		return a;
-	}
-
-	a.parts.exp = exp1;
-
-	/* Clear hidden bit and shift */
-	a.parts.fraction = ((frac1 >> 6) & (~FLOAT32_HIDDEN_BIT_MASK));
-	return a;
-}
-
-/** Add two double-precision floats with the same sign.
- *
- * @param a First input operand.
- * @param b Second input operand.
- * @return Result of addition.
- */
-float64 add_float64(float64 a, float64 b)
-{
-	int expdiff;
-	uint32_t exp1, exp2;
-	uint64_t frac1, frac2;
-
-	expdiff = ((int) a.parts.exp) - b.parts.exp;
-	if (expdiff < 0) {
-		if (is_float64_nan(b)) {
-			/* TODO: fix SigNaN */
-			if (is_float64_signan(b)) {
-			}
-
-			return b;
-		}
-
-		/* b is infinity and a not */
-		if (b.parts.exp == FLOAT64_MAX_EXPONENT) {
-			return b;
-		}
-
-		frac1 = b.parts.fraction;
-		exp1 = b.parts.exp;
-		frac2 = a.parts.fraction;
-		exp2 = a.parts.exp;
-		expdiff *= -1;
-	} else {
-		if (is_float64_nan(a)) {
-			/* TODO: fix SigNaN */
-			if (is_float64_signan(a) || is_float64_signan(b)) {
-			}
-			return a;
-		}
-
-		/* a is infinity and b not */
-		if (a.parts.exp == FLOAT64_MAX_EXPONENT) {
-			return a;
-		}
-
-		frac1 = a.parts.fraction;
-		exp1 = a.parts.exp;
-		frac2 = b.parts.fraction;
-		exp2 = b.parts.exp;
-	}
-
-	if (exp1 == 0) {
-		/* both are denormalized */
-		frac1 += frac2;
-		if (frac1 & FLOAT64_HIDDEN_BIT_MASK) {
-			/* result is not denormalized */
-			a.parts.exp = 1;
-		}
-		a.parts.fraction = frac1;
-		return a;
-	}
-
-	/* add hidden bit - frac1 is sure not denormalized */
-	frac1 |= FLOAT64_HIDDEN_BIT_MASK;
-
-	/* second operand ... */
-	if (exp2 == 0) {
-		/* ... is denormalized */
-		--expdiff;
-	} else {
-		/* is not denormalized */
-		frac2 |= FLOAT64_HIDDEN_BIT_MASK;
-	}
-
-	/* create some space for rounding */
-	frac1 <<= 6;
-	frac2 <<= 6;
-
-	if (expdiff < (FLOAT64_FRACTION_SIZE + 2)) {
-		frac2 >>= expdiff;
-		frac1 += frac2;
-	} else {
-		a.parts.exp = exp1;
-		a.parts.fraction = (frac1 >> 6) & (~(FLOAT64_HIDDEN_BIT_MASK));
-		return a;
-	}
-
-	if (frac1 & (FLOAT64_HIDDEN_BIT_MASK << 7)) {
-		++exp1;
-		frac1 >>= 1;
-	}
-
-	/* rounding - if first bit after fraction is set then round up */
-	frac1 += (0x1 << 5);
-
-	if (frac1 & (FLOAT64_HIDDEN_BIT_MASK << 7)) {
-		/* rounding overflow */
-		++exp1;
-		frac1 >>= 1;
-	}
-
-	if ((exp1 == FLOAT64_MAX_EXPONENT) || (exp2 > exp1)) {
-		/* overflow - set infinity as result */
-		a.parts.exp = FLOAT64_MAX_EXPONENT;
-		a.parts.fraction = 0;
-		return a;
-	}
-
-	a.parts.exp = exp1;
-	/* Clear hidden bit and shift */
-	a.parts.fraction = ((frac1 >> 6) & (~FLOAT64_HIDDEN_BIT_MASK));
-	return a;
-}
-
-/** Add two quadruple-precision floats with the same sign.
- *
- * @param a First input operand.
- * @param b Second input operand.
- * @return Result of addition.
- */
-float128 add_float128(float128 a, float128 b)
-{
-	int expdiff;
-	uint32_t exp1, exp2;
-	uint64_t frac1_hi, frac1_lo, frac2_hi, frac2_lo, tmp_hi, tmp_lo;
-
-	expdiff = ((int) a.parts.exp) - b.parts.exp;
-	if (expdiff < 0) {
-		if (is_float128_nan(b)) {
-			/* TODO: fix SigNaN */
-			if (is_float128_signan(b)) {
-			}
-
-			return b;
-		}
-
-		/* b is infinity and a not */
-		if (b.parts.exp == FLOAT128_MAX_EXPONENT) {
-			return b;
-		}
-
-		frac1_hi = b.parts.frac_hi;
-		frac1_lo = b.parts.frac_lo;
-		exp1 = b.parts.exp;
-		frac2_hi = a.parts.frac_hi;
-		frac2_lo = a.parts.frac_lo;
-		exp2 = a.parts.exp;
-		expdiff *= -1;
-	} else {
-		if (is_float128_nan(a)) {
-			/* TODO: fix SigNaN */
-			if (is_float128_signan(a) || is_float128_signan(b)) {
-			}
-			return a;
-		}
-
-		/* a is infinity and b not */
-		if (a.parts.exp == FLOAT128_MAX_EXPONENT) {
-			return a;
-		}
-
-		frac1_hi = a.parts.frac_hi;
-		frac1_lo = a.parts.frac_lo;
-		exp1 = a.parts.exp;
-		frac2_hi = b.parts.frac_hi;
-		frac2_lo = b.parts.frac_lo;
-		exp2 = b.parts.exp;
-	}
-
-	if (exp1 == 0) {
-		/* both are denormalized */
-		add128(frac1_hi, frac1_lo, frac2_hi, frac2_lo, &frac1_hi, &frac1_lo);
-
-		and128(frac1_hi, frac1_lo,
-		    FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
-		    &tmp_hi, &tmp_lo);
-		if (lt128(0x0ll, 0x0ll, tmp_hi, tmp_lo)) {
-			/* result is not denormalized */
-			a.parts.exp = 1;
-		}
-
-		a.parts.frac_hi = frac1_hi;
-		a.parts.frac_lo = frac1_lo;
-		return a;
-	}
-
-	/* add hidden bit - frac1 is sure not denormalized */
-	or128(frac1_hi, frac1_lo,
-	    FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
-	    &frac1_hi, &frac1_lo);
-
-	/* second operand ... */
-	if (exp2 == 0) {
-		/* ... is denormalized */
-		--expdiff;
-	} else {
-		/* is not denormalized */
-		or128(frac2_hi, frac2_lo,
-		    FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
-		    &frac2_hi, &frac2_lo);
-	}
-
-	/* create some space for rounding */
-	lshift128(frac1_hi, frac1_lo, 6, &frac1_hi, &frac1_lo);
-	lshift128(frac2_hi, frac2_lo, 6, &frac2_hi, &frac2_lo);
-
-	if (expdiff < (FLOAT128_FRACTION_SIZE + 2)) {
-		rshift128(frac2_hi, frac2_lo, expdiff, &frac2_hi, &frac2_lo);
-		add128(frac1_hi, frac1_lo, frac2_hi, frac2_lo, &frac1_hi, &frac1_lo);
-	} else {
-		a.parts.exp = exp1;
-
-		rshift128(frac1_hi, frac1_lo, 6, &frac1_hi, &frac1_lo);
-		not128(FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
-		    &tmp_hi, &tmp_lo);
-		and128(frac1_hi, frac1_lo, tmp_hi, tmp_lo, &tmp_hi, &tmp_lo);
-
-		a.parts.frac_hi = tmp_hi;
-		a.parts.frac_lo = tmp_lo;
-		return a;
-	}
-
-	lshift128(FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO, 7,
-	    &tmp_hi, &tmp_lo);
-	and128(frac1_hi, frac1_lo, tmp_hi, tmp_lo, &tmp_hi, &tmp_lo);
-	if (lt128(0x0ll, 0x0ll, tmp_hi, tmp_lo)) {
-		++exp1;
-		rshift128(frac1_hi, frac1_lo, 1, &frac1_hi, &frac1_lo);
-	}
-
-	/* rounding - if first bit after fraction is set then round up */
-	add128(frac1_hi, frac1_lo, 0x0ll, 0x1ll << 5, &frac1_hi, &frac1_lo);
-
-	lshift128(FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO, 7,
-	    &tmp_hi, &tmp_lo);
-	and128(frac1_hi, frac1_lo, tmp_hi, tmp_lo, &tmp_hi, &tmp_lo);
-	if (lt128(0x0ll, 0x0ll, tmp_hi, tmp_lo)) {
-		/* rounding overflow */
-		++exp1;
-		rshift128(frac1_hi, frac1_lo, 1, &frac1_hi, &frac1_lo);
-	}
-
-	if ((exp1 == FLOAT128_MAX_EXPONENT) || (exp2 > exp1)) {
-		/* overflow - set infinity as result */
-		a.parts.exp = FLOAT64_MAX_EXPONENT;
-		a.parts.frac_hi = 0;
-		a.parts.frac_lo = 0;
-		return a;
-	}
-
-	a.parts.exp = exp1;
-
-	/* Clear hidden bit and shift */
-	rshift128(frac1_hi, frac1_lo, 6, &frac1_hi, &frac1_lo);
-	not128(FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
-	    &tmp_hi, &tmp_lo);
-	and128(frac1_hi, frac1_lo, tmp_hi, tmp_lo, &tmp_hi, &tmp_lo);
-
-	a.parts.frac_hi = tmp_hi;
-	a.parts.frac_lo = tmp_lo;
-
-	return a;
-}
-
-#ifdef float32_t
-
-float32_t __addsf3(float32_t a, float32_t b)
-{
-	float32_u ua;
-	ua.val = a;
-
-	float32_u ub;
-	ub.val = b;
-
-	float32_u res;
-
-	if (ua.data.parts.sign != ub.data.parts.sign) {
-		if (ua.data.parts.sign) {
-			ua.data.parts.sign = 0;
-			res.data = sub_float32(ub.data, ua.data);
-		} else {
-			ub.data.parts.sign = 0;
-			res.data = sub_float32(ua.data, ub.data);
-		}
-	} else
-		res.data = add_float32(ua.data, ub.data);
-
-	return res.val;
-}
-
-float32_t __aeabi_fadd(float32_t a, float32_t b)
-{
-	float32_u ua;
-	ua.val = a;
-
-	float32_u ub;
-	ub.val = b;
-
-	float32_u res;
-
-	if (ua.data.parts.sign != ub.data.parts.sign) {
-		if (ua.data.parts.sign) {
-			ua.data.parts.sign = 0;
-			res.data = sub_float32(ub.data, ua.data);
-		} else {
-			ub.data.parts.sign = 0;
-			res.data = sub_float32(ua.data, ub.data);
-		}
-	} else
-		res.data = add_float32(ua.data, ub.data);
-
-	return res.val;
-}
-
-#endif
-
-#ifdef float64_t
-
-float64_t __adddf3(float64_t a, float64_t b)
-{
-	float64_u ua;
-	ua.val = a;
-
-	float64_u ub;
-	ub.val = b;
-
-	float64_u res;
-
-	if (ua.data.parts.sign != ub.data.parts.sign) {
-		if (ua.data.parts.sign) {
-			ua.data.parts.sign = 0;
-			res.data = sub_float64(ub.data, ua.data);
-		} else {
-			ub.data.parts.sign = 0;
-			res.data = sub_float64(ua.data, ub.data);
-		}
-	} else
-		res.data = add_float64(ua.data, ub.data);
-
-	return res.val;
-}
-
-float64_t __aeabi_dadd(float64_t a, float64_t b)
-{
-	float64_u ua;
-	ua.val = a;
-
-	float64_u ub;
-	ub.val = b;
-
-	float64_u res;
-
-	if (ua.data.parts.sign != ub.data.parts.sign) {
-		if (ua.data.parts.sign) {
-			ua.data.parts.sign = 0;
-			res.data = sub_float64(ub.data, ua.data);
-		} else {
-			ub.data.parts.sign = 0;
-			res.data = sub_float64(ua.data, ub.data);
-		}
-	} else
-		res.data = add_float64(ua.data, ub.data);
-
-	return res.val;
-}
-
-#endif
-
-#ifdef float128_t
-
-float128_t __addtf3(float128_t a, float128_t b)
-{
-	float128_u ua;
-	ua.val = a;
-
-	float128_u ub;
-	ub.val = b;
-
-	float128_u res;
-
-	if (ua.data.parts.sign != ub.data.parts.sign) {
-		if (ua.data.parts.sign) {
-			ua.data.parts.sign = 0;
-			res.data = sub_float128(ub.data, ua.data);
-		} else {
-			ub.data.parts.sign = 0;
-			res.data = sub_float128(ua.data, ub.data);
-		}
-	} else
-		res.data = add_float128(ua.data, ub.data);
-
-	return res.val;
-}
-
-void _Qp_add(float128_t *c, float128_t *a, float128_t *b)
-{
-	*c = __addtf3(*a, *b);
-}
-
-#endif
-
-/** @}
- */
Index: uspace/lib/softfloat/add.h
===================================================================
--- uspace/lib/softfloat/add.h	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/*
- * Copyright (c) 2005 Josef Cejka
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softfloat
- * @{
- */
-/** @file Addition functions.
- */
-
-#ifndef __ADD_H__
-#define __ADD_H__
-
-#include <mathtypes.h>
-
-extern float32 add_float32(float32, float32);
-extern float64 add_float64(float64, float64);
-extern float96 add_float96(float96, float96);
-extern float128 add_float128(float128, float128);
-
-#ifdef float32_t
-extern float32_t __addsf3(float32_t, float32_t);
-extern float32_t __aeabi_fadd(float32_t, float32_t);
-#endif
-
-#ifdef float64_t
-extern float64_t __adddf3(float64_t, float64_t);
-extern float64_t __aeabi_dadd(float64_t, float64_t);
-#endif
-
-#ifdef float128_t
-extern float128_t __addtf3(float128_t, float128_t);
-extern void _Qp_add(float128_t *, float128_t *, float128_t *);
-#endif
-
-#endif
-
-/** @}
- */
Index: uspace/lib/softfloat/common.c
===================================================================
--- uspace/lib/softfloat/common.c	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,697 +1,0 @@
-/*
- * Copyright (c) 2005 Josef Cejka
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softfloat
- * @{
- */
-/** @file Common helper operations.
- */
-
-#include "common.h"
-
-/* Table for fast leading zeroes counting. */
-char zeroTable[256] = {
-	8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
-	3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
-	2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-	2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-/**
- * Take fraction shifted by 10 bits to the left, round it, normalize it
- * and detect exceptions
- *
- * @param cexp Exponent with bias.
- * @param cfrac Fraction shifted 10 bits to the left with added hidden bit.
- * @param sign Resulting sign.
- * @return Finished double-precision float.
- */
-float64 finish_float64(int32_t cexp, uint64_t cfrac, char sign)
-{
-	float64 result;
-
-	result.parts.sign = sign;
-
-	/* find first nonzero digit and shift result and detect possibly underflow */
-	while ((cexp > 0) && (cfrac) &&
-	    (!(cfrac & (FLOAT64_HIDDEN_BIT_MASK << (64 - FLOAT64_FRACTION_SIZE - 1))))) {
-		cexp--;
-		cfrac <<= 1;
-		/* TODO: fix underflow */
-	}
-
-	if ((cexp < 0) || (cexp == 0 &&
-	    (!(cfrac & (FLOAT64_HIDDEN_BIT_MASK << (64 - FLOAT64_FRACTION_SIZE - 1)))))) {
-		/* FIXME: underflow */
-		result.parts.exp = 0;
-		if ((cexp + FLOAT64_FRACTION_SIZE + 1) < 0) { /* +1 is place for rounding */
-			result.parts.fraction = 0;
-			return result;
-		}
-
-		while (cexp < 0) {
-			cexp++;
-			cfrac >>= 1;
-		}
-
-		cfrac += (0x1 << (64 - FLOAT64_FRACTION_SIZE - 3));
-
-		if (!(cfrac & (FLOAT64_HIDDEN_BIT_MASK << (64 - FLOAT64_FRACTION_SIZE - 1)))) {
-			result.parts.fraction =
-			    ((cfrac >> (64 - FLOAT64_FRACTION_SIZE - 2)) & (~FLOAT64_HIDDEN_BIT_MASK));
-			return result;
-		}
-	} else {
-		cfrac += (0x1 << (64 - FLOAT64_FRACTION_SIZE - 3));
-	}
-
-	++cexp;
-
-	if (cfrac & (FLOAT64_HIDDEN_BIT_MASK << (64 - FLOAT64_FRACTION_SIZE - 1))) {
-		++cexp;
-		cfrac >>= 1;
-	}
-
-	/* check overflow */
-	if (cexp >= FLOAT64_MAX_EXPONENT) {
-		/* FIXME: overflow, return infinity */
-		result.parts.exp = FLOAT64_MAX_EXPONENT;
-		result.parts.fraction = 0;
-		return result;
-	}
-
-	result.parts.exp = (uint32_t) cexp;
-
-	result.parts.fraction =
-	    ((cfrac >> (64 - FLOAT64_FRACTION_SIZE - 2)) & (~FLOAT64_HIDDEN_BIT_MASK));
-
-	return result;
-}
-
-/**
- * Take fraction, round it, normalize it and detect exceptions
- *
- * @param cexp Exponent with bias.
- * @param cfrac_hi High part of the fraction shifted 14 bits to the left
- *     with added hidden bit.
- * @param cfrac_lo Low part of the fraction shifted 14 bits to the left
- *     with added hidden bit.
- * @param sign Resulting sign.
- * @param shift_out Bits right-shifted out from fraction by the caller.
- * @return Finished quadruple-precision float.
- */
-float128 finish_float128(int32_t cexp, uint64_t cfrac_hi, uint64_t cfrac_lo,
-    char sign, uint64_t shift_out)
-{
-	float128 result;
-	uint64_t tmp_hi, tmp_lo;
-
-	result.parts.sign = sign;
-
-	/* find first nonzero digit and shift result and detect possibly underflow */
-	lshift128(FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
-	    1, &tmp_hi, &tmp_lo);
-	and128(cfrac_hi, cfrac_lo, tmp_hi, tmp_lo, &tmp_hi, &tmp_lo);
-	while ((cexp > 0) && (lt128(0x0ll, 0x0ll, cfrac_hi, cfrac_lo)) &&
-	    (!lt128(0x0ll, 0x0ll, tmp_hi, tmp_lo))) {
-		cexp--;
-		lshift128(cfrac_hi, cfrac_lo, 1, &cfrac_hi, &cfrac_lo);
-		/* TODO: fix underflow */
-
-		lshift128(FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
-		    1, &tmp_hi, &tmp_lo);
-		and128(cfrac_hi, cfrac_lo, tmp_hi, tmp_lo, &tmp_hi, &tmp_lo);
-	}
-
-	lshift128(FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
-	    1, &tmp_hi, &tmp_lo);
-	and128(cfrac_hi, cfrac_lo, tmp_hi, tmp_lo, &tmp_hi, &tmp_lo);
-	if ((cexp < 0) || (cexp == 0 &&
-	    (!lt128(0x0ll, 0x0ll, tmp_hi, tmp_lo)))) {
-		/* FIXME: underflow */
-		result.parts.exp = 0;
-		if ((cexp + FLOAT128_FRACTION_SIZE + 1) < 0) { /* +1 is place for rounding */
-			result.parts.frac_hi = 0x0ll;
-			result.parts.frac_lo = 0x0ll;
-			return result;
-		}
-
-		while (cexp < 0) {
-			cexp++;
-			rshift128(cfrac_hi, cfrac_lo, 1, &cfrac_hi, &cfrac_lo);
-		}
-
-		if (shift_out & (0x1ull < 64)) {
-			add128(cfrac_hi, cfrac_lo, 0x0ll, 0x1ll, &cfrac_hi, &cfrac_lo);
-		}
-
-		lshift128(FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
-		    1, &tmp_hi, &tmp_lo);
-		and128(cfrac_hi, cfrac_lo, tmp_hi, tmp_lo, &tmp_hi, &tmp_lo);
-		if (!lt128(0x0ll, 0x0ll, tmp_hi, tmp_lo)) {
-			not128(FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
-			    &tmp_hi, &tmp_lo);
-			and128(cfrac_hi, cfrac_lo, tmp_hi, tmp_lo, &tmp_hi, &tmp_lo);
-			result.parts.frac_hi = tmp_hi;
-			result.parts.frac_lo = tmp_lo;
-			return result;
-		}
-	} else {
-		if (shift_out & (0x1ull < 64)) {
-			add128(cfrac_hi, cfrac_lo, 0x0ll, 0x1ll, &cfrac_hi, &cfrac_lo);
-		}
-	}
-
-	++cexp;
-
-	lshift128(FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
-	    1, &tmp_hi, &tmp_lo);
-	and128(cfrac_hi, cfrac_lo, tmp_hi, tmp_lo, &tmp_hi, &tmp_lo);
-	if (lt128(0x0ll, 0x0ll, tmp_hi, tmp_lo)) {
-		++cexp;
-		rshift128(cfrac_hi, cfrac_lo, 1, &cfrac_hi, &cfrac_lo);
-	}
-
-	/* check overflow */
-	if (cexp >= FLOAT128_MAX_EXPONENT) {
-		/* FIXME: overflow, return infinity */
-		result.parts.exp = FLOAT128_MAX_EXPONENT;
-		result.parts.frac_hi = 0x0ll;
-		result.parts.frac_lo = 0x0ll;
-		return result;
-	}
-
-	result.parts.exp = (uint32_t) cexp;
-
-	not128(FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
-	    &tmp_hi, &tmp_lo);
-	and128(cfrac_hi, cfrac_lo, tmp_hi, tmp_lo, &tmp_hi, &tmp_lo);
-	result.parts.frac_hi = tmp_hi;
-	result.parts.frac_lo = tmp_lo;
-
-	return result;
-}
-
-/**
- * Counts leading zeroes in byte.
- *
- * @param i Byte for which to count leading zeroes.
- * @return Number of detected leading zeroes.
- */
-int count_zeroes8(uint8_t i)
-{
-	return zeroTable[i];
-}
-
-/**
- * Counts leading zeroes in 32bit unsigned integer.
- *
- * @param i Integer for which to count leading zeroes.
- * @return Number of detected leading zeroes.
- */
-int count_zeroes32(uint32_t i)
-{
-	int j;
-	for (j = 0; j < 32; j += 8) {
-		if (i & (0xFFu << (24 - j))) {
-			return (j + count_zeroes8(i >> (24 - j)));
-		}
-	}
-
-	return 32;
-}
-
-/**
- * Counts leading zeroes in 64bit unsigned integer.
- *
- * @param i Integer for which to count leading zeroes.
- * @return Number of detected leading zeroes.
- */
-int count_zeroes64(uint64_t i)
-{
-	int j;
-	for (j = 0; j < 64; j += 8) {
-		if (i & (0xFFll << (56 - j))) {
-			return (j + count_zeroes8(i >> (56 - j)));
-		}
-	}
-
-	return 64;
-}
-
-/**
- * Round and normalize number expressed by exponent and fraction with
- * first bit (equal to hidden bit) at 30th bit.
- *
- * @param exp Exponent part.
- * @param fraction Fraction with hidden bit shifted to 30th bit.
- */
-void round_float32(int32_t *exp, uint32_t *fraction)
-{
-	/* rounding - if first bit after fraction is set then round up */
-	(*fraction) += (0x1 << (32 - FLOAT32_FRACTION_SIZE - 3));
-
-	if ((*fraction) &
-	    (FLOAT32_HIDDEN_BIT_MASK << (32 - FLOAT32_FRACTION_SIZE - 1))) {
-		/* rounding overflow */
-		++(*exp);
-		(*fraction) >>= 1;
-	}
-
-	if (((*exp) >= FLOAT32_MAX_EXPONENT) || ((*exp) < 0)) {
-		/* overflow - set infinity as result */
-		(*exp) = FLOAT32_MAX_EXPONENT;
-		(*fraction) = 0;
-	}
-}
-
-/**
- * Round and normalize number expressed by exponent and fraction with
- * first bit (equal to hidden bit) at bit 62.
- *
- * @param exp Exponent part.
- * @param fraction Fraction with hidden bit shifted to bit 62.
- */
-void round_float64(int32_t *exp, uint64_t *fraction)
-{
-	/*
-	 * Rounding - if first bit after fraction is set then round up.
-	 */
-
-	/*
-	 * Add 1 to the least significant bit of the fraction respecting the
-	 * current shift to bit 62 and see if there will be a carry to bit 63.
-	 */
-	(*fraction) += (0x1 << (64 - FLOAT64_FRACTION_SIZE - 3));
-
-	/* See if there was a carry to bit 63. */
-	if ((*fraction) &
-	    (FLOAT64_HIDDEN_BIT_MASK << (64 - FLOAT64_FRACTION_SIZE - 1))) {
-		/* rounding overflow */
-		++(*exp);
-		(*fraction) >>= 1;
-	}
-
-	if (((*exp) >= FLOAT64_MAX_EXPONENT) || ((*exp) < 0)) {
-		/* overflow - set infinity as result */
-		(*exp) = FLOAT64_MAX_EXPONENT;
-		(*fraction) = 0;
-	}
-}
-
-/**
- * Round and normalize number expressed by exponent and fraction with
- * first bit (equal to hidden bit) at 126th bit.
- *
- * @param exp Exponent part.
- * @param frac_hi High part of fraction part with hidden bit shifted to 126th bit.
- * @param frac_lo Low part of fraction part with hidden bit shifted to 126th bit.
- */
-void round_float128(int32_t *exp, uint64_t *frac_hi, uint64_t *frac_lo)
-{
-	uint64_t tmp_hi, tmp_lo;
-
-	/* rounding - if first bit after fraction is set then round up */
-	lshift128(0x0ll, 0x1ll, (128 - FLOAT128_FRACTION_SIZE - 3), &tmp_hi, &tmp_lo);
-	add128(*frac_hi, *frac_lo, tmp_hi, tmp_lo, frac_hi, frac_lo);
-
-	lshift128(FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
-	    (128 - FLOAT128_FRACTION_SIZE - 3), &tmp_hi, &tmp_lo);
-	and128(*frac_hi, *frac_lo, tmp_hi, tmp_lo, &tmp_hi, &tmp_lo);
-	if (lt128(0x0ll, 0x0ll, tmp_hi, tmp_lo)) {
-		/* rounding overflow */
-		++(*exp);
-		rshift128(*frac_hi, *frac_lo, 1, frac_hi, frac_lo);
-	}
-
-	if (((*exp) >= FLOAT128_MAX_EXPONENT) || ((*exp) < 0)) {
-		/* overflow - set infinity as result */
-		(*exp) = FLOAT128_MAX_EXPONENT;
-		(*frac_hi) = 0;
-		(*frac_lo) = 0;
-	}
-}
-
-/**
- * Logical shift left on the 128-bit operand.
- *
- * @param a_hi High part of the input operand.
- * @param a_lo Low part of the input operand.
- * @param shift Number of bits by witch to shift.
- * @param r_hi Address to store high part of the result.
- * @param r_lo Address to store low part of the result.
- */
-void lshift128(
-    uint64_t a_hi, uint64_t a_lo, int shift,
-    uint64_t *r_hi, uint64_t *r_lo)
-{
-	if (shift <= 0) {
-		/* do nothing */
-	} else if (shift >= 128) {
-		a_hi = 0;
-		a_lo = 0;
-	} else if (shift >= 64) {
-		a_hi = a_lo << (shift - 64);
-		a_lo = 0;
-	} else {
-		a_hi <<= shift;
-		a_hi |= a_lo >> (64 - shift);
-		a_lo <<= shift;
-	}
-
-	*r_hi = a_hi;
-	*r_lo = a_lo;
-}
-
-/**
- * Logical shift right on the 128-bit operand.
- *
- * @param a_hi High part of the input operand.
- * @param a_lo Low part of the input operand.
- * @param shift Number of bits by witch to shift.
- * @param r_hi Address to store high part of the result.
- * @param r_lo Address to store low part of the result.
- */
-void rshift128(
-    uint64_t a_hi, uint64_t a_lo, int shift,
-    uint64_t *r_hi, uint64_t *r_lo)
-{
-	if (shift <= 0) {
-		/* do nothing */
-	} else 	if (shift >= 128) {
-		a_hi = 0;
-		a_lo = 0;
-	} else if (shift >= 64) {
-		a_lo = a_hi >> (shift - 64);
-		a_hi = 0;
-	} else {
-		a_lo >>= shift;
-		a_lo |= a_hi << (64 - shift);
-		a_hi >>= shift;
-	}
-
-	*r_hi = a_hi;
-	*r_lo = a_lo;
-}
-
-/**
- * Bitwise AND on 128-bit operands.
- *
- * @param a_hi High part of the first input operand.
- * @param a_lo Low part of the first input operand.
- * @param b_hi High part of the second input operand.
- * @param b_lo Low part of the second input operand.
- * @param r_hi Address to store high part of the result.
- * @param r_lo Address to store low part of the result.
- */
-void and128(
-    uint64_t a_hi, uint64_t a_lo,
-    uint64_t b_hi, uint64_t b_lo,
-    uint64_t *r_hi, uint64_t *r_lo)
-{
-	*r_hi = a_hi & b_hi;
-	*r_lo = a_lo & b_lo;
-}
-
-/**
- * Bitwise inclusive OR on 128-bit operands.
- *
- * @param a_hi High part of the first input operand.
- * @param a_lo Low part of the first input operand.
- * @param b_hi High part of the second input operand.
- * @param b_lo Low part of the second input operand.
- * @param r_hi Address to store high part of the result.
- * @param r_lo Address to store low part of the result.
- */
-void or128(
-    uint64_t a_hi, uint64_t a_lo,
-    uint64_t b_hi, uint64_t b_lo,
-    uint64_t *r_hi, uint64_t *r_lo)
-{
-	*r_hi = a_hi | b_hi;
-	*r_lo = a_lo | b_lo;
-}
-
-/**
- * Bitwise exclusive OR on 128-bit operands.
- *
- * @param a_hi High part of the first input operand.
- * @param a_lo Low part of the first input operand.
- * @param b_hi High part of the second input operand.
- * @param b_lo Low part of the second input operand.
- * @param r_hi Address to store high part of the result.
- * @param r_lo Address to store low part of the result.
- */
-void xor128(
-    uint64_t a_hi, uint64_t a_lo,
-    uint64_t b_hi, uint64_t b_lo,
-    uint64_t *r_hi, uint64_t *r_lo)
-{
-	*r_hi = a_hi ^ b_hi;
-	*r_lo = a_lo ^ b_lo;
-}
-
-/**
- * Bitwise NOT on the 128-bit operand.
- *
- * @param a_hi High part of the input operand.
- * @param a_lo Low part of the input operand.
- * @param r_hi Address to store high part of the result.
- * @param r_lo Address to store low part of the result.
- */
-void not128(
-    uint64_t a_hi, uint64_t a_lo,
-    uint64_t *r_hi, uint64_t *r_lo)
-{
-	*r_hi = ~a_hi;
-	*r_lo = ~a_lo;
-}
-
-/**
- * Equality comparison of 128-bit operands.
- *
- * @param a_hi High part of the first input operand.
- * @param a_lo Low part of the first input operand.
- * @param b_hi High part of the second input operand.
- * @param b_lo Low part of the second input operand.
- * @return 1 if operands are equal, 0 otherwise.
- */
-int eq128(uint64_t a_hi, uint64_t a_lo, uint64_t b_hi, uint64_t b_lo)
-{
-	return (a_hi == b_hi) && (a_lo == b_lo);
-}
-
-/**
- * Lower-or-equal comparison of 128-bit operands.
- *
- * @param a_hi High part of the first input operand.
- * @param a_lo Low part of the first input operand.
- * @param b_hi High part of the second input operand.
- * @param b_lo Low part of the second input operand.
- * @return 1 if a is lower or equal to b, 0 otherwise.
- */
-int le128(uint64_t a_hi, uint64_t a_lo, uint64_t b_hi, uint64_t b_lo)
-{
-	return (a_hi < b_hi) || ((a_hi == b_hi) && (a_lo <= b_lo));
-}
-
-/**
- * Lower-than comparison of 128-bit operands.
- *
- * @param a_hi High part of the first input operand.
- * @param a_lo Low part of the first input operand.
- * @param b_hi High part of the second input operand.
- * @param b_lo Low part of the second input operand.
- * @return 1 if a is lower than b, 0 otherwise.
- */
-int lt128(uint64_t a_hi, uint64_t a_lo, uint64_t b_hi, uint64_t b_lo)
-{
-	return (a_hi < b_hi) || ((a_hi == b_hi) && (a_lo < b_lo));
-}
-
-/**
- * Addition of two 128-bit unsigned integers.
- *
- * @param a_hi High part of the first input operand.
- * @param a_lo Low part of the first input operand.
- * @param b_hi High part of the second input operand.
- * @param b_lo Low part of the second input operand.
- * @param r_hi Address to store high part of the result.
- * @param r_lo Address to store low part of the result.
- */
-void add128(uint64_t a_hi, uint64_t a_lo,
-    uint64_t b_hi, uint64_t b_lo,
-    uint64_t *r_hi, uint64_t *r_lo)
-{
-	uint64_t low = a_lo + b_lo;
-	*r_lo = low;
-	/* detect overflow to add a carry */
-	*r_hi = a_hi + b_hi + (low < a_lo);
-}
-
-/**
- * Substraction of two 128-bit unsigned integers.
- *
- * @param a_hi High part of the first input operand.
- * @param a_lo Low part of the first input operand.
- * @param b_hi High part of the second input operand.
- * @param b_lo Low part of the second input operand.
- * @param r_hi Address to store high part of the result.
- * @param r_lo Address to store low part of the result.
- */
-void sub128(uint64_t a_hi, uint64_t a_lo,
-    uint64_t b_hi, uint64_t b_lo,
-    uint64_t *r_hi, uint64_t *r_lo)
-{
-	*r_lo = a_lo - b_lo;
-	/* detect underflow to substract a carry */
-	*r_hi = a_hi - b_hi - (a_lo < b_lo);
-}
-
-/**
- * Multiplication of two 64-bit unsigned integers.
- *
- * @param a First input operand.
- * @param b Second input operand.
- * @param r_hi Address to store high part of the result.
- * @param r_lo Address to store low part of the result.
- */
-void mul64(uint64_t a, uint64_t b, uint64_t *r_hi, uint64_t *r_lo)
-{
-	uint64_t low, high, middle1, middle2;
-	uint32_t alow, blow;
-
-	alow = a & 0xFFFFFFFF;
-	blow = b & 0xFFFFFFFF;
-
-	a >>= 32;
-	b >>= 32;
-
-	low = ((uint64_t) alow) * blow;
-	middle1 = a * blow;
-	middle2 = alow * b;
-	high = a * b;
-
-	middle1 += middle2;
-	high += (((uint64_t) (middle1 < middle2)) << 32) + (middle1 >> 32);
-	middle1 <<= 32;
-	low += middle1;
-	high += (low < middle1);
-	*r_lo = low;
-	*r_hi = high;
-}
-
-/**
- * Multiplication of two 128-bit unsigned integers.
- *
- * @param a_hi High part of the first input operand.
- * @param a_lo Low part of the first input operand.
- * @param b_hi High part of the second input operand.
- * @param b_lo Low part of the second input operand.
- * @param r_hihi Address to store first (highest) quarter of the result.
- * @param r_hilo Address to store second quarter of the result.
- * @param r_lohi Address to store third quarter of the result.
- * @param r_lolo Address to store fourth (lowest) quarter of the result.
- */
-void mul128(uint64_t a_hi, uint64_t a_lo, uint64_t b_hi, uint64_t b_lo,
-    uint64_t *r_hihi, uint64_t *r_hilo, uint64_t *r_lohi, uint64_t *r_lolo)
-{
-	uint64_t hihi, hilo, lohi, lolo;
-	uint64_t tmp1, tmp2;
-
-	mul64(a_lo, b_lo, &lohi, &lolo);
-	mul64(a_lo, b_hi, &hilo, &tmp2);
-	add128(hilo, tmp2, 0x0ll, lohi, &hilo, &lohi);
-	mul64(a_hi, b_hi, &hihi, &tmp1);
-	add128(hihi, tmp1, 0x0ll, hilo, &hihi, &hilo);
-	mul64(a_hi, b_lo, &tmp1, &tmp2);
-	add128(tmp1, tmp2, 0x0ll, lohi, &tmp1, &lohi);
-	add128(hihi, hilo, 0x0ll, tmp1, &hihi, &hilo);
-
-	*r_hihi = hihi;
-	*r_hilo = hilo;
-	*r_lohi = lohi;
-	*r_lolo = lolo;
-}
-
-/**
- * Estimate the quotient of 128-bit unsigned divident and 64-bit unsigned
- * divisor.
- *
- * @param a_hi High part of the divident.
- * @param a_lo Low part of the divident.
- * @param b Divisor.
- * @return Quotient approximation.
- */
-uint64_t div128est(uint64_t a_hi, uint64_t a_lo, uint64_t b)
-{
-	uint64_t b_hi, b_lo;
-	uint64_t rem_hi, rem_lo;
-	uint64_t tmp_hi, tmp_lo;
-	uint64_t result;
-
-	if (b <= a_hi) {
-		return 0xFFFFFFFFFFFFFFFFull;
-	}
-
-	b_hi = b >> 32;
-	result = ((b_hi << 32) <= a_hi) ? (0xFFFFFFFFull << 32) : (a_hi / b_hi) << 32;
-	mul64(b, result, &tmp_hi, &tmp_lo);
-	sub128(a_hi, a_lo, tmp_hi, tmp_lo, &rem_hi, &rem_lo);
-
-	while ((int64_t) rem_hi < 0) {
-		result -= 0x1ll << 32;
-		b_lo = b << 32;
-		add128(rem_hi, rem_lo, b_hi, b_lo, &rem_hi, &rem_lo);
-	}
-
-	rem_hi = (rem_hi << 32) | (rem_lo >> 32);
-	if ((b_hi << 32) <= rem_hi) {
-		result |= 0xFFFFFFFF;
-	} else {
-		result |= rem_hi / b_hi;
-	}
-
-	return result;
-}
-
-/** @}
- */
Index: uspace/lib/softfloat/common.h
===================================================================
--- uspace/lib/softfloat/common.h	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,81 +1,0 @@
-/*
- * Copyright (c) 2005 Josef Cejka
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softfloat
- * @{
- */
-/** @file Common helper operations.
- */
-
-#ifndef __COMMON_H__
-#define __COMMON_H__
-
-#include <mathtypes.h>
-
-extern float64 finish_float64(int32_t, uint64_t, char);
-extern float128 finish_float128(int32_t, uint64_t, uint64_t, char, uint64_t);
-
-extern int count_zeroes8(uint8_t);
-extern int count_zeroes32(uint32_t);
-extern int count_zeroes64(uint64_t);
-
-extern void round_float32(int32_t *, uint32_t *);
-extern void round_float64(int32_t *, uint64_t *);
-extern void round_float128(int32_t *, uint64_t *, uint64_t *);
-
-extern void lshift128(uint64_t, uint64_t, int, uint64_t *, uint64_t *);
-extern void rshift128(uint64_t, uint64_t, int, uint64_t *, uint64_t *);
-
-extern void and128(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t *,
-    uint64_t *);
-extern void or128(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t *,
-    uint64_t *);
-extern void xor128(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t *,
-    uint64_t *);
-extern void not128(uint64_t, uint64_t, uint64_t *, uint64_t *);
-
-extern int eq128(uint64_t, uint64_t, uint64_t, uint64_t);
-extern int le128(uint64_t, uint64_t, uint64_t, uint64_t);
-extern int lt128(uint64_t, uint64_t, uint64_t, uint64_t);
-
-extern void add128(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t *,
-    uint64_t *);
-extern void sub128(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t *,
-    uint64_t *);
-
-extern void mul64(uint64_t, uint64_t, uint64_t *, uint64_t *);
-extern void mul128(uint64_t, uint64_t, uint64_t, uint64_t,
-    uint64_t *, uint64_t *, uint64_t *, uint64_t *);
-
-extern uint64_t div128est(uint64_t, uint64_t, uint64_t);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/softfloat/comparison.c
===================================================================
--- uspace/lib/softfloat/comparison.c	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,1202 +1,0 @@
-/*
- * Copyright (c) 2005 Josef Cejka
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softfloat
- * @{
- */
-/** @file Comparison functions.
- */
-
-#include "comparison.h"
-#include "common.h"
-
-/**
- * Determines whether the given float represents NaN (either signalling NaN or
- * quiet NaN).
- *
- * @param f Single-precision float.
- * @return 1 if float is NaN, 0 otherwise.
- */
-int is_float32_nan(float32 f)
-{
-	/* NaN : exp = 0xff and nonzero fraction */
-	return ((f.parts.exp == 0xFF) && (f.parts.fraction));
-}
-
-/**
- * Determines whether the given float represents NaN (either signalling NaN or
- * quiet NaN).
- *
- * @param d Double-precision float.
- * @return 1 if float is NaN, 0 otherwise.
- */
-int is_float64_nan(float64 d)
-{
-	/* NaN : exp = 0x7ff and nonzero fraction */
-	return ((d.parts.exp == 0x7FF) && (d.parts.fraction));
-}
-
-/**
- * Determines whether the given float represents NaN (either signalling NaN or
- * quiet NaN).
- *
- * @param ld Quadruple-precision float.
- * @return 1 if float is NaN, 0 otherwise.
- */
-int is_float128_nan(float128 ld)
-{
-	/* NaN : exp = 0x7fff and nonzero fraction */
-	return ((ld.parts.exp == 0x7FF) &&
-	    !eq128(ld.parts.frac_hi, ld.parts.frac_lo, 0x0ll, 0x0ll));
-}
-
-/**
- * Determines whether the given float represents signalling NaN.
- *
- * @param f Single-precision float.
- * @return 1 if float is signalling NaN, 0 otherwise.
- */
-int is_float32_signan(float32 f)
-{
-	/*
-	 * SigNaN : exp = 0xff and fraction = 0xxxxx..x (binary),
-	 * where at least one x is nonzero
-	 */
-	return ((f.parts.exp == 0xFF) &&
-	    (f.parts.fraction < 0x400000) && (f.parts.fraction));
-}
-
-/**
- * Determines whether the given float represents signalling NaN.
- *
- * @param d Double-precision float.
- * @return 1 if float is signalling NaN, 0 otherwise.
- */
-int is_float64_signan(float64 d)
-{
-	/*
-	 * SigNaN : exp = 0x7ff and fraction = 0xxxxx..x (binary),
-	 * where at least one x is nonzero
-	 */
-	return ((d.parts.exp == 0x7FF) &&
-	    (d.parts.fraction) && (d.parts.fraction < 0x8000000000000ll));
-}
-
-/**
- * Determines whether the given float represents signalling NaN.
- *
- * @param ld Quadruple-precision float.
- * @return 1 if float is signalling NaN, 0 otherwise.
- */
-int is_float128_signan(float128 ld)
-{
-	/*
-	 * SigNaN : exp = 0x7fff and fraction = 0xxxxx..x (binary),
-	 * where at least one x is nonzero
-	 */
-	return ((ld.parts.exp == 0x7FFF) &&
-	    (ld.parts.frac_hi || ld.parts.frac_lo) &&
-	    lt128(ld.parts.frac_hi, ld.parts.frac_lo, 0x800000000000ll, 0x0ll));
-
-}
-
-/**
- * Determines whether the given float represents positive or negative infinity.
- *
- * @param f Single-precision float.
- * @return 1 if float is infinite, 0 otherwise.
- */
-int is_float32_infinity(float32 f)
-{
-	/* NaN : exp = 0x7ff and zero fraction */
-	return ((f.parts.exp == 0xFF) && (f.parts.fraction == 0x0));
-}
-
-/**
- * Determines whether the given float represents positive or negative infinity.
- *
- * @param d Double-precision float.
- * @return 1 if float is infinite, 0 otherwise.
- */
-int is_float64_infinity(float64 d)
-{
-	/* NaN : exp = 0x7ff and zero fraction */
-	return ((d.parts.exp == 0x7FF) && (d.parts.fraction == 0x0));
-}
-
-/**
- * Determines whether the given float represents positive or negative infinity.
- *
- * @param ld Quadruple-precision float.
- * @return 1 if float is infinite, 0 otherwise.
- */
-int is_float128_infinity(float128 ld)
-{
-	/* NaN : exp = 0x7fff and zero fraction */
-	return ((ld.parts.exp == 0x7FFF) &&
-	    eq128(ld.parts.frac_hi, ld.parts.frac_lo, 0x0ll, 0x0ll));
-}
-
-/**
- * Determines whether the given float represents positive or negative zero.
- *
- * @param f Single-precision float.
- * @return 1 if float is zero, 0 otherwise.
- */
-int is_float32_zero(float32 f)
-{
-	return (((f.bin) & 0x7FFFFFFF) == 0);
-}
-
-/**
- * Determines whether the given float represents positive or negative zero.
- *
- * @param d Double-precision float.
- * @return 1 if float is zero, 0 otherwise.
- */
-int is_float64_zero(float64 d)
-{
-	return (((d.bin) & 0x7FFFFFFFFFFFFFFFll) == 0);
-}
-
-/**
- * Determines whether the given float represents positive or negative zero.
- *
- * @param ld Quadruple-precision float.
- * @return 1 if float is zero, 0 otherwise.
- */
-int is_float128_zero(float128 ld)
-{
-	uint64_t tmp_hi;
-	uint64_t tmp_lo;
-
-	and128(ld.bin.hi, ld.bin.lo,
-	    0x7FFFFFFFFFFFFFFFll, 0xFFFFFFFFFFFFFFFFll, &tmp_hi, &tmp_lo);
-
-	return eq128(tmp_hi, tmp_lo, 0x0ll, 0x0ll);
-}
-
-/**
- * Determine whether two floats are equal. NaNs are not recognized.
- *
- * @a First single-precision operand.
- * @b Second single-precision operand.
- * @return 1 if both floats are equal, 0 otherwise.
- */
-int is_float32_eq(float32 a, float32 b)
-{
-	/* a equals to b or both are zeros (with any sign) */
-	return ((a.bin == b.bin) ||
-	    (((a.bin | b.bin) & 0x7FFFFFFF) == 0));
-}
-
-/**
- * Determine whether two floats are equal. NaNs are not recognized.
- *
- * @a First double-precision operand.
- * @b Second double-precision operand.
- * @return 1 if both floats are equal, 0 otherwise.
- */
-int is_float64_eq(float64 a, float64 b)
-{
-	/* a equals to b or both are zeros (with any sign) */
-	return ((a.bin == b.bin) ||
-	    (((a.bin | b.bin) & 0x7FFFFFFFFFFFFFFFll) == 0));
-}
-
-/**
- * Determine whether two floats are equal. NaNs are not recognized.
- *
- * @a First quadruple-precision operand.
- * @b Second quadruple-precision operand.
- * @return 1 if both floats are equal, 0 otherwise.
- */
-int is_float128_eq(float128 a, float128 b)
-{
-	uint64_t tmp_hi;
-	uint64_t tmp_lo;
-
-	/* both are zeros (with any sign) */
-	or128(a.bin.hi, a.bin.lo,
-	    b.bin.hi, b.bin.lo, &tmp_hi, &tmp_lo);
-	and128(tmp_hi, tmp_lo,
-	    0x7FFFFFFFFFFFFFFFll, 0xFFFFFFFFFFFFFFFFll, &tmp_hi, &tmp_lo);
-	int both_zero = eq128(tmp_hi, tmp_lo, 0x0ll, 0x0ll);
-
-	/* a equals to b */
-	int are_equal = eq128(a.bin.hi, a.bin.lo, b.bin.hi, b.bin.lo);
-
-	return are_equal || both_zero;
-}
-
-/**
- * Lower-than comparison between two floats. NaNs are not recognized.
- *
- * @a First single-precision operand.
- * @b Second single-precision operand.
- * @return 1 if a is lower than b, 0 otherwise.
- */
-int is_float32_lt(float32 a, float32 b)
-{
-	if (((a.bin | b.bin) & 0x7FFFFFFF) == 0) {
-		/* +- zeroes */
-		return 0;
-	}
-
-	if ((a.parts.sign) && (b.parts.sign)) {
-		/* if both are negative, smaller is that with greater binary value */
-		return (a.bin > b.bin);
-	}
-
-	/*
-	 * lets negate signs - now will be positive numbers always
-	 * bigger than negative (first bit will be set for unsigned
-	 * integer comparison)
-	 */
-	a.parts.sign = !a.parts.sign;
-	b.parts.sign = !b.parts.sign;
-	return (a.bin < b.bin);
-}
-
-/**
- * Lower-than comparison between two floats. NaNs are not recognized.
- *
- * @a First double-precision operand.
- * @b Second double-precision operand.
- * @return 1 if a is lower than b, 0 otherwise.
- */
-int is_float64_lt(float64 a, float64 b)
-{
-	if (((a.bin | b.bin) & 0x7FFFFFFFFFFFFFFFll) == 0) {
-		/* +- zeroes */
-		return 0;
-	}
-
-	if ((a.parts.sign) && (b.parts.sign)) {
-		/* if both are negative, smaller is that with greater binary value */
-		return (a.bin > b.bin);
-	}
-
-	/*
-	 * lets negate signs - now will be positive numbers always
-	 * bigger than negative (first bit will be set for unsigned
-	 * integer comparison)
-	 */
-	a.parts.sign = !a.parts.sign;
-	b.parts.sign = !b.parts.sign;
-	return (a.bin < b.bin);
-}
-
-/**
- * Lower-than comparison between two floats. NaNs are not recognized.
- *
- * @a First quadruple-precision operand.
- * @b Second quadruple-precision operand.
- * @return 1 if a is lower than b, 0 otherwise.
- */
-int is_float128_lt(float128 a, float128 b)
-{
-	uint64_t tmp_hi;
-	uint64_t tmp_lo;
-
-	or128(a.bin.hi, a.bin.lo,
-	    b.bin.hi, b.bin.lo, &tmp_hi, &tmp_lo);
-	and128(tmp_hi, tmp_lo,
-	    0x7FFFFFFFFFFFFFFFll, 0xFFFFFFFFFFFFFFFFll, &tmp_hi, &tmp_lo);
-	if (eq128(tmp_hi, tmp_lo, 0x0ll, 0x0ll)) {
-		/* +- zeroes */
-		return 0;
-	}
-
-	if ((a.parts.sign) && (b.parts.sign)) {
-		/* if both are negative, smaller is that with greater binary value */
-		return lt128(b.bin.hi, b.bin.lo, a.bin.hi, a.bin.lo);
-	}
-
-	/*
-	 * lets negate signs - now will be positive numbers always
-	 * bigger than negative (first bit will be set for unsigned
-	 * integer comparison)
-	 */
-	a.parts.sign = !a.parts.sign;
-	b.parts.sign = !b.parts.sign;
-	return lt128(a.bin.hi, a.bin.lo, b.bin.hi, b.bin.lo);
-}
-
-/**
- * Greater-than comparison between two floats. NaNs are not recognized.
- *
- * @a First single-precision operand.
- * @b Second single-precision operand.
- * @return 1 if a is greater than b, 0 otherwise.
- */
-int is_float32_gt(float32 a, float32 b)
-{
-	if (((a.bin | b.bin) & 0x7FFFFFFF) == 0) {
-		/* zeroes are equal with any sign */
-		return 0;
-	}
-
-	if ((a.parts.sign) && (b.parts.sign)) {
-		/* if both are negative, greater is that with smaller binary value */
-		return (a.bin < b.bin);
-	}
-
-	/*
-	 * lets negate signs - now will be positive numbers always
-	 * bigger than negative (first bit will be set for unsigned
-	 * integer comparison)
-	 */
-	a.parts.sign = !a.parts.sign;
-	b.parts.sign = !b.parts.sign;
-	return (a.bin > b.bin);
-}
-
-/**
- * Greater-than comparison between two floats. NaNs are not recognized.
- *
- * @a First double-precision operand.
- * @b Second double-precision operand.
- * @return 1 if a is greater than b, 0 otherwise.
- */
-int is_float64_gt(float64 a, float64 b)
-{
-	if (((a.bin | b.bin) & 0x7FFFFFFFFFFFFFFFll) == 0) {
-		/* zeroes are equal with any sign */
-		return 0;
-	}
-
-	if ((a.parts.sign) && (b.parts.sign)) {
-		/* if both are negative, greater is that with smaller binary value */
-		return (a.bin < b.bin);
-	}
-
-	/*
-	 * lets negate signs - now will be positive numbers always
-	 * bigger than negative (first bit will be set for unsigned
-	 * integer comparison)
-	 */
-	a.parts.sign = !a.parts.sign;
-	b.parts.sign = !b.parts.sign;
-	return (a.bin > b.bin);
-}
-
-/**
- * Greater-than comparison between two floats. NaNs are not recognized.
- *
- * @a First quadruple-precision operand.
- * @b Second quadruple-precision operand.
- * @return 1 if a is greater than b, 0 otherwise.
- */
-int is_float128_gt(float128 a, float128 b)
-{
-	uint64_t tmp_hi;
-	uint64_t tmp_lo;
-
-	or128(a.bin.hi, a.bin.lo,
-	    b.bin.hi, b.bin.lo, &tmp_hi, &tmp_lo);
-	and128(tmp_hi, tmp_lo,
-	    0x7FFFFFFFFFFFFFFFll, 0xFFFFFFFFFFFFFFFFll, &tmp_hi, &tmp_lo);
-	if (eq128(tmp_hi, tmp_lo, 0x0ll, 0x0ll)) {
-		/* zeroes are equal with any sign */
-		return 0;
-	}
-
-	if ((a.parts.sign) && (b.parts.sign)) {
-		/* if both are negative, greater is that with smaller binary value */
-		return lt128(a.bin.hi, a.bin.lo, b.bin.hi, b.bin.lo);
-	}
-
-	/*
-	 * lets negate signs - now will be positive numbers always
-	 * bigger than negative (first bit will be set for unsigned
-	 * integer comparison)
-	 */
-	a.parts.sign = !a.parts.sign;
-	b.parts.sign = !b.parts.sign;
-	return lt128(b.bin.hi, b.bin.lo, a.bin.hi, a.bin.lo);
-}
-
-#ifdef float32_t
-
-int __gtsf2(float32_t a, float32_t b)
-{
-	float32_u ua;
-	ua.val = a;
-
-	float32_u ub;
-	ub.val = b;
-
-	if ((is_float32_nan(ua.data)) || (is_float32_nan(ub.data))) {
-		// TODO: sigNaNs
-		return -1;
-	}
-
-	if (is_float32_gt(ua.data, ub.data))
-		return 1;
-
-	return 0;
-}
-
-int __gesf2(float32_t a, float32_t b)
-{
-	float32_u ua;
-	ua.val = a;
-
-	float32_u ub;
-	ub.val = b;
-
-	if ((is_float32_nan(ua.data)) || (is_float32_nan(ub.data))) {
-		// TODO: sigNaNs
-		return -1;
-	}
-
-	if (is_float32_eq(ua.data, ub.data))
-		return 0;
-
-	if (is_float32_gt(ua.data, ub.data))
-		return 1;
-
-	return -1;
-}
-
-int __ltsf2(float32_t a, float32_t b)
-{
-	float32_u ua;
-	ua.val = a;
-
-	float32_u ub;
-	ub.val = b;
-
-	if ((is_float32_nan(ua.data)) || (is_float32_nan(ub.data))) {
-		// TODO: sigNaNs
-		return 1;
-	}
-
-	if (is_float32_lt(ua.data, ub.data))
-		return -1;
-
-	return 0;
-}
-
-int __lesf2(float32_t a, float32_t b)
-{
-	float32_u ua;
-	ua.val = a;
-
-	float32_u ub;
-	ub.val = b;
-
-	if ((is_float32_nan(ua.data)) || (is_float32_nan(ub.data))) {
-		// TODO: sigNaNs
-		return 1;
-	}
-
-	if (is_float32_eq(ua.data, ub.data))
-		return 0;
-
-	if (is_float32_lt(ua.data, ub.data))
-		return -1;
-
-	return 1;
-}
-
-int __eqsf2(float32_t a, float32_t b)
-{
-	float32_u ua;
-	ua.val = a;
-
-	float32_u ub;
-	ub.val = b;
-
-	if ((is_float32_nan(ua.data)) || (is_float32_nan(ub.data))) {
-		// TODO: sigNaNs
-		return 1;
-	}
-
-	return is_float32_eq(ua.data, ub.data) - 1;
-}
-
-int __nesf2(float32_t a, float32_t b)
-{
-	/* Strange, but according to GCC documentation */
-	return __eqsf2(a, b);
-}
-
-int __cmpsf2(float32_t a, float32_t b)
-{
-	float32_u ua;
-	ua.val = a;
-
-	float32_u ub;
-	ub.val = b;
-
-	if ((is_float32_nan(ua.data)) || (is_float32_nan(ub.data))) {
-		/* No special constant for unordered - maybe signaled? */
-		return 1;
-	}
-
-	if (is_float32_eq(ua.data, ub.data))
-		return 0;
-
-	if (is_float32_lt(ua.data, ub.data))
-		return -1;
-
-	return 1;
-}
-
-int __unordsf2(float32_t a, float32_t b)
-{
-	float32_u ua;
-	ua.val = a;
-
-	float32_u ub;
-	ub.val = b;
-
-	return ((is_float32_nan(ua.data)) || (is_float32_nan(ub.data)));
-}
-
-int __aeabi_fcmpgt(float32_t a, float32_t b)
-{
-	float32_u ua;
-	ua.val = a;
-
-	float32_u ub;
-	ub.val = b;
-
-	if ((is_float32_nan(ua.data)) || (is_float32_nan(ub.data))) {
-		// TODO: sigNaNs
-		return 0;
-	}
-
-	if (is_float32_gt(ua.data, ub.data))
-		return 1;
-
-	return 0;
-}
-
-int __aeabi_fcmplt(float32_t a, float32_t b)
-{
-	float32_u ua;
-	ua.val = a;
-
-	float32_u ub;
-	ub.val = b;
-
-	if ((is_float32_nan(ua.data)) || (is_float32_nan(ub.data))) {
-		// TODO: sigNaNs
-		return 0;
-	}
-
-	if (is_float32_lt(ua.data, ub.data))
-		return 1;
-
-	return 0;
-}
-
-int __aeabi_fcmpge(float32_t a, float32_t b)
-{
-	float32_u ua;
-	ua.val = a;
-
-	float32_u ub;
-	ub.val = b;
-
-	if ((is_float32_nan(ua.data)) || (is_float32_nan(ub.data))) {
-		// TODO: sigNaNs
-		return 0;
-	}
-
-	if (is_float32_eq(ua.data, ub.data))
-		return 1;
-
-	if (is_float32_gt(ua.data, ub.data))
-		return 1;
-
-	return 0;
-}
-
-int __aeabi_fcmple(float32_t a, float32_t b)
-{
-	float32_u ua;
-	ua.val = a;
-
-	float32_u ub;
-	ub.val = b;
-
-	if ((is_float32_nan(ua.data)) || (is_float32_nan(ub.data))) {
-		// TODO: sigNaNs
-		return 0;
-	}
-
-	if (is_float32_eq(ua.data, ub.data))
-		return 1;
-
-	if (is_float32_lt(ua.data, ub.data))
-		return 1;
-
-	return 0;
-}
-
-int __aeabi_fcmpeq(float32_t a, float32_t b)
-{
-	float32_u ua;
-	ua.val = a;
-
-	float32_u ub;
-	ub.val = b;
-
-	if ((is_float32_nan(ua.data)) || (is_float32_nan(ub.data))) {
-		// TODO: sigNaNs
-		return 0;
-	}
-
-	return is_float32_eq(ua.data, ub.data);
-}
-
-int __aeabi_fcmpun(float32_t a, float32_t b)
-{
-	float32_u ua;
-	ua.val = a;
-
-	float32_u ub;
-	ub.val = b;
-
-	// TODO: sigNaNs
-	return is_float32_nan(ua.data) || is_float32_nan(ub.data);
-}
-
-#endif
-
-#ifdef float64_t
-
-int __gtdf2(float64_t a, float64_t b)
-{
-	float64_u ua;
-	ua.val = a;
-
-	float64_u ub;
-	ub.val = b;
-
-	if ((is_float64_nan(ua.data)) || (is_float64_nan(ub.data))) {
-		// TODO: sigNaNs
-		return -1;
-	}
-
-	if (is_float64_gt(ua.data, ub.data))
-		return 1;
-
-	return 0;
-}
-
-int __gedf2(float64_t a, float64_t b)
-{
-	float64_u ua;
-	ua.val = a;
-
-	float64_u ub;
-	ub.val = b;
-
-	if ((is_float64_nan(ua.data)) || (is_float64_nan(ub.data))) {
-		// TODO: sigNaNs
-		return -1;
-	}
-
-	if (is_float64_eq(ua.data, ub.data))
-		return 0;
-
-	if (is_float64_gt(ua.data, ub.data))
-		return 1;
-
-	return -1;
-}
-
-int __ltdf2(float64_t a, float64_t b)
-{
-	float64_u ua;
-	ua.val = a;
-
-	float64_u ub;
-	ub.val = b;
-
-	if ((is_float64_nan(ua.data)) || (is_float64_nan(ub.data))) {
-		// TODO: sigNaNs
-		return 1;
-	}
-
-	if (is_float64_lt(ua.data, ub.data))
-		return -1;
-
-	return 0;
-}
-
-int __ledf2(float64_t a, float64_t b)
-{
-	float64_u ua;
-	ua.val = a;
-
-	float64_u ub;
-	ub.val = b;
-
-	if ((is_float64_nan(ua.data)) || (is_float64_nan(ub.data))) {
-		// TODO: sigNaNs
-		return 1;
-	}
-
-	if (is_float64_eq(ua.data, ub.data))
-		return 0;
-
-	if (is_float64_lt(ua.data, ub.data))
-		return -1;
-
-	return 1;
-}
-
-int __eqdf2(float64_t a, float64_t b)
-{
-	float64_u ua;
-	ua.val = a;
-
-	float64_u ub;
-	ub.val = b;
-
-	if ((is_float64_nan(ua.data)) || (is_float64_nan(ub.data))) {
-		// TODO: sigNaNs
-		return 1;
-	}
-
-	return is_float64_eq(ua.data, ub.data) - 1;
-}
-
-int __nedf2(float64_t a, float64_t b)
-{
-	/* Strange, but according to GCC documentation */
-	return __eqdf2(a, b);
-}
-
-int __cmpdf2(float64_t a, float64_t b)
-{
-	float64_u ua;
-	ua.val = a;
-
-	float64_u ub;
-	ub.val = b;
-
-	if ((is_float64_nan(ua.data)) || (is_float64_nan(ub.data))) {
-		/* No special constant for unordered - maybe signaled? */
-		return 1;
-	}
-
-	if (is_float64_eq(ua.data, ub.data))
-		return 0;
-
-	if (is_float64_lt(ua.data, ub.data))
-		return -1;
-
-	return 1;
-}
-
-int __unorddf2(float64_t a, float64_t b)
-{
-	float64_u ua;
-	ua.val = a;
-
-	float64_u ub;
-	ub.val = b;
-
-	return ((is_float64_nan(ua.data)) || (is_float64_nan(ub.data)));
-}
-
-int __aeabi_dcmplt(float64_t a, float64_t b)
-{
-	float64_u ua;
-	ua.val = a;
-
-	float64_u ub;
-	ub.val = b;
-
-	if ((is_float64_nan(ua.data)) || (is_float64_nan(ub.data))) {
-		// TODO: sigNaNs
-		return 0;
-	}
-
-	if (is_float64_lt(ua.data, ub.data))
-		return 1;
-
-	return 0;
-}
-
-int __aeabi_dcmpeq(float64_t a, float64_t b)
-{
-	float64_u ua;
-	ua.val = a;
-
-	float64_u ub;
-	ub.val = b;
-
-	if ((is_float64_nan(ua.data)) || (is_float64_nan(ub.data))) {
-		// TODO: sigNaNs
-		return 0;
-	}
-
-	return is_float64_eq(ua.data, ub.data);
-}
-
-int __aeabi_dcmpgt(float64_t a, float64_t b)
-{
-	float64_u ua;
-	ua.val = a;
-
-	float64_u ub;
-	ub.val = b;
-
-	if ((is_float64_nan(ua.data)) || (is_float64_nan(ub.data))) {
-		// TODO: sigNaNs
-		return 0;
-	}
-
-	if (is_float64_gt(ua.data, ub.data))
-		return 1;
-
-	return 0;
-}
-
-int __aeabi_dcmpge(float64_t a, float64_t b)
-{
-	float64_u ua;
-	ua.val = a;
-
-	float64_u ub;
-	ub.val = b;
-
-	if ((is_float64_nan(ua.data)) || (is_float64_nan(ub.data))) {
-		// TODO: sigNaNs
-		return 0;
-	}
-
-	if (is_float64_eq(ua.data, ub.data))
-		return 1;
-
-	if (is_float64_gt(ua.data, ub.data))
-		return 1;
-
-	return 0;
-}
-
-int __aeabi_dcmple(float64_t a, float64_t b)
-{
-	float64_u ua;
-	ua.val = a;
-
-	float64_u ub;
-	ub.val = b;
-
-	if ((is_float64_nan(ua.data)) || (is_float64_nan(ub.data))) {
-		// TODO: sigNaNs
-		return 0;
-	}
-
-	if (is_float64_eq(ua.data, ub.data))
-		return 1;
-
-	if (is_float64_lt(ua.data, ub.data))
-		return 1;
-
-	return 0;
-}
-
-int __aeabi_dcmpun(float64_t a, float64_t b)
-{
-	float64_u ua;
-	ua.val = a;
-
-	float64_u ub;
-	ub.val = b;
-
-	// TODO: sigNaNs
-	return is_float64_nan(ua.data) || is_float64_nan(ub.data);
-}
-
-#endif
-
-#ifdef float128_t
-
-int __gttf2(float128_t a, float128_t b)
-{
-	float128_u ua;
-	ua.val = a;
-
-	float128_u ub;
-	ub.val = b;
-
-	if ((is_float128_nan(ua.data)) || (is_float128_nan(ub.data))) {
-		// TODO: sigNaNs
-		return -1;
-	}
-
-	if (is_float128_gt(ua.data, ub.data))
-		return 1;
-
-	return 0;
-}
-
-int __getf2(float128_t a, float128_t b)
-{
-	float128_u ua;
-	ua.val = a;
-
-	float128_u ub;
-	ub.val = b;
-
-	if ((is_float128_nan(ua.data)) || (is_float128_nan(ub.data))) {
-		// TODO: sigNaNs
-		return -1;
-	}
-
-	if (is_float128_eq(ua.data, ub.data))
-		return 0;
-
-	if (is_float128_gt(ua.data, ub.data))
-		return 1;
-
-	return -1;
-}
-
-int __lttf2(float128_t a, float128_t b)
-{
-	float128_u ua;
-	ua.val = a;
-
-	float128_u ub;
-	ub.val = b;
-
-	if ((is_float128_nan(ua.data)) || (is_float128_nan(ub.data))) {
-		// TODO: sigNaNs
-		return 1;
-	}
-
-	if (is_float128_lt(ua.data, ub.data))
-		return -1;
-
-	return 0;
-}
-
-int __letf2(float128_t a, float128_t b)
-{
-	float128_u ua;
-	ua.val = a;
-
-	float128_u ub;
-	ub.val = b;
-
-	if ((is_float128_nan(ua.data)) || (is_float128_nan(ub.data))) {
-		// TODO: sigNaNs
-		return 1;
-	}
-
-	if (is_float128_eq(ua.data, ub.data))
-		return 0;
-
-	if (is_float128_lt(ua.data, ub.data))
-		return -1;
-
-	return 1;
-}
-
-int __eqtf2(float128_t a, float128_t b)
-{
-	float128_u ua;
-	ua.val = a;
-
-	float128_u ub;
-	ub.val = b;
-
-	if ((is_float128_nan(ua.data)) || (is_float128_nan(ub.data))) {
-		// TODO: sigNaNs
-		return 1;
-	}
-
-	return is_float128_eq(ua.data, ub.data) - 1;
-}
-
-int __netf2(float128_t a, float128_t b)
-{
-	/* Strange, but according to GCC documentation */
-	return __eqtf2(a, b);
-}
-
-int __cmptf2(float128_t a, float128_t b)
-{
-	float128_u ua;
-	ua.val = a;
-
-	float128_u ub;
-	ub.val = b;
-
-	if ((is_float128_nan(ua.data)) || (is_float128_nan(ub.data))) {
-		/* No special constant for unordered - maybe signaled? */
-		return 1;
-	}
-
-	if (is_float128_eq(ua.data, ub.data))
-		return 0;
-
-	if (is_float128_lt(ua.data, ub.data))
-		return -1;
-
-	return 1;
-}
-
-int __unordtf2(float128_t a, float128_t b)
-{
-	float128_u ua;
-	ua.val = a;
-
-	float128_u ub;
-	ub.val = b;
-
-	return ((is_float128_nan(ua.data)) || (is_float128_nan(ub.data)));
-}
-
-int _Qp_cmp(float128_t *a, float128_t *b)
-{
-	float128_u ua;
-	ua.val = *a;
-
-	float128_u ub;
-	ub.val = *b;
-
-	if ((is_float128_nan(ua.data)) || (is_float128_nan(ub.data)))
-		return 3;
-
-	if (is_float128_eq(ua.data, ub.data))
-		return 0;
-
-	if (is_float128_lt(ua.data, ub.data))
-		return 1;
-
-	return 2;
-}
-
-int _Qp_cmpe(float128_t *a, float128_t *b)
-{
-	/* Strange, but according to SPARC Compliance Definition */
-	return _Qp_cmp(a, b);
-}
-
-int _Qp_fgt(float128_t *a, float128_t *b)
-{
-	float128_u ua;
-	ua.val = *a;
-
-	float128_u ub;
-	ub.val = *b;
-
-	if ((is_float128_nan(ua.data)) || (is_float128_nan(ub.data)))
-		return 0;
-
-	return is_float128_gt(ua.data, ub.data);
-}
-
-int _Qp_fge(float128_t *a, float128_t *b)
-{
-	float128_u ua;
-	ua.val = *a;
-
-	float128_u ub;
-	ub.val = *b;
-
-	if ((is_float128_nan(ua.data)) || (is_float128_nan(ub.data)))
-		return 0;
-
-	return is_float128_eq(ua.data, ub.data) ||
-	    is_float128_gt(ua.data, ub.data);
-}
-
-int _Qp_flt(float128_t *a, float128_t *b)
-{
-	float128_u ua;
-	ua.val = *a;
-
-	float128_u ub;
-	ub.val = *b;
-
-	if ((is_float128_nan(ua.data)) || (is_float128_nan(ub.data)))
-		return 0;
-
-	return is_float128_lt(ua.data, ub.data);
-}
-
-int _Qp_fle(float128_t *a, float128_t *b)
-{
-	float128_u ua;
-	ua.val = *a;
-
-	float128_u ub;
-	ub.val = *b;
-
-	if ((is_float128_nan(ua.data)) || (is_float128_nan(ub.data)))
-		return 0;
-
-	return is_float128_eq(ua.data, ub.data) ||
-	    is_float128_lt(ua.data, ub.data);
-}
-
-int _Qp_feq(float128_t *a, float128_t *b)
-{
-	float128_u ua;
-	ua.val = *a;
-
-	float128_u ub;
-	ub.val = *b;
-
-	if ((is_float128_nan(ua.data)) || (is_float128_nan(ub.data)))
-		return 0;
-
-	return is_float128_eq(ua.data, ub.data);
-}
-
-int _Qp_fne(float128_t *a, float128_t *b)
-{
-	float128_u ua;
-	ua.val = *a;
-
-	float128_u ub;
-	ub.val = *b;
-
-	if ((is_float128_nan(ua.data)) || (is_float128_nan(ub.data)))
-		return 0;
-
-	return !is_float128_eq(ua.data, ub.data);
-}
-
-#endif
-
-/** @}
- */
Index: uspace/lib/softfloat/comparison.h
===================================================================
--- uspace/lib/softfloat/comparison.h	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,138 +1,0 @@
-/*
- * Copyright (c) 2005 Josef Cejka
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softfloat
- * @{
- */
-/** @file Comparison functions.
- */
-
-#ifndef __COMPARISON_H__
-#define __COMPARISON_H__
-
-#include <mathtypes.h>
-
-extern int is_float32_nan(float32);
-extern int is_float32_signan(float32);
-
-extern int is_float32_infinity(float32);
-extern int is_float32_zero(float32);
-
-extern int is_float32_eq(float32, float32);
-extern int is_float32_lt(float32, float32);
-extern int is_float32_gt(float32, float32);
-
-extern int is_float64_nan(float64);
-extern int is_float64_signan(float64);
-
-extern int is_float64_infinity(float64);
-extern int is_float64_zero(float64);
-
-extern int is_float64_eq(float64, float64);
-extern int is_float64_lt(float64, float64);
-extern int is_float64_gt(float64, float64);
-
-extern int is_float96_nan(float96);
-extern int is_float96_signan(float96);
-
-extern int is_float96_infinity(float96);
-extern int is_float96_zero(float96);
-
-extern int is_float96_eq(float96, float96);
-extern int is_float96_lt(float96, float96);
-extern int is_float96_gt(float96, float96);
-
-extern int is_float128_nan(float128);
-extern int is_float128_signan(float128);
-
-extern int is_float128_infinity(float128);
-extern int is_float128_zero(float128);
-
-extern int is_float128_eq(float128, float128);
-extern int is_float128_lt(float128, float128);
-extern int is_float128_gt(float128, float128);
-
-#ifdef float32_t
-extern int __gtsf2(float32_t, float32_t);
-extern int __gesf2(float32_t, float32_t);
-extern int __ltsf2(float32_t, float32_t);
-extern int __lesf2(float32_t, float32_t);
-extern int __eqsf2(float32_t, float32_t);
-extern int __nesf2(float32_t, float32_t);
-extern int __cmpsf2(float32_t, float32_t);
-extern int __unordsf2(float32_t, float32_t);
-extern int __aeabi_fcmpgt(float32_t, float32_t);
-extern int __aeabi_fcmplt(float32_t, float32_t);
-extern int __aeabi_fcmpge(float32_t, float32_t);
-extern int __aeabi_fcmple(float32_t, float32_t);
-extern int __aeabi_fcmpeq(float32_t, float32_t);
-extern int __aeabi_fcmpun(float32_t, float32_t);
-#endif
-
-#ifdef float64_t
-extern int __gtdf2(float64_t, float64_t);
-extern int __gedf2(float64_t, float64_t);
-extern int __ltdf2(float64_t, float64_t);
-extern int __ledf2(float64_t, float64_t);
-extern int __eqdf2(float64_t, float64_t);
-extern int __nedf2(float64_t, float64_t);
-extern int __cmpdf2(float64_t, float64_t);
-extern int __unorddf2(float64_t, float64_t);
-extern int __aeabi_dcmplt(float64_t, float64_t);
-extern int __aeabi_dcmpeq(float64_t, float64_t);
-extern int __aeabi_dcmpgt(float64_t, float64_t);
-extern int __aeabi_dcmpge(float64_t, float64_t);
-extern int __aeabi_dcmple(float64_t, float64_t);
-extern int __aeabi_dcmpun(float64_t, float64_t);
-#endif
-
-#ifdef float128_t
-extern int __gttf2(float128_t, float128_t);
-extern int __getf2(float128_t, float128_t);
-extern int __lttf2(float128_t, float128_t);
-extern int __letf2(float128_t, float128_t);
-extern int __eqtf2(float128_t, float128_t);
-extern int __netf2(float128_t, float128_t);
-extern int __cmptf2(float128_t, float128_t);
-extern int __unordtf2(float128_t, float128_t);
-extern int _Qp_cmp(float128_t *, float128_t *);
-extern int _Qp_cmpe(float128_t *, float128_t *);
-extern int _Qp_fgt(float128_t *, float128_t *);
-extern int _Qp_fge(float128_t *, float128_t *);
-extern int _Qp_flt(float128_t *, float128_t *);
-extern int _Qp_fle(float128_t *, float128_t *);
-extern int _Qp_feq(float128_t *, float128_t *);
-extern int _Qp_fne(float128_t *, float128_t *);
-
-#endif
-
-#endif
-
-/** @}
- */
Index: uspace/lib/softfloat/conversion.c
===================================================================
--- uspace/lib/softfloat/conversion.c	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,1507 +1,0 @@
-/*
- * Copyright (c) 2005 Josef Cejka
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softfloat
- * @{
- */
-/** @file Conversion of precision and conversion between integers and floats.
- */
-
-#include "conversion.h"
-#include "comparison.h"
-#include "common.h"
-
-float64 float32_to_float64(float32 a)
-{
-	float64 result;
-	uint64_t frac;
-
-	result.parts.sign = a.parts.sign;
-	result.parts.fraction = a.parts.fraction;
-	result.parts.fraction <<= (FLOAT64_FRACTION_SIZE - FLOAT32_FRACTION_SIZE);
-
-	if ((is_float32_infinity(a)) || (is_float32_nan(a))) {
-		result.parts.exp = FLOAT64_MAX_EXPONENT;
-		// TODO; check if its correct for SigNaNs
-		return result;
-	}
-
-	result.parts.exp = a.parts.exp + ((int) FLOAT64_BIAS - FLOAT32_BIAS);
-	if (a.parts.exp == 0) {
-		/* normalize denormalized numbers */
-
-		if (result.parts.fraction == 0) { /* fix zero */
-			result.parts.exp = 0;
-			return result;
-		}
-
-		frac = result.parts.fraction;
-
-		while (!(frac & FLOAT64_HIDDEN_BIT_MASK)) {
-			frac <<= 1;
-			--result.parts.exp;
-		}
-
-		++result.parts.exp;
-		result.parts.fraction = frac;
-	}
-
-	return result;
-}
-
-float128 float32_to_float128(float32 a)
-{
-	float128 result;
-	uint64_t frac_hi, frac_lo;
-	uint64_t tmp_hi, tmp_lo;
-
-	result.parts.sign = a.parts.sign;
-	result.parts.frac_hi = 0;
-	result.parts.frac_lo = a.parts.fraction;
-	lshift128(result.parts.frac_hi, result.parts.frac_lo,
-	    (FLOAT128_FRACTION_SIZE - FLOAT32_FRACTION_SIZE),
-	    &frac_hi, &frac_lo);
-	result.parts.frac_hi = frac_hi;
-	result.parts.frac_lo = frac_lo;
-
-	if ((is_float32_infinity(a)) || (is_float32_nan(a))) {
-		result.parts.exp = FLOAT128_MAX_EXPONENT;
-		// TODO; check if its correct for SigNaNs
-		return result;
-	}
-
-	result.parts.exp = a.parts.exp + ((int) FLOAT128_BIAS - FLOAT32_BIAS);
-	if (a.parts.exp == 0) {
-		/* normalize denormalized numbers */
-
-		if (eq128(result.parts.frac_hi,
-		    result.parts.frac_lo, 0x0ll, 0x0ll)) { /* fix zero */
-			result.parts.exp = 0;
-			return result;
-		}
-
-		frac_hi = result.parts.frac_hi;
-		frac_lo = result.parts.frac_lo;
-
-		and128(frac_hi, frac_lo,
-		    FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
-		    &tmp_hi, &tmp_lo);
-		while (!lt128(0x0ll, 0x0ll, tmp_hi, tmp_lo)) {
-			lshift128(frac_hi, frac_lo, 1, &frac_hi, &frac_lo);
-			--result.parts.exp;
-		}
-
-		++result.parts.exp;
-		result.parts.frac_hi = frac_hi;
-		result.parts.frac_lo = frac_lo;
-	}
-
-	return result;
-}
-
-float128 float64_to_float128(float64 a)
-{
-	float128 result;
-	uint64_t frac_hi, frac_lo;
-	uint64_t tmp_hi, tmp_lo;
-
-	result.parts.sign = a.parts.sign;
-	result.parts.frac_hi = 0;
-	result.parts.frac_lo = a.parts.fraction;
-	lshift128(result.parts.frac_hi, result.parts.frac_lo,
-	    (FLOAT128_FRACTION_SIZE - FLOAT64_FRACTION_SIZE),
-	    &frac_hi, &frac_lo);
-	result.parts.frac_hi = frac_hi;
-	result.parts.frac_lo = frac_lo;
-
-	if ((is_float64_infinity(a)) || (is_float64_nan(a))) {
-		result.parts.exp = FLOAT128_MAX_EXPONENT;
-		// TODO; check if its correct for SigNaNs
-		return result;
-	}
-
-	result.parts.exp = a.parts.exp + ((int) FLOAT128_BIAS - FLOAT64_BIAS);
-	if (a.parts.exp == 0) {
-		/* normalize denormalized numbers */
-
-		if (eq128(result.parts.frac_hi,
-		    result.parts.frac_lo, 0x0ll, 0x0ll)) { /* fix zero */
-			result.parts.exp = 0;
-			return result;
-		}
-
-		frac_hi = result.parts.frac_hi;
-		frac_lo = result.parts.frac_lo;
-
-		and128(frac_hi, frac_lo,
-		    FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
-		    &tmp_hi, &tmp_lo);
-		while (!lt128(0x0ll, 0x0ll, tmp_hi, tmp_lo)) {
-			lshift128(frac_hi, frac_lo, 1, &frac_hi, &frac_lo);
-			--result.parts.exp;
-		}
-
-		++result.parts.exp;
-		result.parts.frac_hi = frac_hi;
-		result.parts.frac_lo = frac_lo;
-	}
-
-	return result;
-}
-
-float32 float64_to_float32(float64 a)
-{
-	float32 result;
-	int32_t exp;
-	uint64_t frac;
-
-	result.parts.sign = a.parts.sign;
-
-	if (is_float64_nan(a)) {
-		result.parts.exp = FLOAT32_MAX_EXPONENT;
-
-		if (is_float64_signan(a)) {
-			/* set first bit of fraction nonzero */
-			result.parts.fraction = FLOAT32_HIDDEN_BIT_MASK >> 1;
-			return result;
-		}
-
-		/* fraction nonzero but its first bit is zero */
-		result.parts.fraction = 0x1;
-		return result;
-	}
-
-	if (is_float64_infinity(a)) {
-		result.parts.fraction = 0;
-		result.parts.exp = FLOAT32_MAX_EXPONENT;
-		return result;
-	}
-
-	exp = (int) a.parts.exp - FLOAT64_BIAS + FLOAT32_BIAS;
-
-	if (exp >= FLOAT32_MAX_EXPONENT) {
-		/* FIXME: overflow */
-		result.parts.fraction = 0;
-		result.parts.exp = FLOAT32_MAX_EXPONENT;
-		return result;
-	} else if (exp <= 0) {
-		/* underflow or denormalized */
-
-		result.parts.exp = 0;
-
-		exp *= -1;
-		if (exp > FLOAT32_FRACTION_SIZE) {
-			/* FIXME: underflow */
-			result.parts.fraction = 0;
-			return result;
-		}
-
-		/* denormalized */
-
-		frac = a.parts.fraction;
-		frac |= FLOAT64_HIDDEN_BIT_MASK; /* denormalize and set hidden bit */
-
-		frac >>= (FLOAT64_FRACTION_SIZE - FLOAT32_FRACTION_SIZE + 1);
-
-		while (exp > 0) {
-			--exp;
-			frac >>= 1;
-		}
-		result.parts.fraction = frac;
-
-		return result;
-	}
-
-	result.parts.exp = exp;
-	result.parts.fraction =
-	    a.parts.fraction >> (FLOAT64_FRACTION_SIZE - FLOAT32_FRACTION_SIZE);
-	return result;
-}
-
-float32 float128_to_float32(float128 a)
-{
-	float32 result;
-	int32_t exp;
-	uint64_t frac_hi, frac_lo;
-
-	result.parts.sign = a.parts.sign;
-
-	if (is_float128_nan(a)) {
-		result.parts.exp = FLOAT32_MAX_EXPONENT;
-
-		if (is_float128_signan(a)) {
-			/* set first bit of fraction nonzero */
-			result.parts.fraction = FLOAT32_HIDDEN_BIT_MASK >> 1;
-			return result;
-		}
-
-		/* fraction nonzero but its first bit is zero */
-		result.parts.fraction = 0x1;
-		return result;
-	}
-
-	if (is_float128_infinity(a)) {
-		result.parts.fraction = 0;
-		result.parts.exp = FLOAT32_MAX_EXPONENT;
-		return result;
-	}
-
-	exp = (int) a.parts.exp - FLOAT128_BIAS + FLOAT32_BIAS;
-
-	if (exp >= FLOAT32_MAX_EXPONENT) {
-		/* FIXME: overflow */
-		result.parts.fraction = 0;
-		result.parts.exp = FLOAT32_MAX_EXPONENT;
-		return result;
-	} else if (exp <= 0) {
-		/* underflow or denormalized */
-
-		result.parts.exp = 0;
-
-		exp *= -1;
-		if (exp > FLOAT32_FRACTION_SIZE) {
-			/* FIXME: underflow */
-			result.parts.fraction = 0;
-			return result;
-		}
-
-		/* denormalized */
-
-		frac_hi = a.parts.frac_hi;
-		frac_lo = a.parts.frac_lo;
-
-		/* denormalize and set hidden bit */
-		frac_hi |= FLOAT128_HIDDEN_BIT_MASK_HI;
-
-		rshift128(frac_hi, frac_lo,
-		    (FLOAT128_FRACTION_SIZE - FLOAT32_FRACTION_SIZE + 1),
-		    &frac_hi, &frac_lo);
-
-		while (exp > 0) {
-			--exp;
-			rshift128(frac_hi, frac_lo, 1, &frac_hi, &frac_lo);
-		}
-		result.parts.fraction = frac_lo;
-
-		return result;
-	}
-
-	result.parts.exp = exp;
-	frac_hi = a.parts.frac_hi;
-	frac_lo = a.parts.frac_lo;
-	rshift128(frac_hi, frac_lo,
-	    (FLOAT128_FRACTION_SIZE - FLOAT32_FRACTION_SIZE + 1),
-	    &frac_hi, &frac_lo);
-	result.parts.fraction = frac_lo;
-	return result;
-}
-
-float64 float128_to_float64(float128 a)
-{
-	float64 result;
-	int32_t exp;
-	uint64_t frac_hi, frac_lo;
-
-	result.parts.sign = a.parts.sign;
-
-	if (is_float128_nan(a)) {
-		result.parts.exp = FLOAT64_MAX_EXPONENT;
-
-		if (is_float128_signan(a)) {
-			/* set first bit of fraction nonzero */
-			result.parts.fraction = FLOAT64_HIDDEN_BIT_MASK >> 1;
-			return result;
-		}
-
-		/* fraction nonzero but its first bit is zero */
-		result.parts.fraction = 0x1;
-		return result;
-	}
-
-	if (is_float128_infinity(a)) {
-		result.parts.fraction = 0;
-		result.parts.exp = FLOAT64_MAX_EXPONENT;
-		return result;
-	}
-
-	exp = (int) a.parts.exp - FLOAT128_BIAS + FLOAT64_BIAS;
-
-	if (exp >= FLOAT64_MAX_EXPONENT) {
-		/* FIXME: overflow */
-		result.parts.fraction = 0;
-		result.parts.exp = FLOAT64_MAX_EXPONENT;
-		return result;
-	} else if (exp <= 0) {
-		/* underflow or denormalized */
-
-		result.parts.exp = 0;
-
-		exp *= -1;
-		if (exp > FLOAT64_FRACTION_SIZE) {
-			/* FIXME: underflow */
-			result.parts.fraction = 0;
-			return result;
-		}
-
-		/* denormalized */
-
-		frac_hi = a.parts.frac_hi;
-		frac_lo = a.parts.frac_lo;
-
-		/* denormalize and set hidden bit */
-		frac_hi |= FLOAT128_HIDDEN_BIT_MASK_HI;
-
-		rshift128(frac_hi, frac_lo,
-		    (FLOAT128_FRACTION_SIZE - FLOAT64_FRACTION_SIZE + 1),
-		    &frac_hi, &frac_lo);
-
-		while (exp > 0) {
-			--exp;
-			rshift128(frac_hi, frac_lo, 1, &frac_hi, &frac_lo);
-		}
-		result.parts.fraction = frac_lo;
-
-		return result;
-	}
-
-	result.parts.exp = exp;
-	frac_hi = a.parts.frac_hi;
-	frac_lo = a.parts.frac_lo;
-	rshift128(frac_hi, frac_lo,
-	    (FLOAT128_FRACTION_SIZE - FLOAT64_FRACTION_SIZE + 1),
-	    &frac_hi, &frac_lo);
-	result.parts.fraction = frac_lo;
-	return result;
-}
-
-/** Helper procedure for converting float32 to uint32.
- *
- * @param a Floating point number in normalized form
- *     (NaNs or Inf are not checked).
- * @return Converted unsigned integer.
- */
-static uint32_t _float32_to_uint32_helper(float32 a)
-{
-	uint32_t frac;
-
-	if (a.parts.exp < FLOAT32_BIAS) {
-		/* TODO: rounding */
-		return 0;
-	}
-
-	frac = a.parts.fraction;
-
-	frac |= FLOAT32_HIDDEN_BIT_MASK;
-	/* shift fraction to left so hidden bit will be the most significant bit */
-	frac <<= 32 - FLOAT32_FRACTION_SIZE - 1;
-
-	frac >>= 32 - (a.parts.exp - FLOAT32_BIAS) - 1;
-	if ((a.parts.sign == 1) && (frac != 0)) {
-		frac = ~frac;
-		++frac;
-	}
-
-	return frac;
-}
-
-/*
- * FIXME: Im not sure what to return if overflow/underflow happens
- *  - now its the biggest or the smallest int
- */
-uint32_t float32_to_uint32(float32 a)
-{
-	if (is_float32_nan(a))
-		return UINT32_MAX;
-
-	if (is_float32_infinity(a) || (a.parts.exp >= (32 + FLOAT32_BIAS))) {
-		if (a.parts.sign)
-			return UINT32_MIN;
-
-		return UINT32_MAX;
-	}
-
-	return _float32_to_uint32_helper(a);
-}
-
-/*
- * FIXME: Im not sure what to return if overflow/underflow happens
- *  - now its the biggest or the smallest int
- */
-int32_t float32_to_int32(float32 a)
-{
-	if (is_float32_nan(a))
-		return INT32_MAX;
-
-	if (is_float32_infinity(a) || (a.parts.exp >= (32 + FLOAT32_BIAS))) {
-		if (a.parts.sign)
-			return INT32_MIN;
-
-		return INT32_MAX;
-	}
-
-	return _float32_to_uint32_helper(a);
-}
-
-/** Helper procedure for converting float32 to uint64.
- *
- * @param a Floating point number in normalized form
- *     (NaNs or Inf are not checked).
- * @return Converted unsigned integer.
- */
-static uint64_t _float32_to_uint64_helper(float32 a)
-{
-	uint64_t frac;
-
-	if (a.parts.exp < FLOAT32_BIAS) {
-		// TODO: rounding
-		return 0;
-	}
-
-	frac = a.parts.fraction;
-
-	frac |= FLOAT32_HIDDEN_BIT_MASK;
-	/* shift fraction to left so hidden bit will be the most significant bit */
-	frac <<= 64 - FLOAT32_FRACTION_SIZE - 1;
-
-	frac >>= 64 - (a.parts.exp - FLOAT32_BIAS) - 1;
-	if ((a.parts.sign == 1) && (frac != 0)) {
-		frac = ~frac;
-		++frac;
-	}
-
-	return frac;
-}
-
-/*
- * FIXME: Im not sure what to return if overflow/underflow happens
- *  - now its the biggest or the smallest int
- */
-uint64_t float32_to_uint64(float32 a)
-{
-	if (is_float32_nan(a))
-		return UINT64_MAX;
-
-	if (is_float32_infinity(a) || (a.parts.exp >= (64 + FLOAT32_BIAS))) {
-		if (a.parts.sign)
-			return UINT64_MIN;
-
-		return UINT64_MAX;
-	}
-
-	return _float32_to_uint64_helper(a);
-}
-
-/*
- * FIXME: Im not sure what to return if overflow/underflow happens
- *  - now its the biggest or the smallest int
- */
-int64_t float32_to_int64(float32 a)
-{
-	if (is_float32_nan(a))
-		return INT64_MAX;
-
-	if (is_float32_infinity(a) || (a.parts.exp >= (64 + FLOAT32_BIAS))) {
-		if (a.parts.sign)
-			return INT64_MIN;
-
-		return INT64_MAX;
-	}
-
-	return _float32_to_uint64_helper(a);
-}
-
-/** Helper procedure for converting float64 to uint64.
- *
- * @param a Floating point number in normalized form
- *     (NaNs or Inf are not checked).
- * @return Converted unsigned integer.
- */
-static uint64_t _float64_to_uint64_helper(float64 a)
-{
-	uint64_t frac;
-
-	if (a.parts.exp < FLOAT64_BIAS) {
-		// TODO: rounding
-		return 0;
-	}
-
-	frac = a.parts.fraction;
-
-	frac |= FLOAT64_HIDDEN_BIT_MASK;
-	/* shift fraction to left so hidden bit will be the most significant bit */
-	frac <<= 64 - FLOAT64_FRACTION_SIZE - 1;
-
-	frac >>= 64 - (a.parts.exp - FLOAT64_BIAS) - 1;
-	if ((a.parts.sign == 1) && (frac != 0)) {
-		frac = ~frac;
-		++frac;
-	}
-
-	return frac;
-}
-
-/*
- * FIXME: Im not sure what to return if overflow/underflow happens
- *  - now its the biggest or the smallest int
- */
-uint32_t float64_to_uint32(float64 a)
-{
-	if (is_float64_nan(a))
-		return UINT32_MAX;
-
-	if (is_float64_infinity(a) || (a.parts.exp >= (32 + FLOAT64_BIAS))) {
-		if (a.parts.sign)
-			return UINT32_MIN;
-
-		return UINT32_MAX;
-	}
-
-	return (uint32_t) _float64_to_uint64_helper(a);
-}
-
-/*
- * FIXME: Im not sure what to return if overflow/underflow happens
- *  - now its the biggest or the smallest int
- */
-int32_t float64_to_int32(float64 a)
-{
-	if (is_float64_nan(a))
-		return INT32_MAX;
-
-	if (is_float64_infinity(a) || (a.parts.exp >= (32 + FLOAT64_BIAS))) {
-		if (a.parts.sign)
-			return INT32_MIN;
-
-		return INT32_MAX;
-	}
-
-	return (int32_t) _float64_to_uint64_helper(a);
-}
-
-/*
- * FIXME: Im not sure what to return if overflow/underflow happens
- *  - now its the biggest or the smallest int
- */
-uint64_t float64_to_uint64(float64 a)
-{
-	if (is_float64_nan(a))
-		return UINT64_MAX;
-
-	if (is_float64_infinity(a) || (a.parts.exp >= (64 + FLOAT64_BIAS))) {
-		if (a.parts.sign)
-			return UINT64_MIN;
-
-		return UINT64_MAX;
-	}
-
-	return _float64_to_uint64_helper(a);
-}
-
-/*
- * FIXME: Im not sure what to return if overflow/underflow happens
- *  - now its the biggest or the smallest int
- */
-int64_t float64_to_int64(float64 a)
-{
-	if (is_float64_nan(a))
-		return INT64_MAX;
-
-	if (is_float64_infinity(a) || (a.parts.exp >= (64 + FLOAT64_BIAS))) {
-		if (a.parts.sign)
-			return INT64_MIN;
-
-		return INT64_MAX;
-	}
-
-	return _float64_to_uint64_helper(a);
-}
-
-/** Helper procedure for converting float128 to uint64.
- *
- * @param a Floating point number in normalized form
- *     (NaNs or Inf are not checked).
- * @return Converted unsigned integer.
- */
-static uint64_t _float128_to_uint64_helper(float128 a)
-{
-	uint64_t frac_hi, frac_lo;
-
-	if (a.parts.exp < FLOAT128_BIAS) {
-		// TODO: rounding
-		return 0;
-	}
-
-	frac_hi = a.parts.frac_hi;
-	frac_lo = a.parts.frac_lo;
-
-	frac_hi |= FLOAT128_HIDDEN_BIT_MASK_HI;
-	/* shift fraction to left so hidden bit will be the most significant bit */
-	lshift128(frac_hi, frac_lo,
-	    (128 - FLOAT128_FRACTION_SIZE - 1), &frac_hi, &frac_lo);
-
-	rshift128(frac_hi, frac_lo,
-	    (128 - (a.parts.exp - FLOAT128_BIAS) - 1), &frac_hi, &frac_lo);
-	if ((a.parts.sign == 1) && !eq128(frac_hi, frac_lo, 0x0ll, 0x0ll)) {
-		not128(frac_hi, frac_lo, &frac_hi, &frac_lo);
-		add128(frac_hi, frac_lo, 0x0ll, 0x1ll, &frac_hi, &frac_lo);
-	}
-
-	return frac_lo;
-}
-
-/*
- * FIXME: Im not sure what to return if overflow/underflow happens
- *  - now its the biggest or the smallest int
- */
-uint32_t float128_to_uint32(float128 a)
-{
-	if (is_float128_nan(a))
-		return UINT32_MAX;
-
-	if (is_float128_infinity(a) || (a.parts.exp >= (32 + FLOAT128_BIAS))) {
-		if (a.parts.sign)
-			return UINT32_MIN;
-
-		return UINT32_MAX;
-	}
-
-	return (uint32_t) _float128_to_uint64_helper(a);
-}
-
-/*
- * FIXME: Im not sure what to return if overflow/underflow happens
- *  - now its the biggest or the smallest int
- */
-int32_t float128_to_int32(float128 a)
-{
-	if (is_float128_nan(a))
-		return INT32_MAX;
-
-	if (is_float128_infinity(a) || (a.parts.exp >= (32 + FLOAT128_BIAS))) {
-		if (a.parts.sign)
-			return INT32_MIN;
-
-		return INT32_MAX;
-	}
-
-	return (int32_t) _float128_to_uint64_helper(a);
-}
-
-/*
- * FIXME: Im not sure what to return if overflow/underflow happens
- *  - now its the biggest or the smallest int
- */
-uint64_t float128_to_uint64(float128 a)
-{
-	if (is_float128_nan(a))
-		return UINT64_MAX;
-
-	if (is_float128_infinity(a) || (a.parts.exp >= (64 + FLOAT128_BIAS))) {
-		if (a.parts.sign)
-			return UINT64_MIN;
-
-		return UINT64_MAX;
-	}
-
-	return _float128_to_uint64_helper(a);
-}
-
-/*
- * FIXME: Im not sure what to return if overflow/underflow happens
- *  - now its the biggest or the smallest int
- */
-int64_t float128_to_int64(float128 a)
-{
-	if (is_float128_nan(a))
-		return INT64_MAX;
-
-	if (is_float128_infinity(a) || (a.parts.exp >= (64 + FLOAT128_BIAS))) {
-		if (a.parts.sign)
-			return INT64_MIN;
-
-		return INT64_MAX;
-	}
-
-	return _float128_to_uint64_helper(a);
-}
-
-float32 uint32_to_float32(uint32_t i)
-{
-	int counter;
-	int32_t exp;
-	float32 result;
-
-	result.parts.sign = 0;
-	result.parts.fraction = 0;
-
-	counter = count_zeroes32(i);
-
-	exp = FLOAT32_BIAS + 32 - counter - 1;
-
-	if (counter == 32) {
-		result.bin = 0;
-		return result;
-	}
-
-	if (counter > 0) {
-		i <<= counter - 1;
-	} else {
-		i >>= 1;
-	}
-
-	round_float32(&exp, &i);
-
-	result.parts.fraction = i >> (32 - FLOAT32_FRACTION_SIZE - 2);
-	result.parts.exp = exp;
-
-	return result;
-}
-
-float32 int32_to_float32(int32_t i)
-{
-	float32 result;
-
-	if (i < 0)
-		result = uint32_to_float32((uint32_t) (-i));
-	else
-		result = uint32_to_float32((uint32_t) i);
-
-	result.parts.sign = i < 0;
-
-	return result;
-}
-
-float32 uint64_to_float32(uint64_t i)
-{
-	int counter;
-	int32_t exp;
-	uint32_t j;
-	float32 result;
-
-	result.parts.sign = 0;
-	result.parts.fraction = 0;
-
-	counter = count_zeroes64(i);
-
-	exp = FLOAT32_BIAS + 64 - counter - 1;
-
-	if (counter == 64) {
-		result.bin = 0;
-		return result;
-	}
-
-	/* Shift all to the first 31 bits (31st will be hidden 1) */
-	if (counter > 33) {
-		i <<= counter - 1 - 32;
-	} else {
-		i >>= 1 + 32 - counter;
-	}
-
-	j = (uint32_t) i;
-	round_float32(&exp, &j);
-
-	result.parts.fraction = j >> (32 - FLOAT32_FRACTION_SIZE - 2);
-	result.parts.exp = exp;
-	return result;
-}
-
-float32 int64_to_float32(int64_t i)
-{
-	float32 result;
-
-	if (i < 0)
-		result = uint64_to_float32((uint64_t) (-i));
-	else
-		result = uint64_to_float32((uint64_t) i);
-
-	result.parts.sign = i < 0;
-
-	return result;
-}
-
-float64 uint32_to_float64(uint32_t i)
-{
-	int counter;
-	int32_t exp;
-	float64 result;
-	uint64_t frac;
-
-	result.parts.sign = 0;
-	result.parts.fraction = 0;
-
-	counter = count_zeroes32(i);
-
-	exp = FLOAT64_BIAS + 32 - counter - 1;
-
-	if (counter == 32) {
-		result.bin = 0;
-		return result;
-	}
-
-	frac = i;
-	frac <<= counter + 32 - 1;
-
-	round_float64(&exp, &frac);
-
-	result.parts.fraction = frac >> (64 - FLOAT64_FRACTION_SIZE - 2);
-	result.parts.exp = exp;
-
-	return result;
-}
-
-float64 int32_to_float64(int32_t i)
-{
-	float64 result;
-
-	if (i < 0)
-		result = uint32_to_float64((uint32_t) (-i));
-	else
-		result = uint32_to_float64((uint32_t) i);
-
-	result.parts.sign = i < 0;
-
-	return result;
-}
-
-float64 uint64_to_float64(uint64_t i)
-{
-	int counter;
-	int32_t exp;
-	float64 result;
-
-	result.parts.sign = 0;
-	result.parts.fraction = 0;
-
-	counter = count_zeroes64(i);
-
-	exp = FLOAT64_BIAS + 64 - counter - 1;
-
-	if (counter == 64) {
-		result.bin = 0;
-		return result;
-	}
-
-	if (counter > 0) {
-		i <<= counter - 1;
-	} else {
-		i >>= 1;
-	}
-
-	round_float64(&exp, &i);
-
-	result.parts.fraction = i >> (64 - FLOAT64_FRACTION_SIZE - 2);
-	result.parts.exp = exp;
-	return result;
-}
-
-float64 int64_to_float64(int64_t i)
-{
-	float64 result;
-
-	if (i < 0)
-		result = uint64_to_float64((uint64_t) (-i));
-	else
-		result = uint64_to_float64((uint64_t) i);
-
-	result.parts.sign = i < 0;
-
-	return result;
-}
-
-float128 uint32_to_float128(uint32_t i)
-{
-	int counter;
-	int32_t exp;
-	float128 result;
-	uint64_t frac_hi, frac_lo;
-
-	result.parts.sign = 0;
-	result.parts.frac_hi = 0;
-	result.parts.frac_lo = 0;
-
-	counter = count_zeroes32(i);
-
-	exp = FLOAT128_BIAS + 32 - counter - 1;
-
-	if (counter == 32) {
-		result.bin.hi = 0;
-		result.bin.lo = 0;
-		return result;
-	}
-
-	frac_hi = 0;
-	frac_lo = i;
-	lshift128(frac_hi, frac_lo, (counter + 96 - 1), &frac_hi, &frac_lo);
-
-	round_float128(&exp, &frac_hi, &frac_lo);
-
-	rshift128(frac_hi, frac_lo,
-	    (128 - FLOAT128_FRACTION_SIZE - 2), &frac_hi, &frac_lo);
-	result.parts.frac_hi = frac_hi;
-	result.parts.frac_lo = frac_lo;
-	result.parts.exp = exp;
-
-	return result;
-}
-
-float128 int32_to_float128(int32_t i)
-{
-	float128 result;
-
-	if (i < 0)
-		result = uint32_to_float128((uint32_t) (-i));
-	else
-		result = uint32_to_float128((uint32_t) i);
-
-	result.parts.sign = i < 0;
-
-	return result;
-}
-
-
-float128 uint64_to_float128(uint64_t i)
-{
-	int counter;
-	int32_t exp;
-	float128 result;
-	uint64_t frac_hi, frac_lo;
-
-	result.parts.sign = 0;
-	result.parts.frac_hi = 0;
-	result.parts.frac_lo = 0;
-
-	counter = count_zeroes64(i);
-
-	exp = FLOAT128_BIAS + 64 - counter - 1;
-
-	if (counter == 64) {
-		result.bin.hi = 0;
-		result.bin.lo = 0;
-		return result;
-	}
-
-	frac_hi = 0;
-	frac_lo = i;
-	lshift128(frac_hi, frac_lo, (counter + 64 - 1), &frac_hi, &frac_lo);
-
-	round_float128(&exp, &frac_hi, &frac_lo);
-
-	rshift128(frac_hi, frac_lo,
-	    (128 - FLOAT128_FRACTION_SIZE - 2), &frac_hi, &frac_lo);
-	result.parts.frac_hi = frac_hi;
-	result.parts.frac_lo = frac_lo;
-	result.parts.exp = exp;
-
-	return result;
-}
-
-float128 int64_to_float128(int64_t i)
-{
-	float128 result;
-
-	if (i < 0)
-		result = uint64_to_float128((uint64_t) (-i));
-	else
-		result = uint64_to_float128((uint64_t) i);
-
-	result.parts.sign = i < 0;
-
-	return result;
-}
-
-#ifdef float32_t
-
-float32_t __floatsisf(int32_t i)
-{
-	float32_u res;
-	res.data = int32_to_float32(i);
-
-	return res.val;
-}
-
-float32_t __floatdisf(int64_t i)
-{
-	float32_u res;
-	res.data = int64_to_float32(i);
-
-	return res.val;
-}
-
-float32_t __floatunsisf(uint32_t i)
-{
-	float32_u res;
-	res.data = uint32_to_float32(i);
-
-	return res.val;
-}
-
-float32_t __floatundisf(uint64_t i)
-{
-	float32_u res;
-	res.data = uint64_to_float32(i);
-
-	return res.val;
-}
-
-int32_t __fixsfsi(float32_t a)
-{
-	float32_u ua;
-	ua.val = a;
-
-	return float32_to_int32(ua.data);
-}
-
-int64_t __fixsfdi(float32_t a)
-{
-	float32_u ua;
-	ua.val = a;
-
-	return float32_to_int64(ua.data);
-}
-
-uint32_t __fixunssfsi(float32_t a)
-{
-	float32_u ua;
-	ua.val = a;
-
-	return float32_to_uint32(ua.data);
-}
-
-uint64_t __fixunssfdi(float32_t a)
-{
-	float32_u ua;
-	ua.val = a;
-
-	return float32_to_uint64(ua.data);
-}
-
-int32_t __aeabi_f2iz(float32_t a)
-{
-	float32_u ua;
-	ua.val = a;
-
-	return float32_to_int32(ua.data);
-}
-
-int64_t __aeabi_f2lz(float32_t a)
-{
-	float32_u ua;
-	ua.val = a;
-
-	return float32_to_int64(ua.data);
-}
-
-uint32_t __aeabi_f2uiz(float32_t a)
-{
-	float32_u ua;
-	ua.val = a;
-
-	return float32_to_uint32(ua.data);
-}
-
-float32_t __aeabi_i2f(int32_t i)
-{
-	float32_u res;
-	res.data = int32_to_float32(i);
-
-	return res.val;
-}
-
-float32_t __aeabi_l2f(int64_t i)
-{
-	float32_u res;
-	res.data = int64_to_float32(i);
-
-	return res.val;
-}
-
-float32_t __aeabi_ui2f(uint32_t i)
-{
-	float32_u res;
-	res.data = uint32_to_float32(i);
-
-	return res.val;
-}
-
-float32_t __aeabi_ul2f(uint64_t i)
-{
-	float32_u res;
-	res.data = uint64_to_float32(i);
-
-	return res.val;
-}
-
-#endif
-
-#ifdef float64_t
-
-float64_t __floatsidf(int32_t i)
-{
-	float64_u res;
-	res.data = int32_to_float64(i);
-
-	return res.val;
-}
-
-float64_t __floatdidf(int64_t i)
-{
-	float64_u res;
-	res.data = int64_to_float64(i);
-
-	return res.val;
-}
-
-float64_t __floatunsidf(uint32_t i)
-{
-	float64_u res;
-	res.data = uint32_to_float64(i);
-
-	return res.val;
-}
-
-float64_t __floatundidf(uint64_t i)
-{
-	float64_u res;
-	res.data = uint64_to_float64(i);
-
-	return res.val;
-}
-
-uint32_t __fixunsdfsi(float64_t a)
-{
-	float64_u ua;
-	ua.val = a;
-
-	return float64_to_uint32(ua.data);
-}
-
-uint64_t __fixunsdfdi(float64_t a)
-{
-	float64_u ua;
-	ua.val = a;
-
-	return float64_to_uint64(ua.data);
-}
-
-int32_t __fixdfsi(float64_t a)
-{
-	float64_u ua;
-	ua.val = a;
-
-	return float64_to_int32(ua.data);
-}
-
-int64_t __fixdfdi(float64_t a)
-{
-	float64_u ua;
-	ua.val = a;
-
-	return float64_to_int64(ua.data);
-}
-
-float64_t __aeabi_i2d(int32_t i)
-{
-	float64_u res;
-	res.data = int32_to_float64(i);
-
-	return res.val;
-}
-
-float64_t __aeabi_ui2d(uint32_t i)
-{
-	float64_u res;
-	res.data = uint32_to_float64(i);
-
-	return res.val;
-}
-
-float64_t __aeabi_l2d(int64_t i)
-{
-	float64_u res;
-	res.data = int64_to_float64(i);
-
-	return res.val;
-}
-
-int32_t __aeabi_d2iz(float64_t a)
-{
-	float64_u ua;
-	ua.val = a;
-
-	return float64_to_int32(ua.data);
-}
-
-int64_t __aeabi_d2lz(float64_t a)
-{
-	float64_u ua;
-	ua.val = a;
-
-	return float64_to_int64(ua.data);
-}
-
-uint32_t __aeabi_d2uiz(float64_t a)
-{
-	float64_u ua;
-	ua.val = a;
-
-	return float64_to_uint32(ua.data);
-}
-
-#endif
-
-#ifdef float128_t
-
-float128_t __floatsitf(int32_t i)
-{
-	float128_u res;
-	res.data = int32_to_float128(i);
-
-	return res.val;
-}
-
-float128_t __floatditf(int64_t i)
-{
-	float128_u res;
-	res.data = int64_to_float128(i);
-
-	return res.val;
-}
-
-float128_t __floatunsitf(uint32_t i)
-{
-	float128_u res;
-	res.data = uint32_to_float128(i);
-
-	return res.val;
-}
-
-float128_t __floatunditf(uint64_t i)
-{
-	float128_u res;
-	res.data = uint64_to_float128(i);
-
-	return res.val;
-}
-
-int32_t __fixtfsi(float128_t a)
-{
-	float128_u ua;
-	ua.val = a;
-
-	return float128_to_int32(ua.data);
-}
-
-int64_t __fixtfdi(float128_t a)
-{
-	float128_u ua;
-	ua.val = a;
-
-	return float128_to_uint64(ua.data);
-}
-
-uint32_t __fixunstfsi(float128_t a)
-{
-	float128_u ua;
-	ua.val = a;
-
-	return float128_to_uint32(ua.data);
-}
-
-uint64_t __fixunstfdi(float128_t a)
-{
-	float128_u ua;
-	ua.val = a;
-
-	return float128_to_uint64(ua.data);
-}
-
-int32_t _Qp_qtoi(float128_t *a)
-{
-	return __fixtfsi(*a);
-}
-
-int64_t _Qp_qtox(float128_t *a)
-{
-	return __fixunstfdi(*a);
-}
-
-uint32_t _Qp_qtoui(float128_t *a)
-{
-	return __fixunstfsi(*a);
-}
-
-uint64_t _Qp_qtoux(float128_t *a)
-{
-	return __fixunstfdi(*a);
-}
-
-void _Qp_itoq(float128_t *c, int32_t a)
-{
-	*c = __floatsitf(a);
-}
-
-void _Qp_xtoq(float128_t *c, int64_t a)
-{
-	*c = __floatditf(a);
-}
-
-void _Qp_uitoq(float128_t *c, uint32_t a)
-{
-	*c = __floatunsitf(a);
-}
-
-void _Qp_uxtoq(float128_t *c, uint64_t a)
-{
-	*c = __floatunditf(a);
-}
-
-#endif
-
-#if (defined(float32_t) && defined(float64_t))
-
-float32_t __truncdfsf2(float64_t a)
-{
-	float64_u ua;
-	ua.val = a;
-
-	float32_u res;
-	res.data = float64_to_float32(ua.data);
-
-	return res.val;
-}
-
-float64_t __extendsfdf2(float32_t a)
-{
-	float32_u ua;
-	ua.val = a;
-
-	float64_u res;
-	res.data = float32_to_float64(ua.data);
-
-	return res.val;
-}
-
-float64_t __aeabi_f2d(float32_t a)
-{
-	float32_u ua;
-	ua.val = a;
-
-	float64_u res;
-	res.data = float32_to_float64(ua.data);
-
-	return res.val;
-}
-
-float32_t __aeabi_d2f(float64_t a)
-{
-	float64_u ua;
-	ua.val = a;
-
-	float32_u res;
-	res.data = float64_to_float32(ua.data);
-
-	return res.val;
-}
-
-#endif
-
-#if (defined(float32_t) && defined(float128_t))
-
-float32_t __trunctfsf2(float128_t a)
-{
-	float128_u ua;
-	ua.val = a;
-
-	float32_u res;
-	res.data = float128_to_float32(ua.data);
-
-	return res.val;
-}
-
-float128_t __extendsftf2(float32_t a)
-{
-	float32_u ua;
-	ua.val = a;
-
-	float128_u res;
-	res.data = float32_to_float128(ua.data);
-
-	return res.val;
-}
-
-void _Qp_stoq(float128_t *c, float32_t a)
-{
-	*c = __extendsftf2(a);
-}
-
-float32_t _Qp_qtos(float128_t *a)
-{
-	return __trunctfsf2(*a);
-}
-
-#endif
-
-#if (defined(float64_t) && defined(float128_t))
-
-float64_t __trunctfdf2(float128_t a)
-{
-	float128_u ua;
-	ua.val = a;
-
-	float64_u res;
-	res.data = float128_to_float64(ua.data);
-
-	return res.val;
-}
-
-float128_t __extenddftf2(float64_t a)
-{
-	float64_u ua;
-	ua.val = a;
-
-	float128_u res;
-	res.data = float64_to_float128(ua.data);
-
-	return res.val;
-}
-
-void _Qp_dtoq(float128_t *c, float64_t a)
-{
-	*c = __extenddftf2(a);
-}
-
-float64_t _Qp_qtod(float128_t *a)
-{
-	return __trunctfdf2(*a);
-}
-
-#endif
-
-/** @}
- */
Index: uspace/lib/softfloat/conversion.h
===================================================================
--- uspace/lib/softfloat/conversion.h	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,181 +1,0 @@
-/*
- * Copyright (c) 2005 Josef Cejka
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softfloat
- * @{
- */
-/** @file Conversion of precision and conversion between integers and floats.
- */
-
-#ifndef __CONVERSION_H__
-#define __CONVERSION_H__
-
-#include <mathtypes.h>
-
-extern float64 float32_to_float64(float32);
-extern float96 float32_to_float96(float32);
-extern float128 float32_to_float128(float32);
-extern float96 float64_to_float96(float64);
-extern float128 float64_to_float128(float64);
-extern float128 float96_to_float128(float96);
-
-extern float32 float64_to_float32(float64);
-extern float32 float96_to_float32(float96);
-extern float64 float96_to_float64(float96);
-extern float32 float128_to_float32(float128);
-extern float64 float128_to_float64(float128);
-extern float96 float128_to_float96(float128);
-
-extern uint32_t float32_to_uint32(float32);
-extern int32_t float32_to_int32(float32);
-
-extern uint64_t float32_to_uint64(float32);
-extern int64_t float32_to_int64(float32);
-
-extern uint32_t float64_to_uint32(float64);
-extern int32_t float64_to_int32(float64);
-
-extern uint64_t float64_to_uint64(float64);
-extern int64_t float64_to_int64(float64);
-
-extern uint32_t float96_to_uint32(float96);
-extern int32_t float96_to_int32(float96);
-
-extern uint64_t float96_to_uint64(float96);
-extern int64_t float96_to_int64(float96);
-
-extern uint32_t float128_to_uint32(float128);
-extern int32_t float128_to_int32(float128);
-
-extern uint64_t float128_to_uint64(float128);
-extern int64_t float128_to_int64(float128);
-
-extern float32 uint32_to_float32(uint32_t);
-extern float32 int32_to_float32(int32_t);
-
-extern float32 uint64_to_float32(uint64_t);
-extern float32 int64_to_float32(int64_t);
-
-extern float64 uint32_to_float64(uint32_t);
-extern float64 int32_to_float64(int32_t);
-
-extern float64 uint64_to_float64(uint64_t);
-extern float64 int64_to_float64(int64_t);
-
-extern float96 uint32_to_float96(uint32_t);
-extern float96 int32_to_float96(int32_t);
-
-extern float96 uint64_to_float96(uint64_t);
-extern float96 int64_to_float96(int64_t);
-
-extern float128 uint32_to_float128(uint32_t);
-extern float128 int32_to_float128(int32_t);
-
-extern float128 uint64_to_float128(uint64_t);
-extern float128 int64_to_float128(int64_t);
-
-#ifdef float32_t
-extern float32_t __floatsisf(int32_t);
-extern float32_t __floatdisf(int64_t);
-extern float32_t __floatunsisf(uint32_t);
-extern float32_t __floatundisf(uint64_t);
-extern int32_t __fixsfsi(float32_t);
-extern int64_t __fixsfdi(float32_t);
-extern uint32_t __fixunssfsi(float32_t);
-extern uint64_t __fixunssfdi(float32_t);
-extern int32_t __aeabi_f2iz(float32_t);
-extern int64_t __aeabi_f2lz(float32_t);
-extern uint32_t __aeabi_f2uiz(float32_t);
-extern float32_t __aeabi_i2f(int32_t);
-extern float32_t __aeabi_l2f(int64_t);
-extern float32_t __aeabi_ui2f(uint32_t);
-extern float32_t __aeabi_ul2f(uint64_t);
-#endif
-
-#ifdef float64_t
-extern float64_t __floatsidf(int32_t);
-extern float64_t __floatdidf(int64_t);
-extern float64_t __floatunsidf(uint32_t);
-extern float64_t __floatundidf(uint64_t);
-extern int32_t __fixdfsi(float64_t);
-extern int64_t __fixdfdi(float64_t);
-extern uint32_t __fixunsdfsi(float64_t);
-extern uint64_t __fixunsdfdi(float64_t);
-extern float64_t __aeabi_i2d(int32_t);
-extern float64_t __aeabi_ui2d(uint32_t);
-extern float64_t __aeabi_l2d(int64_t);
-extern int32_t __aeabi_d2iz(float64_t);
-extern int64_t __aeabi_d2lz(float64_t);
-extern uint32_t __aeabi_d2uiz(float64_t);
-#endif
-
-#ifdef float128_t
-extern float128_t __floatsitf(int32_t);
-extern float128_t __floatditf(int64_t);
-extern float128_t __floatunsitf(uint32_t);
-extern float128_t __floatunditf(uint64_t);
-extern int32_t __fixtfsi(float128_t);
-extern int64_t __fixtfdi(float128_t);
-extern uint32_t __fixunstfsi(float128_t);
-extern uint64_t __fixunstfdi(float128_t);
-extern int32_t _Qp_qtoi(float128_t *);
-extern int64_t _Qp_qtox(float128_t *);
-extern uint32_t _Qp_qtoui(float128_t *);
-extern uint64_t _Qp_qtoux(float128_t *);
-extern void _Qp_itoq(float128_t *, int32_t);
-extern void _Qp_xtoq(float128_t *, int64_t);
-extern void _Qp_uitoq(float128_t *, uint32_t);
-extern void _Qp_uxtoq(float128_t *, uint64_t);
-#endif
-
-#if (defined(float32_t) && defined(float64_t))
-extern float32_t __truncdfsf2(float64_t);
-extern float64_t __extendsfdf2(float32_t);
-extern float64_t __aeabi_f2d(float32_t);
-extern float32_t __aeabi_d2f(float64_t);
-#endif
-
-#if (defined(float32_t) && defined(float128_t))
-extern float32_t __trunctfsf2(float128_t);
-extern float128_t __extendsftf2(float32_t);
-extern void _Qp_stoq(float128_t *, float32_t);
-extern float32_t _Qp_qtos(float128_t *);
-#endif
-
-#if (defined(float64_t) && defined(float128_t))
-extern float64_t __trunctfdf2(float128_t);
-extern float128_t __extenddftf2(float64_t);
-extern void _Qp_dtoq(float128_t *, float64_t);
-extern float64_t _Qp_qtod(float128_t *);
-#endif
-
-#endif
-
-/** @}
- */
Index: uspace/lib/softfloat/div.c
===================================================================
--- uspace/lib/softfloat/div.c	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,636 +1,0 @@
-/*
- * Copyright (c) 2005 Josef Cejka
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softfloat
- * @{
- */
-/** @file Division functions.
- */
-
-#include "add.h"
-#include "div.h"
-#include "comparison.h"
-#include "mul.h"
-#include "common.h"
-
-/** Divide two single-precision floats.
- *
- * @param a Nominator.
- * @param b Denominator.
- *
- * @return Result of division.
- *
- */
-float32 div_float32(float32 a, float32 b)
-{
-	float32 result;
-	int32_t aexp, bexp, cexp;
-	uint64_t afrac, bfrac, cfrac;
-
-	result.parts.sign = a.parts.sign ^ b.parts.sign;
-
-	if (is_float32_nan(a)) {
-		if (is_float32_signan(a)) {
-			// FIXME: SigNaN
-		}
-		/* NaN */
-		return a;
-	}
-
-	if (is_float32_nan(b)) {
-		if (is_float32_signan(b)) {
-			// FIXME: SigNaN
-		}
-		/* NaN */
-		return b;
-	}
-
-	if (is_float32_infinity(a)) {
-		if (is_float32_infinity(b)) {
-			/*FIXME: inf / inf */
-			result.bin = FLOAT32_NAN;
-			return result;
-		}
-		/* inf / num */
-		result.parts.exp = a.parts.exp;
-		result.parts.fraction = a.parts.fraction;
-		return result;
-	}
-
-	if (is_float32_infinity(b)) {
-		if (is_float32_zero(a)) {
-			/* FIXME 0 / inf */
-			result.parts.exp = 0;
-			result.parts.fraction = 0;
-			return result;
-		}
-		/* FIXME: num / inf*/
-		result.parts.exp = 0;
-		result.parts.fraction = 0;
-		return result;
-	}
-
-	if (is_float32_zero(b)) {
-		if (is_float32_zero(a)) {
-			/*FIXME: 0 / 0*/
-			result.bin = FLOAT32_NAN;
-			return result;
-		}
-		/* FIXME: division by zero */
-		result.parts.exp = 0;
-		result.parts.fraction = 0;
-		return result;
-	}
-
-	afrac = a.parts.fraction;
-	aexp = a.parts.exp;
-	bfrac = b.parts.fraction;
-	bexp = b.parts.exp;
-
-	/* denormalized numbers */
-	if (aexp == 0) {
-		if (afrac == 0) {
-			result.parts.exp = 0;
-			result.parts.fraction = 0;
-			return result;
-		}
-
-		/* normalize it*/
-		afrac <<= 1;
-		/* afrac is nonzero => it must stop */
-		while (!(afrac & FLOAT32_HIDDEN_BIT_MASK)) {
-			afrac <<= 1;
-			aexp--;
-		}
-	}
-
-	if (bexp == 0) {
-		bfrac <<= 1;
-		/* bfrac is nonzero => it must stop */
-		while (!(bfrac & FLOAT32_HIDDEN_BIT_MASK)) {
-			bfrac <<= 1;
-			bexp--;
-		}
-	}
-
-	afrac = (afrac | FLOAT32_HIDDEN_BIT_MASK) << (32 - FLOAT32_FRACTION_SIZE - 1);
-	bfrac = (bfrac | FLOAT32_HIDDEN_BIT_MASK) << (32 - FLOAT32_FRACTION_SIZE);
-
-	if (bfrac <= (afrac << 1)) {
-		afrac >>= 1;
-		aexp++;
-	}
-
-	cexp = aexp - bexp + FLOAT32_BIAS - 2;
-
-	cfrac = (afrac << 32) / bfrac;
-	if ((cfrac & 0x3F) == 0) {
-		cfrac |= (bfrac * cfrac != afrac << 32);
-	}
-
-	/* pack and round */
-
-	/* find first nonzero digit and shift result and detect possibly underflow */
-	while ((cexp > 0) && (cfrac) && (!(cfrac & (FLOAT32_HIDDEN_BIT_MASK << 7)))) {
-		cexp--;
-		cfrac <<= 1;
-		/* TODO: fix underflow */
-	}
-
-	cfrac += (0x1 << 6); /* FIXME: 7 is not sure*/
-
-	if (cfrac & (FLOAT32_HIDDEN_BIT_MASK << 7)) {
-		++cexp;
-		cfrac >>= 1;
-	}
-
-	/* check overflow */
-	if (cexp >= FLOAT32_MAX_EXPONENT) {
-		/* FIXME: overflow, return infinity */
-		result.parts.exp = FLOAT32_MAX_EXPONENT;
-		result.parts.fraction = 0;
-		return result;
-	}
-
-	if (cexp < 0) {
-		/* FIXME: underflow */
-		result.parts.exp = 0;
-		if ((cexp + FLOAT32_FRACTION_SIZE) < 0) {
-			result.parts.fraction = 0;
-			return result;
-		}
-		cfrac >>= 1;
-		while (cexp < 0) {
-			cexp++;
-			cfrac >>= 1;
-		}
-	} else {
-		result.parts.exp = (uint32_t) cexp;
-	}
-
-	result.parts.fraction = ((cfrac >> 6) & (~FLOAT32_HIDDEN_BIT_MASK));
-
-	return result;
-}
-
-/** Divide two double-precision floats.
- *
- * @param a Nominator.
- * @param b Denominator.
- *
- * @return Result of division.
- *
- */
-float64 div_float64(float64 a, float64 b)
-{
-	float64 result;
-	int64_t aexp, bexp, cexp;
-	uint64_t afrac, bfrac, cfrac;
-	uint64_t remlo, remhi;
-	uint64_t tmplo, tmphi;
-
-	result.parts.sign = a.parts.sign ^ b.parts.sign;
-
-	if (is_float64_nan(a)) {
-		if (is_float64_signan(b)) {
-			// FIXME: SigNaN
-			return b;
-		}
-
-		if (is_float64_signan(a)) {
-			// FIXME: SigNaN
-		}
-		/* NaN */
-		return a;
-	}
-
-	if (is_float64_nan(b)) {
-		if (is_float64_signan(b)) {
-			// FIXME: SigNaN
-		}
-		/* NaN */
-		return b;
-	}
-
-	if (is_float64_infinity(a)) {
-		if (is_float64_infinity(b) || is_float64_zero(b)) {
-			// FIXME: inf / inf
-			result.bin = FLOAT64_NAN;
-			return result;
-		}
-		/* inf / num */
-		result.parts.exp = a.parts.exp;
-		result.parts.fraction = a.parts.fraction;
-		return result;
-	}
-
-	if (is_float64_infinity(b)) {
-		if (is_float64_zero(a)) {
-			/* FIXME 0 / inf */
-			result.parts.exp = 0;
-			result.parts.fraction = 0;
-			return result;
-		}
-		/* FIXME: num / inf*/
-		result.parts.exp = 0;
-		result.parts.fraction = 0;
-		return result;
-	}
-
-	if (is_float64_zero(b)) {
-		if (is_float64_zero(a)) {
-			/*FIXME: 0 / 0*/
-			result.bin = FLOAT64_NAN;
-			return result;
-		}
-		/* FIXME: division by zero */
-		result.parts.exp = 0;
-		result.parts.fraction = 0;
-		return result;
-	}
-
-	afrac = a.parts.fraction;
-	aexp = a.parts.exp;
-	bfrac = b.parts.fraction;
-	bexp = b.parts.exp;
-
-	/* denormalized numbers */
-	if (aexp == 0) {
-		if (afrac == 0) {
-			result.parts.exp = 0;
-			result.parts.fraction = 0;
-			return result;
-		}
-
-		/* normalize it*/
-		aexp++;
-		/* afrac is nonzero => it must stop */
-		while (!(afrac & FLOAT64_HIDDEN_BIT_MASK)) {
-			afrac <<= 1;
-			aexp--;
-		}
-	}
-
-	if (bexp == 0) {
-		bexp++;
-		/* bfrac is nonzero => it must stop */
-		while (!(bfrac & FLOAT64_HIDDEN_BIT_MASK)) {
-			bfrac <<= 1;
-			bexp--;
-		}
-	}
-
-	afrac = (afrac | FLOAT64_HIDDEN_BIT_MASK) << (64 - FLOAT64_FRACTION_SIZE - 2);
-	bfrac = (bfrac | FLOAT64_HIDDEN_BIT_MASK) << (64 - FLOAT64_FRACTION_SIZE - 1);
-
-	if (bfrac <= (afrac << 1)) {
-		afrac >>= 1;
-		aexp++;
-	}
-
-	cexp = aexp - bexp + FLOAT64_BIAS - 2;
-
-	cfrac = div128est(afrac, 0x0ll, bfrac);
-
-	if ((cfrac & 0x1FF) <= 2) {
-		mul64(bfrac, cfrac, &tmphi, &tmplo);
-		sub128(afrac, 0x0ll, tmphi, tmplo, &remhi, &remlo);
-
-		while ((int64_t) remhi < 0) {
-			cfrac--;
-			add128(remhi, remlo, 0x0ll, bfrac, &remhi, &remlo);
-		}
-		cfrac |= (remlo != 0);
-	}
-
-	/* round and shift */
-	result = finish_float64(cexp, cfrac, result.parts.sign);
-	return result;
-}
-
-/** Divide two quadruple-precision floats.
- *
- * @param a Nominator.
- * @param b Denominator.
- *
- * @return Result of division.
- *
- */
-float128 div_float128(float128 a, float128 b)
-{
-	float128 result;
-	int64_t aexp, bexp, cexp;
-	uint64_t afrac_hi, afrac_lo, bfrac_hi, bfrac_lo, cfrac_hi, cfrac_lo;
-	uint64_t shift_out;
-	uint64_t rem_hihi, rem_hilo, rem_lohi, rem_lolo;
-	uint64_t tmp_hihi, tmp_hilo, tmp_lohi, tmp_lolo;
-
-	result.parts.sign = a.parts.sign ^ b.parts.sign;
-
-	if (is_float128_nan(a)) {
-		if (is_float128_signan(b)) {
-			// FIXME: SigNaN
-			return b;
-		}
-
-		if (is_float128_signan(a)) {
-			// FIXME: SigNaN
-		}
-		/* NaN */
-		return a;
-	}
-
-	if (is_float128_nan(b)) {
-		if (is_float128_signan(b)) {
-			// FIXME: SigNaN
-		}
-		/* NaN */
-		return b;
-	}
-
-	if (is_float128_infinity(a)) {
-		if (is_float128_infinity(b) || is_float128_zero(b)) {
-			// FIXME: inf / inf
-			result.bin.hi = FLOAT128_NAN_HI;
-			result.bin.lo = FLOAT128_NAN_LO;
-			return result;
-		}
-		/* inf / num */
-		result.parts.exp = a.parts.exp;
-		result.parts.frac_hi = a.parts.frac_hi;
-		result.parts.frac_lo = a.parts.frac_lo;
-		return result;
-	}
-
-	if (is_float128_infinity(b)) {
-		if (is_float128_zero(a)) {
-			// FIXME 0 / inf
-			result.parts.exp = 0;
-			result.parts.frac_hi = 0;
-			result.parts.frac_lo = 0;
-			return result;
-		}
-		// FIXME: num / inf
-		result.parts.exp = 0;
-		result.parts.frac_hi = 0;
-		result.parts.frac_lo = 0;
-		return result;
-	}
-
-	if (is_float128_zero(b)) {
-		if (is_float128_zero(a)) {
-			// FIXME: 0 / 0
-			result.bin.hi = FLOAT128_NAN_HI;
-			result.bin.lo = FLOAT128_NAN_LO;
-			return result;
-		}
-		// FIXME: division by zero
-		result.parts.exp = 0;
-		result.parts.frac_hi = 0;
-		result.parts.frac_lo = 0;
-		return result;
-	}
-
-	afrac_hi = a.parts.frac_hi;
-	afrac_lo = a.parts.frac_lo;
-	aexp = a.parts.exp;
-	bfrac_hi = b.parts.frac_hi;
-	bfrac_lo = b.parts.frac_lo;
-	bexp = b.parts.exp;
-
-	/* denormalized numbers */
-	if (aexp == 0) {
-		if (eq128(afrac_hi, afrac_lo, 0x0ll, 0x0ll)) {
-			result.parts.exp = 0;
-			result.parts.frac_hi = 0;
-			result.parts.frac_lo = 0;
-			return result;
-		}
-
-		/* normalize it*/
-		aexp++;
-		/* afrac is nonzero => it must stop */
-		and128(afrac_hi, afrac_lo,
-		    FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
-		    &tmp_hihi, &tmp_lolo);
-		while (!lt128(0x0ll, 0x0ll, tmp_hihi, tmp_lolo)) {
-			lshift128(afrac_hi, afrac_lo, 1, &afrac_hi, &afrac_lo);
-			aexp--;
-		}
-	}
-
-	if (bexp == 0) {
-		bexp++;
-		/* bfrac is nonzero => it must stop */
-		and128(bfrac_hi, bfrac_lo,
-		    FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
-		    &tmp_hihi, &tmp_lolo);
-		while (!lt128(0x0ll, 0x0ll, tmp_hihi, tmp_lolo)) {
-			lshift128(bfrac_hi, bfrac_lo, 1, &bfrac_hi, &bfrac_lo);
-			bexp--;
-		}
-	}
-
-	or128(afrac_hi, afrac_lo,
-	    FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
-	    &afrac_hi, &afrac_lo);
-	lshift128(afrac_hi, afrac_lo,
-	    (128 - FLOAT128_FRACTION_SIZE - 1), &afrac_hi, &afrac_lo);
-	or128(bfrac_hi, bfrac_lo,
-	    FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
-	    &bfrac_hi, &bfrac_lo);
-	lshift128(bfrac_hi, bfrac_lo,
-	    (128 - FLOAT128_FRACTION_SIZE - 1), &bfrac_hi, &bfrac_lo);
-
-	if (le128(bfrac_hi, bfrac_lo, afrac_hi, afrac_lo)) {
-		rshift128(afrac_hi, afrac_lo, 1, &afrac_hi, &afrac_lo);
-		aexp++;
-	}
-
-	cexp = aexp - bexp + FLOAT128_BIAS - 2;
-
-	cfrac_hi = div128est(afrac_hi, afrac_lo, bfrac_hi);
-
-	mul128(bfrac_hi, bfrac_lo, 0x0ll, cfrac_hi,
-	    &tmp_lolo /* dummy */, &tmp_hihi, &tmp_hilo, &tmp_lohi);
-
-	/*
-	 * sub192(afrac_hi, afrac_lo, 0,
-	 *     tmp_hihi, tmp_hilo, tmp_lohi
-	 *     &rem_hihi, &rem_hilo, &rem_lohi);
-	 */
-	sub128(afrac_hi, afrac_lo, tmp_hihi, tmp_hilo, &rem_hihi, &rem_hilo);
-	if (tmp_lohi > 0) {
-		sub128(rem_hihi, rem_hilo, 0x0ll, 0x1ll, &rem_hihi, &rem_hilo);
-	}
-	rem_lohi = -tmp_lohi;
-
-	while ((int64_t) rem_hihi < 0) {
-		--cfrac_hi;
-		/*
-		 * add192(rem_hihi, rem_hilo, rem_lohi,
-		 *     0, bfrac_hi, bfrac_lo,
-		 *     &rem_hihi, &rem_hilo, &rem_lohi);
-		 */
-		add128(rem_hilo, rem_lohi, bfrac_hi, bfrac_lo, &rem_hilo, &rem_lohi);
-		if (lt128(rem_hilo, rem_lohi, bfrac_hi, bfrac_lo)) {
-			++rem_hihi;
-		}
-	}
-
-	cfrac_lo = div128est(rem_hilo, rem_lohi, bfrac_lo);
-
-	if ((cfrac_lo & 0x3FFF) <= 4) {
-		mul128(bfrac_hi, bfrac_lo, 0x0ll, cfrac_lo,
-		    &tmp_hihi /* dummy */, &tmp_hilo, &tmp_lohi, &tmp_lolo);
-
-		/*
-		 * sub192(rem_hilo, rem_lohi, 0,
-		 *     tmp_hilo, tmp_lohi, tmp_lolo,
-		 *     &rem_hilo, &rem_lohi, &rem_lolo);
-		 */
-		sub128(rem_hilo, rem_lohi, tmp_hilo, tmp_lohi, &rem_hilo, &rem_lohi);
-		if (tmp_lolo > 0) {
-			sub128(rem_hilo, rem_lohi, 0x0ll, 0x1ll, &rem_hilo, &rem_lohi);
-		}
-		rem_lolo = -tmp_lolo;
-
-		while ((int64_t) rem_hilo < 0) {
-			--cfrac_lo;
-			/*
-			 * add192(rem_hilo, rem_lohi, rem_lolo,
-			 *     0, bfrac_hi, bfrac_lo,
-			 *     &rem_hilo, &rem_lohi, &rem_lolo);
-			 */
-			add128(rem_lohi, rem_lolo, bfrac_hi, bfrac_lo, &rem_lohi, &rem_lolo);
-			if (lt128(rem_lohi, rem_lolo, bfrac_hi, bfrac_lo)) {
-				++rem_hilo;
-			}
-		}
-
-		cfrac_lo |= ((rem_hilo | rem_lohi | rem_lolo) != 0);
-	}
-
-	shift_out = cfrac_lo << (64 - (128 - FLOAT128_FRACTION_SIZE - 1));
-	rshift128(cfrac_hi, cfrac_lo, (128 - FLOAT128_FRACTION_SIZE - 1),
-	    &cfrac_hi, &cfrac_lo);
-
-	result = finish_float128(cexp, cfrac_hi, cfrac_lo, result.parts.sign, shift_out);
-	return result;
-}
-
-#ifdef float32_t
-
-float32_t __divsf3(float32_t a, float32_t b)
-{
-	float32_u ua;
-	ua.val = a;
-
-	float32_u ub;
-	ub.val = b;
-
-	float32_u res;
-	res.data = div_float32(ua.data, ub.data);
-
-	return res.val;
-}
-
-float32_t __aeabi_fdiv(float32_t a, float32_t b)
-{
-	float32_u ua;
-	ua.val = a;
-
-	float32_u ub;
-	ub.val = b;
-
-	float32_u res;
-	res.data = div_float32(ua.data, ub.data);
-
-	return res.val;
-}
-
-#endif
-
-#ifdef float64_t
-
-float64_t __divdf3(float64_t a, float64_t b)
-{
-	float64_u ua;
-	ua.val = a;
-
-	float64_u ub;
-	ub.val = b;
-
-	float64_u res;
-	res.data = div_float64(ua.data, ub.data);
-
-	return res.val;
-}
-
-float64_t __aeabi_ddiv(float64_t a, float64_t b)
-{
-	float64_u ua;
-	ua.val = a;
-
-	float64_u ub;
-	ub.val = b;
-
-	float64_u res;
-	res.data = div_float64(ua.data, ub.data);
-
-	return res.val;
-}
-
-#endif
-
-#ifdef float128_t
-
-float128_t __divtf3(float128_t a, float128_t b)
-{
-	float128_u ua;
-	ua.val = a;
-
-	float128_u ub;
-	ub.val = b;
-
-	float128_u res;
-	res.data = div_float128(ua.data, ub.data);
-
-	return res.val;
-}
-
-void _Qp_div(float128_t *c, float128_t *a, float128_t *b)
-{
-	*c = __divtf3(*a, *b);
-}
-
-#endif
-
-/** @}
- */
Index: uspace/lib/softfloat/div.h
===================================================================
--- uspace/lib/softfloat/div.h	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/*
- * Copyright (c) 2005 Josef Cejka
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softfloat
- * @{
- */
-/** @file Division functions.
- */
-
-#ifndef __DIV_H__
-#define __DIV_H__
-
-extern float32 div_float32(float32, float32);
-extern float64 div_float64(float64, float64);
-extern float96 div_float96(float96, float96);
-extern float128 div_float128(float128, float128);
-
-#ifdef float32_t
-extern float32_t __divsf3(float32_t, float32_t);
-extern float32_t __aeabi_fdiv(float32_t, float32_t);
-#endif
-
-#ifdef float64_t
-extern float64_t __divdf3(float64_t, float64_t);
-extern float64_t __aeabi_ddiv(float64_t, float64_t);
-#endif
-
-#ifdef float128_t
-extern float128_t __divtf3(float128_t, float128_t);
-extern void _Qp_div(float128_t *, float128_t *, float128_t *);
-#endif
-
-#endif
-
-/** @}
- */
Index: uspace/lib/softfloat/mul.c
===================================================================
--- uspace/lib/softfloat/mul.c	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,476 +1,0 @@
-/*
- * Copyright (c) 2005 Josef Cejka
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softfloat
- * @{
- */
-/** @file Multiplication functions.
- */
-
-#include "mul.h"
-#include "comparison.h"
-#include "common.h"
-
-/** Multiply two single-precision floats.
- *
- * @param a First input operand.
- * @param b Second input operand.
- *
- * @return Result of multiplication.
- *
- */
-float32 mul_float32(float32 a, float32 b)
-{
-	float32 result;
-	uint64_t frac1, frac2;
-	int32_t exp;
-
-	result.parts.sign = a.parts.sign ^ b.parts.sign;
-
-	if (is_float32_nan(a) || is_float32_nan(b)) {
-		/* TODO: fix SigNaNs */
-		if (is_float32_signan(a)) {
-			result.parts.fraction = a.parts.fraction;
-			result.parts.exp = a.parts.exp;
-			return result;
-		}
-
-		if (is_float32_signan(b)) { /* TODO: fix SigNaN */
-			result.parts.fraction = b.parts.fraction;
-			result.parts.exp = b.parts.exp;
-			return result;
-		}
-
-		/* set NaN as result */
-		result.bin = FLOAT32_NAN;
-		return result;
-	}
-
-	if (is_float32_infinity(a)) {
-		if (is_float32_zero(b)) {
-			/* FIXME: zero * infinity */
-			result.bin = FLOAT32_NAN;
-			return result;
-		}
-
-		result.parts.fraction = a.parts.fraction;
-		result.parts.exp = a.parts.exp;
-		return result;
-	}
-
-	if (is_float32_infinity(b)) {
-		if (is_float32_zero(a)) {
-			/* FIXME: zero * infinity */
-			result.bin = FLOAT32_NAN;
-			return result;
-		}
-
-		result.parts.fraction = b.parts.fraction;
-		result.parts.exp = b.parts.exp;
-		return result;
-	}
-
-	/* exp is signed so we can easy detect underflow */
-	exp = a.parts.exp + b.parts.exp;
-	exp -= FLOAT32_BIAS;
-
-	if (exp >= FLOAT32_MAX_EXPONENT) {
-		/* FIXME: overflow */
-		/* set infinity as result */
-		result.bin = FLOAT32_INF;
-		result.parts.sign = a.parts.sign ^ b.parts.sign;
-		return result;
-	}
-
-	if (exp < 0) {
-		/* FIXME: underflow */
-		/* return signed zero */
-		result.parts.fraction = 0x0;
-		result.parts.exp = 0x0;
-		return result;
-	}
-
-	frac1 = a.parts.fraction;
-	if (a.parts.exp > 0) {
-		frac1 |= FLOAT32_HIDDEN_BIT_MASK;
-	} else {
-		++exp;
-	}
-
-	frac2 = b.parts.fraction;
-
-	if (b.parts.exp > 0) {
-		frac2 |= FLOAT32_HIDDEN_BIT_MASK;
-	} else {
-		++exp;
-	}
-
-	frac1 <<= 1; /* one bit space for rounding */
-
-	frac1 = frac1 * frac2;
-
-	/* round and return */
-	while ((exp < FLOAT32_MAX_EXPONENT) &&
-	    (frac1 >= (1 << (FLOAT32_FRACTION_SIZE + 2)))) {
-		/* 23 bits of fraction + one more for hidden bit (all shifted 1 bit left) */
-		++exp;
-		frac1 >>= 1;
-	}
-
-	/* rounding */
-	/* ++frac1; FIXME: not works - without it is ok */
-	frac1 >>= 1; /* shift off rounding space */
-
-	if ((exp < FLOAT32_MAX_EXPONENT) &&
-	    (frac1 >= (1 << (FLOAT32_FRACTION_SIZE + 1)))) {
-		++exp;
-		frac1 >>= 1;
-	}
-
-	if (exp >= FLOAT32_MAX_EXPONENT) {
-		/* TODO: fix overflow */
-		/* return infinity*/
-		result.parts.exp = FLOAT32_MAX_EXPONENT;
-		result.parts.fraction = 0x0;
-		return result;
-	}
-
-	exp -= FLOAT32_FRACTION_SIZE;
-
-	if (exp <= FLOAT32_FRACTION_SIZE) {
-		/* denormalized number */
-		frac1 >>= 1; /* denormalize */
-
-		while ((frac1 > 0) && (exp < 0)) {
-			frac1 >>= 1;
-			++exp;
-		}
-
-		if (frac1 == 0) {
-			/* FIXME : underflow */
-			result.parts.exp = 0;
-			result.parts.fraction = 0;
-			return result;
-		}
-	}
-
-	result.parts.exp = exp;
-	result.parts.fraction = frac1 & ((1 << FLOAT32_FRACTION_SIZE) - 1);
-
-	return result;
-}
-
-/** Multiply two double-precision floats.
- *
- * @param a First input operand.
- * @param b Second input operand.
- *
- * @return Result of multiplication.
- *
- */
-float64 mul_float64(float64 a, float64 b)
-{
-	float64 result;
-	uint64_t frac1, frac2;
-	int32_t exp;
-
-	result.parts.sign = a.parts.sign ^ b.parts.sign;
-
-	if (is_float64_nan(a) || is_float64_nan(b)) {
-		/* TODO: fix SigNaNs */
-		if (is_float64_signan(a)) {
-			result.parts.fraction = a.parts.fraction;
-			result.parts.exp = a.parts.exp;
-			return result;
-		}
-		if (is_float64_signan(b)) { /* TODO: fix SigNaN */
-			result.parts.fraction = b.parts.fraction;
-			result.parts.exp = b.parts.exp;
-			return result;
-		}
-		/* set NaN as result */
-		result.bin = FLOAT64_NAN;
-		return result;
-	}
-
-	if (is_float64_infinity(a)) {
-		if (is_float64_zero(b)) {
-			/* FIXME: zero * infinity */
-			result.bin = FLOAT64_NAN;
-			return result;
-		}
-		result.parts.fraction = a.parts.fraction;
-		result.parts.exp = a.parts.exp;
-		return result;
-	}
-
-	if (is_float64_infinity(b)) {
-		if (is_float64_zero(a)) {
-			/* FIXME: zero * infinity */
-			result.bin = FLOAT64_NAN;
-			return result;
-		}
-		result.parts.fraction = b.parts.fraction;
-		result.parts.exp = b.parts.exp;
-		return result;
-	}
-
-	/* exp is signed so we can easy detect underflow */
-	exp = a.parts.exp + b.parts.exp - FLOAT64_BIAS;
-
-	frac1 = a.parts.fraction;
-
-	if (a.parts.exp > 0) {
-		frac1 |= FLOAT64_HIDDEN_BIT_MASK;
-	} else {
-		++exp;
-	}
-
-	frac2 = b.parts.fraction;
-
-	if (b.parts.exp > 0) {
-		frac2 |= FLOAT64_HIDDEN_BIT_MASK;
-	} else {
-		++exp;
-	}
-
-	frac1 <<= (64 - FLOAT64_FRACTION_SIZE - 1);
-	frac2 <<= (64 - FLOAT64_FRACTION_SIZE - 2);
-
-	mul64(frac1, frac2, &frac1, &frac2);
-
-	frac1 |= (frac2 != 0);
-	if (frac1 & (0x1ll << 62)) {
-		frac1 <<= 1;
-		exp--;
-	}
-
-	result = finish_float64(exp, frac1, result.parts.sign);
-	return result;
-}
-
-/** Multiply two quadruple-precision floats.
- *
- * @param a First input operand.
- * @param b Second input operand.
- *
- * @return Result of multiplication.
- *
- */
-float128 mul_float128(float128 a, float128 b)
-{
-	float128 result;
-	uint64_t frac1_hi, frac1_lo, frac2_hi, frac2_lo, tmp_hi, tmp_lo;
-	int32_t exp;
-
-	result.parts.sign = a.parts.sign ^ b.parts.sign;
-
-	if (is_float128_nan(a) || is_float128_nan(b)) {
-		/* TODO: fix SigNaNs */
-		if (is_float128_signan(a)) {
-			result.parts.frac_hi = a.parts.frac_hi;
-			result.parts.frac_lo = a.parts.frac_lo;
-			result.parts.exp = a.parts.exp;
-			return result;
-		}
-		if (is_float128_signan(b)) { /* TODO: fix SigNaN */
-			result.parts.frac_hi = b.parts.frac_hi;
-			result.parts.frac_lo = b.parts.frac_lo;
-			result.parts.exp = b.parts.exp;
-			return result;
-		}
-		/* set NaN as result */
-		result.bin.hi = FLOAT128_NAN_HI;
-		result.bin.lo = FLOAT128_NAN_LO;
-		return result;
-	}
-
-	if (is_float128_infinity(a)) {
-		if (is_float128_zero(b)) {
-			/* FIXME: zero * infinity */
-			result.bin.hi = FLOAT128_NAN_HI;
-			result.bin.lo = FLOAT128_NAN_LO;
-			return result;
-		}
-		result.parts.frac_hi = a.parts.frac_hi;
-		result.parts.frac_lo = a.parts.frac_lo;
-		result.parts.exp = a.parts.exp;
-		return result;
-	}
-
-	if (is_float128_infinity(b)) {
-		if (is_float128_zero(a)) {
-			/* FIXME: zero * infinity */
-			result.bin.hi = FLOAT128_NAN_HI;
-			result.bin.lo = FLOAT128_NAN_LO;
-			return result;
-		}
-		result.parts.frac_hi = b.parts.frac_hi;
-		result.parts.frac_lo = b.parts.frac_lo;
-		result.parts.exp = b.parts.exp;
-		return result;
-	}
-
-	/* exp is signed so we can easy detect underflow */
-	exp = a.parts.exp + b.parts.exp - FLOAT128_BIAS - 1;
-
-	frac1_hi = a.parts.frac_hi;
-	frac1_lo = a.parts.frac_lo;
-
-	if (a.parts.exp > 0) {
-		or128(frac1_hi, frac1_lo,
-		    FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
-		    &frac1_hi, &frac1_lo);
-	} else {
-		++exp;
-	}
-
-	frac2_hi = b.parts.frac_hi;
-	frac2_lo = b.parts.frac_lo;
-
-	if (b.parts.exp > 0) {
-		or128(frac2_hi, frac2_lo,
-		    FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
-		    &frac2_hi, &frac2_lo);
-	} else {
-		++exp;
-	}
-
-	lshift128(frac2_hi, frac2_lo,
-	    128 - FLOAT128_FRACTION_SIZE, &frac2_hi, &frac2_lo);
-
-	tmp_hi = frac1_hi;
-	tmp_lo = frac1_lo;
-	mul128(frac1_hi, frac1_lo, frac2_hi, frac2_lo,
-	    &frac1_hi, &frac1_lo, &frac2_hi, &frac2_lo);
-	add128(frac1_hi, frac1_lo, tmp_hi, tmp_lo, &frac1_hi, &frac1_lo);
-	frac2_hi |= (frac2_lo != 0x0ll);
-
-	if ((FLOAT128_HIDDEN_BIT_MASK_HI << 1) <= frac1_hi) {
-		frac2_hi >>= 1;
-		if (frac1_lo & 0x1ll) {
-			frac2_hi |= (0x1ull < 64);
-		}
-		rshift128(frac1_hi, frac1_lo, 1, &frac1_hi, &frac1_lo);
-		++exp;
-	}
-
-	result = finish_float128(exp, frac1_hi, frac1_lo, result.parts.sign, frac2_hi);
-	return result;
-}
-
-#ifdef float32_t
-
-float32_t __mulsf3(float32_t a, float32_t b)
-{
-	float32_u ua;
-	ua.val = a;
-
-	float32_u ub;
-	ub.val = b;
-
-	float32_u res;
-	res.data = mul_float32(ua.data, ub.data);
-
-	return res.val;
-}
-
-float32_t __aeabi_fmul(float32_t a, float32_t b)
-{
-	float32_u ua;
-	ua.val = a;
-
-	float32_u ub;
-	ub.val = b;
-
-	float32_u res;
-	res.data = mul_float32(ua.data, ub.data);
-
-	return res.val;
-}
-
-#endif
-
-#ifdef float64_t
-
-float64_t __muldf3(float64_t a, float64_t b)
-{
-	float64_u ua;
-	ua.val = a;
-
-	float64_u ub;
-	ub.val = b;
-
-	float64_u res;
-	res.data = mul_float64(ua.data, ub.data);
-
-	return res.val;
-}
-
-float64_t __aeabi_dmul(float64_t a, float64_t b)
-{
-	float64_u ua;
-	ua.val = a;
-
-	float64_u ub;
-	ub.val = b;
-
-	float64_u res;
-	res.data = mul_float64(ua.data, ub.data);
-
-	return res.val;
-}
-
-#endif
-
-#ifdef float128_t
-
-float128_t __multf3(float128_t a, float128_t b)
-{
-	float128_u ua;
-	ua.val = a;
-
-	float128_u ub;
-	ub.val = b;
-
-	float128_u res;
-	res.data = mul_float128(ua.data, ub.data);
-
-	return res.val;
-}
-
-void _Qp_mul(float128_t *c, float128_t *a, float128_t *b)
-{
-	*c = __multf3(*a, *b);
-}
-
-#endif
-
-/** @}
- */
Index: uspace/lib/softfloat/mul.h
===================================================================
--- uspace/lib/softfloat/mul.h	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/*
- * Copyright (c) 2005 Josef Cejka
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softfloat
- * @{
- */
-/** @file Multiplication functions.
- */
-
-#ifndef __MUL_H__
-#define __MUL_H__
-
-#include <mathtypes.h>
-
-extern float32 mul_float32(float32, float32);
-extern float64 mul_float64(float64, float64);
-extern float96 mul_float96(float96, float96);
-extern float128 mul_float128(float128, float128);
-
-#ifdef float32_t
-extern float32_t __mulsf3(float32_t, float32_t);
-extern float32_t __aeabi_fmul(float32_t, float32_t);
-#endif
-
-#ifdef float64_t
-extern float64_t __muldf3(float64_t, float64_t);
-extern float64_t __aeabi_dmul(float64_t, float64_t);
-#endif
-
-#ifdef float128_t
-extern float128_t __multf3(float128_t, float128_t);
-extern void _Qp_mul(float128_t *, float128_t *, float128_t *);
-#endif
-
-#endif
-
-/** @}
- */
Index: uspace/lib/softfloat/neg.c
===================================================================
--- uspace/lib/softfloat/neg.c	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,87 +1,0 @@
-/*
- * Copyright (c) 2005 Josef Cejka
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softfloat
- * @{
- */
-/** @file Negation functions.
- */
-
-#include "neg.h"
-#include "common.h"
-
-#ifdef float32_t
-
-float32_t __negsf2(float32_t a)
-{
-	float32_u ua;
-	ua.val = a;
-
-	ua.data.parts.sign = !ua.data.parts.sign;
-
-	return ua.val;
-}
-
-#endif
-
-#ifdef float64_t
-
-float64_t __negdf2(float64_t a)
-{
-	float64_u ua;
-	ua.val = a;
-
-	ua.data.parts.sign = !ua.data.parts.sign;
-
-	return ua.val;
-}
-
-#endif
-
-#ifdef float128_t
-
-float128_t __negtf2(float128_t a)
-{
-	float128_u ua;
-	ua.val = a;
-
-	ua.data.parts.sign = !ua.data.parts.sign;
-
-	return ua.val;
-}
-
-void _Qp_neg(float128_t *c, float128_t *a)
-{
-	*c = __negtf2(*a);
-}
-
-#endif
-
-/** @}
- */
Index: uspace/lib/softfloat/neg.h
===================================================================
--- uspace/lib/softfloat/neg.h	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,57 +1,0 @@
-/*
- * Copyright (c) 2005 Josef Cejka
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softfloat
- * @{
- */
-/** @file Negation functions.
- */
-
-#ifndef __NEG_H__
-#define __NEG_H__
-
-#include <mathtypes.h>
-
-#ifdef float32_t
-extern float32_t __negsf2(float32_t);
-#endif
-
-#ifdef float64_t
-extern float64_t __negdf2(float64_t);
-#endif
-
-#ifdef float128_t
-extern float128_t __negtf2(float128_t);
-extern void _Qp_neg(float128_t *, float128_t *);
-#endif
-
-#endif
-
-/** @}
- */
Index: uspace/lib/softfloat/sub.c
===================================================================
--- uspace/lib/softfloat/sub.c	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,553 +1,0 @@
-/*
- * Copyright (c) 2005 Josef Cejka
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softfloat
- * @{
- */
-/** @file Substraction functions.
- */
-
-#include "sub.h"
-#include "comparison.h"
-#include "common.h"
-#include "add.h"
-
-/** Subtract two single-precision floats with the same sign.
- *
- * @param a First input operand.
- * @param b Second input operand.
- *
- * @return Result of substraction.
- *
- */
-float32 sub_float32(float32 a, float32 b)
-{
-	int expdiff;
-	uint32_t exp1, exp2, frac1, frac2;
-	float32 result;
-
-	result.bin = 0;
-
-	expdiff = a.parts.exp - b.parts.exp;
-	if ((expdiff < 0) || ((expdiff == 0) &&
-	    (a.parts.fraction < b.parts.fraction))) {
-		if (is_float32_nan(b)) {
-			if (is_float32_signan(b)) {
-				// TODO: fix SigNaN
-			}
-
-			return b;
-		}
-
-		if (b.parts.exp == FLOAT32_MAX_EXPONENT) {
-			/* num -(+-inf) = -+inf */
-			b.parts.sign = !b.parts.sign;
-			return b;
-		}
-
-		result.parts.sign = !a.parts.sign;
-
-		frac1 = b.parts.fraction;
-		exp1 = b.parts.exp;
-		frac2 = a.parts.fraction;
-		exp2 = a.parts.exp;
-		expdiff *= -1;
-	} else {
-		if (is_float32_nan(a)) {
-			if ((is_float32_signan(a)) || (is_float32_signan(b))) {
-				// TODO: fix SigNaN
-			}
-
-			return a;
-		}
-
-		if (a.parts.exp == FLOAT32_MAX_EXPONENT) {
-			if (b.parts.exp == FLOAT32_MAX_EXPONENT) {
-				/* inf - inf => nan */
-				// TODO: fix exception
-				result.bin = FLOAT32_NAN;
-				return result;
-			}
-
-			return a;
-		}
-
-		result.parts.sign = a.parts.sign;
-
-		frac1 = a.parts.fraction;
-		exp1 = a.parts.exp;
-		frac2 = b.parts.fraction;
-		exp2 = b.parts.exp;
-	}
-
-	if (exp1 == 0) {
-		/* both are denormalized */
-		result.parts.fraction = frac1 - frac2;
-		if (result.parts.fraction > frac1) {
-			// TODO: underflow exception
-			return result;
-		}
-
-		result.parts.exp = 0;
-		return result;
-	}
-
-	/* add hidden bit */
-	frac1 |= FLOAT32_HIDDEN_BIT_MASK;
-
-	if (exp2 == 0) {
-		/* denormalized */
-		--expdiff;
-	} else {
-		/* normalized */
-		frac2 |= FLOAT32_HIDDEN_BIT_MASK;
-	}
-
-	/* create some space for rounding */
-	frac1 <<= 6;
-	frac2 <<= 6;
-
-	if (expdiff > FLOAT32_FRACTION_SIZE + 1)
-		goto done;
-
-	frac1 = frac1 - (frac2 >> expdiff);
-
-done:
-	/* TODO: find first nonzero digit and shift result and detect possibly underflow */
-	while ((exp1 > 0) && (!(frac1 & (FLOAT32_HIDDEN_BIT_MASK << 6)))) {
-		--exp1;
-		frac1 <<= 1;
-		/* TODO: fix underflow - frac1 == 0 does not necessary means underflow... */
-	}
-
-	/* rounding - if first bit after fraction is set then round up */
-	frac1 += 0x20;
-
-	if (frac1 & (FLOAT32_HIDDEN_BIT_MASK << 7)) {
-		++exp1;
-		frac1 >>= 1;
-	}
-
-	/* Clear hidden bit and shift */
-	result.parts.fraction = ((frac1 >> 6) & (~FLOAT32_HIDDEN_BIT_MASK));
-	result.parts.exp = exp1;
-
-	return result;
-}
-
-/** Subtract two double-precision floats with the same sign.
- *
- * @param a First input operand.
- * @param b Second input operand.
- *
- * @return Result of substraction.
- *
- */
-float64 sub_float64(float64 a, float64 b)
-{
-	int expdiff;
-	uint32_t exp1, exp2;
-	uint64_t frac1, frac2;
-	float64 result;
-
-	result.bin = 0;
-
-	expdiff = a.parts.exp - b.parts.exp;
-	if ((expdiff < 0) ||
-	    ((expdiff == 0) && (a.parts.fraction < b.parts.fraction))) {
-		if (is_float64_nan(b)) {
-			if (is_float64_signan(b)) {
-				// TODO: fix SigNaN
-			}
-
-			return b;
-		}
-
-		if (b.parts.exp == FLOAT64_MAX_EXPONENT) {
-			/* num -(+-inf) = -+inf */
-			b.parts.sign = !b.parts.sign;
-			return b;
-		}
-
-		result.parts.sign = !a.parts.sign;
-
-		frac1 = b.parts.fraction;
-		exp1 = b.parts.exp;
-		frac2 = a.parts.fraction;
-		exp2 = a.parts.exp;
-		expdiff *= -1;
-	} else {
-		if (is_float64_nan(a)) {
-			if (is_float64_signan(a) || is_float64_signan(b)) {
-				// TODO: fix SigNaN
-			}
-
-			return a;
-		}
-
-		if (a.parts.exp == FLOAT64_MAX_EXPONENT) {
-			if (b.parts.exp == FLOAT64_MAX_EXPONENT) {
-				/* inf - inf => nan */
-				// TODO: fix exception
-				result.bin = FLOAT64_NAN;
-				return result;
-			}
-
-			return a;
-		}
-
-		result.parts.sign = a.parts.sign;
-
-		frac1 = a.parts.fraction;
-		exp1 = a.parts.exp;
-		frac2 = b.parts.fraction;
-		exp2 = b.parts.exp;
-	}
-
-	if (exp1 == 0) {
-		/* both are denormalized */
-		result.parts.fraction = frac1 - frac2;
-		if (result.parts.fraction > frac1) {
-			// TODO: underflow exception
-			return result;
-		}
-
-		result.parts.exp = 0;
-		return result;
-	}
-
-	/* add hidden bit */
-	frac1 |= FLOAT64_HIDDEN_BIT_MASK;
-
-	if (exp2 == 0) {
-		/* denormalized */
-		--expdiff;
-	} else {
-		/* normalized */
-		frac2 |= FLOAT64_HIDDEN_BIT_MASK;
-	}
-
-	/* create some space for rounding */
-	frac1 <<= 6;
-	frac2 <<= 6;
-
-	if (expdiff > FLOAT64_FRACTION_SIZE + 1)
-		goto done;
-
-	frac1 = frac1 - (frac2 >> expdiff);
-
-done:
-	/* TODO: find first nonzero digit and shift result and detect possibly underflow */
-	while ((exp1 > 0) && (!(frac1 & (FLOAT64_HIDDEN_BIT_MASK << 6)))) {
-		--exp1;
-		frac1 <<= 1;
-		/* TODO: fix underflow - frac1 == 0 does not necessary means underflow... */
-	}
-
-	/* rounding - if first bit after fraction is set then round up */
-	frac1 += 0x20;
-
-	if (frac1 & (FLOAT64_HIDDEN_BIT_MASK << 7)) {
-		++exp1;
-		frac1 >>= 1;
-	}
-
-	/* Clear hidden bit and shift */
-	result.parts.fraction = ((frac1 >> 6) & (~FLOAT64_HIDDEN_BIT_MASK));
-	result.parts.exp = exp1;
-
-	return result;
-}
-
-/** Subtract two quadruple-precision floats with the same sign.
- *
- * @param a First input operand.
- * @param b Second input operand.
- *
- * @return Result of substraction.
- *
- */
-float128 sub_float128(float128 a, float128 b)
-{
-	int expdiff;
-	uint32_t exp1, exp2;
-	uint64_t frac1_hi, frac1_lo, frac2_hi, frac2_lo, tmp_hi, tmp_lo;
-	float128 result;
-
-	result.bin.hi = 0;
-	result.bin.lo = 0;
-
-	expdiff = a.parts.exp - b.parts.exp;
-	if ((expdiff < 0) || ((expdiff == 0) &&
-	    lt128(a.parts.frac_hi, a.parts.frac_lo, b.parts.frac_hi, b.parts.frac_lo))) {
-		if (is_float128_nan(b)) {
-			if (is_float128_signan(b)) {
-				// TODO: fix SigNaN
-			}
-
-			return b;
-		}
-
-		if (b.parts.exp == FLOAT128_MAX_EXPONENT) {
-			/* num -(+-inf) = -+inf */
-			b.parts.sign = !b.parts.sign;
-			return b;
-		}
-
-		result.parts.sign = !a.parts.sign;
-
-		frac1_hi = b.parts.frac_hi;
-		frac1_lo = b.parts.frac_lo;
-		exp1 = b.parts.exp;
-		frac2_hi = a.parts.frac_hi;
-		frac2_lo = a.parts.frac_lo;
-		exp2 = a.parts.exp;
-		expdiff *= -1;
-	} else {
-		if (is_float128_nan(a)) {
-			if (is_float128_signan(a) || is_float128_signan(b)) {
-				// TODO: fix SigNaN
-			}
-
-			return a;
-		}
-
-		if (a.parts.exp == FLOAT128_MAX_EXPONENT) {
-			if (b.parts.exp == FLOAT128_MAX_EXPONENT) {
-				/* inf - inf => nan */
-				// TODO: fix exception
-				result.bin.hi = FLOAT128_NAN_HI;
-				result.bin.lo = FLOAT128_NAN_LO;
-				return result;
-			}
-			return a;
-		}
-
-		result.parts.sign = a.parts.sign;
-
-		frac1_hi = a.parts.frac_hi;
-		frac1_lo = a.parts.frac_lo;
-		exp1 = a.parts.exp;
-		frac2_hi = b.parts.frac_hi;
-		frac2_lo = b.parts.frac_lo;
-		exp2 = b.parts.exp;
-	}
-
-	if (exp1 == 0) {
-		/* both are denormalized */
-		sub128(frac1_hi, frac1_lo, frac2_hi, frac2_lo, &tmp_hi, &tmp_lo);
-		result.parts.frac_hi = tmp_hi;
-		result.parts.frac_lo = tmp_lo;
-		if (lt128(frac1_hi, frac1_lo, result.parts.frac_hi, result.parts.frac_lo)) {
-			// TODO: underflow exception
-			return result;
-		}
-
-		result.parts.exp = 0;
-		return result;
-	}
-
-	/* add hidden bit */
-	or128(frac1_hi, frac1_lo,
-	    FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
-	    &frac1_hi, &frac1_lo);
-
-	if (exp2 == 0) {
-		/* denormalized */
-		--expdiff;
-	} else {
-		/* normalized */
-		or128(frac2_hi, frac2_lo,
-		    FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
-		    &frac2_hi, &frac2_lo);
-	}
-
-	/* create some space for rounding */
-	lshift128(frac1_hi, frac1_lo, 6, &frac1_hi, &frac1_lo);
-	lshift128(frac2_hi, frac2_lo, 6, &frac2_hi, &frac2_lo);
-
-	if (expdiff > FLOAT128_FRACTION_SIZE + 1)
-		goto done;
-
-	rshift128(frac2_hi, frac2_lo, expdiff, &tmp_hi, &tmp_lo);
-	sub128(frac1_hi, frac1_lo, tmp_hi, tmp_lo, &frac1_hi, &frac1_lo);
-
-done:
-	/* TODO: find first nonzero digit and shift result and detect possibly underflow */
-	lshift128(FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO, 6,
-	    &tmp_hi, &tmp_lo);
-	and128(frac1_hi, frac1_lo, tmp_hi, tmp_lo, &tmp_hi, &tmp_lo);
-	while ((exp1 > 0) && (!lt128(0x0ll, 0x0ll, tmp_hi, tmp_lo))) {
-		--exp1;
-		lshift128(frac1_hi, frac1_lo, 1, &frac1_hi, &frac1_lo);
-		/* TODO: fix underflow - frac1 == 0 does not necessary means underflow... */
-
-		lshift128(FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO, 6,
-		    &tmp_hi, &tmp_lo);
-		and128(frac1_hi, frac1_lo, tmp_hi, tmp_lo, &tmp_hi, &tmp_lo);
-	}
-
-	/* rounding - if first bit after fraction is set then round up */
-	add128(frac1_hi, frac1_lo, 0x0ll, 0x20ll, &frac1_hi, &frac1_lo);
-
-	lshift128(FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO, 7,
-	    &tmp_hi, &tmp_lo);
-	and128(frac1_hi, frac1_lo, tmp_hi, tmp_lo, &tmp_hi, &tmp_lo);
-	if (lt128(0x0ll, 0x0ll, tmp_hi, tmp_lo)) {
-		++exp1;
-		rshift128(frac1_hi, frac1_lo, 1, &frac1_hi, &frac1_lo);
-	}
-
-	/* Clear hidden bit and shift */
-	rshift128(frac1_hi, frac1_lo, 6, &frac1_hi, &frac1_lo);
-	not128(FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO,
-	    &tmp_hi, &tmp_lo);
-	and128(frac1_hi, frac1_lo, tmp_hi, tmp_lo, &tmp_hi, &tmp_lo);
-	result.parts.frac_hi = tmp_hi;
-	result.parts.frac_lo = tmp_lo;
-
-	result.parts.exp = exp1;
-
-	return result;
-}
-
-#ifdef float32_t
-
-float32_t __subsf3(float32_t a, float32_t b)
-{
-	float32_u ua;
-	ua.val = a;
-
-	float32_u ub;
-	ub.val = b;
-
-	float32_u res;
-
-	if (ua.data.parts.sign != ub.data.parts.sign) {
-		ub.data.parts.sign = !ub.data.parts.sign;
-		res.data = add_float32(ua.data, ub.data);
-	} else
-		res.data = sub_float32(ua.data, ub.data);
-
-	return res.val;
-}
-
-float32_t __aeabi_fsub(float32_t a, float32_t b)
-{
-	float32_u ua;
-	ua.val = a;
-
-	float32_u ub;
-	ub.val = b;
-
-	float32_u res;
-
-	if (ua.data.parts.sign != ub.data.parts.sign) {
-		ub.data.parts.sign = !ub.data.parts.sign;
-		res.data = add_float32(ua.data, ub.data);
-	} else
-		res.data = sub_float32(ua.data, ub.data);
-
-	return res.val;
-}
-
-#endif
-
-#ifdef float64_t
-
-float64_t __subdf3(float64_t a, float64_t b)
-{
-	float64_u ua;
-	ua.val = a;
-
-	float64_u ub;
-	ub.val = b;
-
-	float64_u res;
-
-	if (ua.data.parts.sign != ub.data.parts.sign) {
-		ub.data.parts.sign = !ub.data.parts.sign;
-		res.data = add_float64(ua.data, ub.data);
-	} else
-		res.data = sub_float64(ua.data, ub.data);
-
-	return res.val;
-}
-
-float64_t __aeabi_dsub(float64_t a, float64_t b)
-{
-	float64_u ua;
-	ua.val = a;
-
-	float64_u ub;
-	ub.val = b;
-
-	float64_u res;
-
-	if (ua.data.parts.sign != ub.data.parts.sign) {
-		ub.data.parts.sign = !ub.data.parts.sign;
-		res.data = add_float64(ua.data, ub.data);
-	} else
-		res.data = sub_float64(ua.data, ub.data);
-
-	return res.val;
-}
-
-#endif
-
-#ifdef float128_t
-
-float128_t __subtf3(float128_t a, float128_t b)
-{
-	float128_u ua;
-	ua.val = a;
-
-	float128_u ub;
-	ub.val = b;
-
-	float128_u res;
-
-	if (ua.data.parts.sign != ub.data.parts.sign) {
-		ub.data.parts.sign = !ub.data.parts.sign;
-		res.data = add_float128(ua.data, ub.data);
-	} else
-		res.data = sub_float128(ua.data, ub.data);
-
-	return res.val;
-}
-
-void _Qp_sub(float128_t *c, float128_t *a, float128_t *b)
-{
-	*c = __subtf3(*a, *b);
-}
-
-#endif
-
-/** @}
- */
Index: uspace/lib/softfloat/sub.h
===================================================================
--- uspace/lib/softfloat/sub.h	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/*
- * Copyright (c) 2005 Josef Cejka
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softfloat
- * @{
- */
-/** @file Substraction functions.
- */
-
-#ifndef __SUB_H__
-#define __SUB_H__
-
-#include <mathtypes.h>
-
-extern float32 sub_float32(float32, float32);
-extern float64 sub_float64(float64, float64);
-extern float96 sub_float96(float96, float96);
-extern float128 sub_float128(float128, float128);
-
-#ifdef float32_t
-extern float32_t __subsf3(float32_t, float32_t);
-extern float32_t __aeabi_fsub(float32_t, float32_t);
-#endif
-
-#ifdef float64_t
-extern float64_t __subdf3(float64_t, float64_t);
-extern float64_t __aeabi_dsub(float64_t, float64_t);
-#endif
-
-#ifdef float128_t
-extern float128_t __subtf3(float128_t, float128_t);
-extern void _Qp_sub(float128_t *, float128_t *, float128_t *);
-#endif
-
-#endif
-
-/** @}
- */
Index: uspace/lib/softint/Makefile
===================================================================
--- uspace/lib/softint/Makefile	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,41 +1,0 @@
-#
-# Copyright (c) 2005 Martin Decky
-# Copyright (c) 2007 Jakub Jermar
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# - Redistributions of source code must retain the above copyright
-#   notice, this list of conditions and the following disclaimer.
-# - Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in the
-#   documentation and/or other materials provided with the distribution.
-# - The name of the author may not be used to endorse or promote products
-#   derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-USPACE_PREFIX = ../..
-EXTRA_CFLAGS = -Iinclude
-LIBRARY = libsoftint
-
-SOURCES = \
-	generic/bits.c \
-	generic/comparison.c \
-	generic/division.c \
-	generic/multiplication.c \
-	generic/shift.c
-
-include $(USPACE_PREFIX)/Makefile.common
Index: uspace/lib/softint/generic/bits.c
===================================================================
--- uspace/lib/softint/generic/bits.c	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,118 +1,0 @@
-/*
- * Copyright (c) 2013 Vojtech Horky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softint
- * @{
- */
-
-#include <bits.h>
-
-/** Compute number of trailing 0-bits in a number. */
-int __ctzdi2(long a)
-{
-	unsigned int bits = 0;
-	while (((a >> bits) & 1) == 0) {
-		bits++;
-		if (bits >= sizeof(a) * 8) {
-			break;
-		}
-	}
-
-	return bits;
-}
-
-/** Compute number of trailing 0-bits in a number. */
-int __ctzsi2(int a)
-{
-	unsigned int bits = 0;
-	while (((a >> bits) & 1) == 0) {
-		bits++;
-		if (bits >= sizeof(a) * 8) {
-			break;
-		}
-	}
-
-	return bits;
-}
-
-/** Compute number of leading 0-bits in a number. */
-int __clzdi2(long a)
-{
-	int index = sizeof(a) * 8 - 1;
-	int bits = 0;
-	while (index >= 0) {
-		if (((a >> index) & 1) == 0) {
-			bits++;
-		} else {
-			break;
-		}
-		index--;
-	}
-
-	return bits;
-}
-
-/** Compute index of the first 1-bit in a number increased by one.
- *
- * If the number is zero, zero is returned.
- */
-int __ffsdi2(long a)
-{
-	if (a == 0) {
-		return 0;
-	}
-
-	return 1 + __ctzdi2(a);
-}
-
-/** Compute number of set bits in a number. */
-int __popcountsi2(int a)
-{
-	int bits = 0;
-	for (unsigned int i = 0; i < sizeof(a) * 8; i++)	 {
-		if (((a >> i) & 1) != 0) {
-			bits++;
-		}
-	}
-	return bits;
-}
-
-/** Compute number of set bits in a number. */
-int __popcountdi2(long a)
-{
-	int bits = 0;
-	for (unsigned int i = 0; i < sizeof(a) * 8; i++)	 {
-		if (((a >> i) & 1) != 0) {
-			bits++;
-		}
-	}
-	return bits;
-}
-
-/** @}
- */
Index: uspace/lib/softint/generic/comparison.c
===================================================================
--- uspace/lib/softint/generic/comparison.c	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,90 +1,0 @@
-/*
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softint
- * @{
- */
-/**
- * @file Signed and unsigned comparisons.
- */
-
-#include <comparison.h>
-#include <lltype.h>
-
-#define LESSER  0;
-#define EQUAL   1;
-#define GREATER 2;
-
-int __cmpdi2 (long long a, long long b)
-{
-	union lltype lla;
-	union lltype llb;
-
-	lla.s_whole = a;
-	llb.s_whole = b;
-
-	if (lla.s_half[HI] < llb.s_half[HI]) {
-		return LESSER;
-	} else if (lla.s_half[HI] > llb.s_half[HI]) {
-		return GREATER;
-	} else {
-		if (lla.u_half[LO] < llb.u_half[LO]) {
-			return LESSER;
-		} else if (lla.u_half[LO] > llb.u_half[LO]) {
-			return GREATER;
-		} else {
-			return EQUAL;
-		}
-	}
-}
-
-int __ucmpdi2 (unsigned long long a, unsigned long long b)
-{
-	union lltype lla;
-	union lltype llb;
-
-	lla.u_whole = a;
-	llb.u_whole = b;
-
-	if (lla.u_half[HI] < llb.u_half[HI]) {
-		return LESSER;
-	} else if (lla.u_half[HI] > llb.u_half[HI]) {
-		return GREATER;
-	} else {
-		if (lla.u_half[LO] < llb.u_half[LO]) {
-			return LESSER;
-		} else if (lla.u_half[LO] > llb.u_half[LO]) {
-			return GREATER;
-		} else {
-			return EQUAL;
-		}
-	}
-}
-
-/** @}
- */
Index: uspace/lib/softint/generic/division.c
===================================================================
--- uspace/lib/softint/generic/division.c	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,251 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softint
- * @{
- */
-/**
- * @file
- * SW implementation of 32 and 64 bit division and modulo.
- */
-
-#include <division.h>
-
-#define ABSVAL(x)  ((x) > 0 ? (x) : -(x))
-#define SGN(x)     ((x) >= 0 ? 1 : 0)
-
-static unsigned int divandmod32(unsigned int a, unsigned int b,
-    unsigned int *remainder)
-{
-	unsigned int result;
-	int steps = sizeof(unsigned int) * 8;
-
-	*remainder = 0;
-	result = 0;
-
-	if (b == 0) {
-		/* FIXME: division by zero */
-		return 0;
-	}
-
-	if (a < b) {
-		*remainder = a;
-		return 0;
-	}
-
-	for (; steps > 0; steps--) {
-		/* shift one bit to remainder */
-		*remainder = ((*remainder) << 1) | ((a >> 31) & 0x1);
-		result <<= 1;
-
-		if (*remainder >= b) {
-			*remainder -= b;
-			result |= 0x1;
-		}
-		a <<= 1;
-	}
-
-	return result;
-}
-
-static unsigned long long divandmod64(unsigned long long a,
-    unsigned long long b, unsigned long long *remainder)
-{
-	unsigned long long result;
-	int steps = sizeof(unsigned long long) * 8;
-
-	*remainder = 0;
-	result = 0;
-
-	if (b == 0) {
-		/* FIXME: division by zero */
-		return 0;
-	}
-
-	if (a < b) {
-		*remainder = a;
-		return 0;
-	}
-
-	for (; steps > 0; steps--) {
-		/* shift one bit to remainder */
-		*remainder = ((*remainder) << 1) | ((a >> 63) & 0x1);
-		result <<= 1;
-
-		if (*remainder >= b) {
-			*remainder -= b;
-			result |= 0x1;
-		}
-		a <<= 1;
-	}
-
-	return result;
-}
-
-/* 32bit integer division */
-int __divsi3(int a, int b)
-{
-	unsigned int rem;
-	int result = (int) divandmod32(ABSVAL(a), ABSVAL(b), &rem);
-
-	if (SGN(a) == SGN(b))
-		return result;
-
-	return -result;
-}
-
-/* 64bit integer division */
-long long __divdi3(long long a, long long b)
-{
-	unsigned long long rem;
-	long long result = (long long) divandmod64(ABSVAL(a), ABSVAL(b), &rem);
-
-	if (SGN(a) == SGN(b))
-		return result;
-
-	return -result;
-}
-
-/* 32bit unsigned integer division */
-unsigned int __udivsi3(unsigned int a, unsigned int b)
-{
-	unsigned int rem;
-	return divandmod32(a, b, &rem);
-}
-
-/* 64bit unsigned integer division */
-unsigned long long __udivdi3(unsigned long long a, unsigned long long b)
-{
-	unsigned long long rem;
-	return divandmod64(a, b, &rem);
-}
-
-/* 32bit remainder of the signed division */
-int __modsi3(int a, int b)
-{
-	unsigned int rem;
-	divandmod32(a, b, &rem);
-
-	/* if divident is negative, remainder must be too */
-	if (!(SGN(a)))
-		return -((int) rem);
-
-	return (int) rem;
-}
-
-/* 64bit remainder of the signed division */
-long long __moddi3(long long a, long long b)
-{
-	unsigned long long rem;
-	divandmod64(a, b, &rem);
-
-	/* if divident is negative, remainder must be too */
-	if (!(SGN(a)))
-		return -((long long) rem);
-
-	return (long long) rem;
-}
-
-/* 32bit remainder of the unsigned division */
-unsigned int __umodsi3(unsigned int a, unsigned int b)
-{
-	unsigned int rem;
-	divandmod32(a, b, &rem);
-	return rem;
-}
-
-/* 64bit remainder of the unsigned division */
-unsigned long long __umoddi3(unsigned long long a, unsigned long long b)
-{
-	unsigned long long rem;
-	divandmod64(a, b, &rem);
-	return rem;
-}
-
-int __divmodsi3(int a, int b, int *c)
-{
-	unsigned int rem;
-	int result = (int) divandmod32(ABSVAL(a), ABSVAL(b), &rem);
-
-	if (SGN(a) == SGN(b)) {
-		*c = rem;
-		return result;
-	}
-
-	*c = -rem;
-	return -result;
-}
-
-unsigned int __udivmodsi3(unsigned int a, unsigned int b,
-    unsigned int *c)
-{
-	return divandmod32(a, b, c);
-}
-
-long long __divmoddi3(long long a, long long b, long long *c)
-{
-	unsigned long long rem;
-	long long result = (int) divandmod64(ABSVAL(a), ABSVAL(b), &rem);
-
-	if (SGN(a) == SGN(b)) {
-		*c = rem;
-		return result;
-	}
-
-	*c = -rem;
-	return -result;
-}
-
-long long __divmoddi4(long long a, long long b, long long *c)
-{
-	unsigned long long rem;
-	long long result = (int) divandmod64(ABSVAL(a), ABSVAL(b), &rem);
-
-	if (SGN(a) == SGN(b)) {
-		*c = rem;
-		return result;
-	}
-
-	*c = -rem;
-	return -result;
-}
-
-unsigned long long __udivmoddi3(unsigned long long a, unsigned long long b,
-    unsigned long long *c)
-{
-	return divandmod64(a, b, c);
-}
-
-unsigned long long __udivmoddi4(unsigned long long a, unsigned long long b,
-    unsigned long long *c)
-{
-	return divandmod64(a, b, c);
-}
-
-/** @}
- */
Index: uspace/lib/softint/generic/multiplication.c
===================================================================
--- uspace/lib/softint/generic/multiplication.c	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,127 +1,0 @@
-/*
- * Copyright (c) 2009 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softint
- * @{
- */
-/**
- * @file
- * SW implementation of 32 and 64 bit multiplication.
- */
-
-#include <multiplication.h>
-#include <stdint.h>
-
-/** Set 1 to return INT64_MAX or INT64_MIN on overflow */
-#ifndef SOFTINT_CHECK_OF
-#define SOFTINT_CHECK_OF  0
-#endif
-
-/** Multiply two integers and return long long as result.
- *
- * This function is overflow safe.
- *
- */
-static unsigned long long mul(unsigned int a, unsigned int b)
-{
-	unsigned int a1 = a >> 16;
-	unsigned int a2 = a & UINT16_MAX;
-	unsigned int b1 = b >> 16;
-	unsigned int b2 = b & UINT16_MAX;
-
-	unsigned long long t1 = a1 * b1;
-	unsigned long long t2 = a1 * b2;
-	t2 += a2 * b1;
-	unsigned long long t3 = a2 * b2;
-
-	t3 = (((t1 << 16) + t2) << 16) + t3;
-
-	return t3;
-}
-
-/** Emulate multiplication of two 64-bit long long integers.
- *
- */
-long long __muldi3 (long long a, long long b)
-{
-	char neg = 0;
-
-	if (a < 0) {
-		neg = !neg;
-		a = -a;
-	}
-
-	if (b < 0) {
-		neg = !neg;
-		b = -b;
-	}
-
-	unsigned long long a1 = a >> 32;
-	unsigned long long b1 = b >> 32;
-
-	unsigned long long a2 = a & (UINT32_MAX);
-	unsigned long long b2 = b & (UINT32_MAX);
-
-	if (SOFTINT_CHECK_OF && (a1 != 0) && (b1 != 0)) {
-		/* Error (overflow) */
-		return (neg ? INT64_MIN : INT64_MAX);
-	}
-
-	/*
-	 * (if OF checked) a1 or b1 is zero => result fits in 64 bits,
-	 * no need to another overflow check
-	 */
-	unsigned long long t1 = mul(a1, b2) + mul(b1, a2);
-
-	if ((SOFTINT_CHECK_OF) && (t1 > UINT32_MAX)) {
-		/* Error (overflow) */
-		return (neg ? INT64_MIN : INT64_MAX);
-	}
-
-	t1 = t1 << 32;
-	unsigned long long t2 = mul(a2, b2);
-	t2 += t1;
-
-	/*
-	 * t2 & (1ull << 63) - if this bit is set in unsigned long long,
-	 * result does not fit in signed one
-	 */
-	if (SOFTINT_CHECK_OF && ((t2 < t1) || (t2 & (1ull << 63)))) {
-		/* Error, overflow */
-		return (neg ? INT64_MIN : INT64_MAX);
-	}
-
-	long long result = t2;
-	if (neg)
-		result = -result;
-
-	return result;
-}
-
-/** @}
- */
Index: uspace/lib/softint/generic/shift.c
===================================================================
--- uspace/lib/softint/generic/shift.c	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,136 +1,0 @@
-/*
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softint
- * @{
- */
-/**
- * @file Logical and arithmetic shifts.
- */
-
-#include <shift.h>
-#include <lltype.h>
-
-long long __ashldi3 (long long val, int shift)
-{
-	union lltype ll;
-
-	ll.s_whole = val;
-
-	if (shift <= 0) {
-		return ll.s_whole;
-	}
-
-	if (shift >= (int) WHOLE_BIT_CNT) {
-		ll.u_half[HI] = 0;
-		ll.u_half[LO] = 0;
-		return ll.s_whole;
-	}
-
-	if (shift >= (int) HALF_BIT_CNT) {
-		ll.u_half[HI] = ll.u_half[LO] << (shift - HALF_BIT_CNT);
-		ll.u_half[LO] = 0;
-	} else {
-		ll.u_half[HI] <<= shift;
-		ll.u_half[HI] |= ll.u_half[LO] >> (HALF_BIT_CNT - shift);
-		ll.u_half[LO] <<= shift;
-	}
-
-	return ll.s_whole;
-}
-
-long long __ashrdi3 (long long val, int shift)
-{
-	union lltype ll;
-
-	ll.s_whole = val;
-
-	if (shift <= 0) {
-		return ll.s_whole;
-	}
-
-	long fill = ll.s_half[HI] >> (HALF_BIT_CNT - 1);
-
-	if (shift >= (int) WHOLE_BIT_CNT) {
-		ll.s_half[HI] = fill;
-		ll.s_half[LO] = fill;
-		return ll.s_whole;
-	}
-
-	if (shift >= (int) HALF_BIT_CNT) {
-		ll.s_half[LO] = ll.s_half[HI] >> (shift - HALF_BIT_CNT);
-		ll.s_half[HI] = fill;
-	} else {
-		ll.u_half[LO] >>= shift;
-		ll.u_half[LO] |= ll.u_half[HI] << (HALF_BIT_CNT - shift);
-		ll.s_half[HI] >>= shift;
-	}
-
-	return ll.s_whole;
-}
-
-long long __lshrdi3 (long long val, int shift)
-{
-	union lltype ll;
-
-	ll.s_whole = val;
-
-	if (shift <= 0) {
-		return ll.s_whole;
-	}
-
-	if (shift >= (int) WHOLE_BIT_CNT) {
-		ll.u_half[HI] = 0;
-		ll.u_half[LO] = 0;
-		return ll.s_whole;
-	}
-
-	if (shift >= (int) HALF_BIT_CNT) {
-		ll.u_half[LO] = ll.u_half[HI] >> (shift - HALF_BIT_CNT);
-		ll.u_half[HI] = 0;
-	} else {
-		ll.u_half[LO] >>= shift;
-		ll.u_half[LO] |= ll.u_half[HI] << (HALF_BIT_CNT - shift);
-		ll.u_half[HI] >>= shift;
-	}
-
-	return ll.s_whole;
-}
-
-long long __aeabi_llsl(long long val, int shift)
-{
-	return __ashldi3(val, shift);
-}
-
-long long __aeabi_llsr(long long val, int shift)
-{
-	return __lshrdi3(val, shift);
-}
-
-/** @}
- */
Index: uspace/lib/softint/include/bits.h
===================================================================
--- uspace/lib/softint/include/bits.h	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,49 +1,0 @@
-/*
- * Copyright (c) 2013 Vojtech Horky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softint
- * @{
- */
-/** @file
- */
-
-#ifndef __SOFTINT_BITS_H_
-#define __SOFTINT_BITS_H_
-
-extern int __ctzdi2(long);
-extern int __ctzsi2(int);
-extern int __clzdi2(long);
-extern int __ffsdi2(long);
-extern int __popcountsi2(int);
-extern int __popcountdi2(long);
-
-
-#endif
-
-/** @}
- */
Index: uspace/lib/softint/include/comparison.h
===================================================================
--- uspace/lib/softint/include/comparison.h	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/*
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softint
- * @{
- */
-/**
- * @file Signed and unsigned comparisons.
- */
-
-#ifndef __SOFTINT_COMPARISON_H__
-#define __SOFTINT_COMPARISON_H__
-
-/* Signed comparison (a < b => 0, a == b => 1, a > b => 2). */
-extern int __cmpdi2(long long, long long);
-
-/* Unsigned comparison (a < b => 0, a == b => 1, a > b => 2). */
-extern int __ucmpdi2(unsigned long long, unsigned long long);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/softint/include/division.h
===================================================================
--- uspace/lib/softint/include/division.h	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/*
- * Copyright (c) 2006 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softint
- * @{
- */
-/**
- * @file
- */
-
-#ifndef __SOFTINT_DIVISION_H__
-#define __SOFTINT_DIVISION_H__
-
-extern int __divsi3(int, int);
-extern long long __divdi3(long long, long long);
-
-extern unsigned int __udivsi3(unsigned int, unsigned int);
-extern unsigned long long __udivdi3(unsigned long long, unsigned long long);
-
-extern int __modsi3(int, int);
-extern long long __moddi3(long long, long long);
-
-extern unsigned int __umodsi3(unsigned int, unsigned int);
-extern unsigned long long __umoddi3(unsigned long long, unsigned long long);
-
-extern int __divmodsi3(int, int, int *);
-extern unsigned int __udivmodsi3(unsigned int, unsigned int, unsigned int *);
-
-extern long long __divmoddi3(long long, long long, long long *);
-extern long long __divmoddi4(long long, long long, long long *);
-extern unsigned long long __udivmoddi3(unsigned long long, unsigned long long,
-    unsigned long long *);
-extern unsigned long long __udivmoddi4(unsigned long long, unsigned long long,
-    unsigned long long *);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/softint/include/lltype.h
===================================================================
--- uspace/lib/softint/include/lltype.h	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/*
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softint
- * @{
- */
-/**
- * @file Abstraction over 64-bit integral type to allow simple manipulation.
- */
-
-#ifndef __SOFTINT_LLTYPE_H__
-#define __SOFTINT_LLTYPE_H__
-
-#include <stdint.h>
-
-#define HALF_BIT_CNT   (sizeof(int32_t) * sizeof(char))
-#define WHOLE_BIT_CNT  (sizeof(int64_t) * sizeof(char))
-
-#ifdef __BE__
-#define LO 1
-#define HI 0
-#else
-#define LO 0
-#define HI 1
-#endif
-
-union lltype {
-	int64_t s_whole;
-	uint64_t u_whole;
-	int32_t s_half[2];
-	uint32_t u_half[2];
-};
-
-#endif
-
-/** @}
- */
Index: uspace/lib/softint/include/multiplication.h
===================================================================
--- uspace/lib/softint/include/multiplication.h	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,47 +1,0 @@
-/*
- * Copyright (c) 2009 Josef Cejka
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softint
- * @{
- */
-/**
- * @file
- */
-
-#ifndef __SOFTINT_MULTIPLICATION_H__
-#define __SOFTINT_MULTIPLICATION_H__
-
-/* 64 bit multiplication */
-extern long long __muldi3(long long, long long);
-
-#endif
-
-/** @}
- */
-
-
Index: uspace/lib/softint/include/shift.h
===================================================================
--- uspace/lib/softint/include/shift.h	(revision 848740c9426c4efa097f990344c896405c19c59d)
+++ 	(revision )
@@ -1,56 +1,0 @@
-/*
- * Copyright (c) 2011 Petr Koupy
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup softint
- * @{
- */
-/**
- * @file Logical and arithmetic shifts.
- */
-
-#ifndef __SOFTINT_SHIFT_H__
-#define __SOFTINT_SHIFT_H__
-
-/* Arithmetic/logical shift left. */
-extern long long __ashldi3(long long, int);
-
-/* Arithmetic shift right. */
-extern long long __ashrdi3(long long, int);
-
-/* Logical shift right. */
-extern long long __lshrdi3(long long, int);
-
-
-/* ARM EABI */
-extern long long __aeabi_llsl(long long, int);
-extern long long __aeabi_llsr(long long, int);
-
-#endif
-
-/** @}
- */
