Index: softfloat/arch/ia32/include/arch.h
===================================================================
--- softfloat/arch/ia32/include/arch.h	(revision afffa1e44aef43386339b85a639e4fef30603a8a)
+++ softfloat/arch/ia32/include/arch.h	(revision afffa1e44aef43386339b85a639e4fef30603a8a)
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+#ifndef __ia32_ARCH_H__
+#define __ia32_ARCH_H__
+
+#define __LITTLE_ENDIAN__ 
+
+#endif
Index: softfloat/arch/ia32/include/functions.h
===================================================================
--- softfloat/arch/ia32/include/functions.h	(revision afffa1e44aef43386339b85a639e4fef30603a8a)
+++ softfloat/arch/ia32/include/functions.h	(revision afffa1e44aef43386339b85a639e4fef30603a8a)
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+
+#ifndef __ia32_FUNCTIONS_H__
+#define __ia32_FUNCTIONS_H__
+
+#define float32_to_int(X) float32_to_int32(X);
+#define float32_to_long(X) float32_to_int32(X);
+#define float32_to_longlong(X) float32_to_int64(X);
+
+#define float64_to_int(X) float64_to_int32(X);
+#define float64_to_long(X) float64_to_int32(X);
+#define float64_to_longlong(X) float64_to_int64(X);
+
+#define float32_to_uint(X) float32_to_uint32(X);
+#define float32_to_ulong(X) float32_to_uint32(X);
+#define float32_to_ulonglong(X) float32_to_uint64(X);
+
+#endif
Index: softfloat/arch/ia32/include/types.h
===================================================================
--- softfloat/arch/ia32/include/types.h	(revision afffa1e44aef43386339b85a639e4fef30603a8a)
+++ softfloat/arch/ia32/include/types.h	(revision afffa1e44aef43386339b85a639e4fef30603a8a)
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+
+#ifndef __ia32_TYPES_H__
+#define __ia32_TYPES_H__
+
+typedef char __s8;
+typedef short __s16;
+typedef long __s32;
+typedef long long __s64;
+
+typedef unsigned char __u8;
+typedef unsigned short __u16;
+typedef unsigned long __u32;
+typedef unsigned long long __u64;
+
+#define MAX_INT32 (0x7FFFFFFF)
+#define MIN_INT32 (0x80000000)
+
+#define MAX_UINT32 (0xFFFFFFFF)
+#define MIN_UINT32 (0)
+
+#define MAX_INT64 (0x7FFFFFFFFFFFFFFFll)
+#define MIN_INT64 (0x8000000000000000ll)
+
+#define MAX_UINT64 (0xFFFFFFFFFFFFFFFll)
+#define MIN_UINT64 (0ll)
+
+
+
+#endif
+
Index: softfloat/generic/conversion.c
===================================================================
--- softfloat/generic/conversion.c	(revision d9f51ccca28f7f0d2f420bdcd72ea70a1d5c9431)
+++ softfloat/generic/conversion.c	(revision afffa1e44aef43386339b85a639e4fef30603a8a)
@@ -29,4 +29,5 @@
 #include "sftypes.h"
 #include "conversion.h"
+#include "comparison.h"
 
 float64 convertFloat32ToFloat64(float32 a) 
@@ -67,5 +68,5 @@
 	return result;
 	
-};
+}
 
 float32 convertFloat64ToFloat32(float64 a) 
@@ -136,4 +137,74 @@
 	result.parts.fraction = a.parts.fraction >> (FLOAT64_FRACTION_SIZE - FLOAT32_FRACTION_SIZE);
 	return result;
-};
-
+}
+
+
+/** Helping procedure for converting float32 to uint32
+ * @param a floating point number in normalized form (no NaNs or Inf are checked )
+ * @return unsigned integer
+ */
+static __u32 _float32_to_uint32_helper(float32 a)
+{
+	__u32 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;
+}
+
+/* Convert float to unsigned int32
+ * FIXME: Im not sure what to return if overflow/underflow happens 
+ * 	- now its the biggest or the smallest int
+ */ 
+__u32 float32_to_uint32(float32 a)
+{
+	if (isFloat32NaN(a)) {
+		return MAX_UINT32;
+	}
+	
+	if (isFloat32Infinity(a) || (a.parts.exp >= (32 + FLOAT32_BIAS)))  {
+		if (a.parts.sign) {
+			return MIN_UINT32;
+		}
+		return MAX_UINT32;
+	}
+	
+	return _float32_to_uint32_helper(a);	
+}
+
+/* Convert float to signed int32
+ * FIXME: Im not sure what to return if overflow/underflow happens 
+ * 	- now its the biggest or the smallest int
+ */ 
+__s32 float32_to_int32(float32 a)
+{
+	if (isFloat32NaN(a)) {
+		return MAX_INT32;
+	}
+	
+	if (isFloat32Infinity(a) || (a.parts.exp >= (32 + FLOAT32_BIAS)))  {
+		if (a.parts.sign) {
+			return MIN_INT32;
+		}
+		return MAX_INT32;
+	}
+	return _float32_to_uint32_helper(a);
+}	
+
+
+
Index: softfloat/generic/softfloat.c
===================================================================
--- softfloat/generic/softfloat.c	(revision d9f51ccca28f7f0d2f420bdcd72ea70a1d5c9431)
+++ softfloat/generic/softfloat.c	(revision afffa1e44aef43386339b85a639e4fef30603a8a)
@@ -39,4 +39,8 @@
 #include<other.h>
 
+#include<arch.h>
+#include<types.h>
+#include<functions.h>
+
 /* Arithmetic functions */
 
@@ -161,4 +165,105 @@
 }
 
+int __fixsfsi(float a)
+{
+	float32 fa;
+	fa.f = a;
+	
+	return float32_to_int(fa);
+}
+int __fixdfsi(double a)
+{
+}
+ 
+long __fixsfdi(float a)
+{
+	float32 fa;
+	fa.f = a;
+	
+	return float32_to_long(fa);
+}
+long __fixdfdi(double a)
+{
+}
+ 
+long long __fixsfti(float a)
+{
+}
+long long __fixdfti(double a)
+{
+}
+
+unsigned int __fixunssfsi(float a)
+{
+	float32 fa;
+	fa.f = a;
+	
+	return float32_to_uint(fa);
+}
+unsigned int __fixunsdfsi(double a)
+{
+}
+ 
+unsigned long __fixunssfdi(float a)
+{
+	float32 fa;
+	fa.f = a;
+	
+	return float32_to_long(fa);
+}
+unsigned long __fixunsdfdi(double a)
+{
+}
+ 
+unsigned long long __fixunssfti(float a)
+{
+}
+unsigned long long __fixunsdfti(double a)
+{
+}
+ 
+float __floatsisf(int i)
+{
+}
+double __floatsidf(int i)
+{
+}
+ 
+float __floatdisf(long i)
+{
+}
+double __floatdidf(long i)
+{
+}
+ 
+float __floattisf(long long i)
+{
+}
+double __floattidf(long long i)
+{
+}
+
+float __floatunsisf(unsigned int i)
+{
+}
+double __floatunsidf(unsigned int i)
+{
+}
+ 
+float __floatundisf(unsigned long i)
+{
+}
+double __floatundidf(unsigned long i)
+{
+}
+ 
+float __floatuntisf(unsigned long long i)
+{
+}
+double __floatuntidf(unsigned long long i)
+{
+}
+
+/* Comparison functions */
 /* Comparison functions */
 
Index: softfloat/include/sftypes.h
===================================================================
--- softfloat/include/sftypes.h	(revision d9f51ccca28f7f0d2f420bdcd72ea70a1d5c9431)
+++ softfloat/include/sftypes.h	(revision afffa1e44aef43386339b85a639e4fef30603a8a)
@@ -29,4 +29,7 @@
 #ifndef __SFTYPES_H__
 #define __SFTYPES_H__
+
+#include <types.h>
+#include <arch.h>
 
 typedef union {
Index: softfloat/include/softfloat.h
===================================================================
--- softfloat/include/softfloat.h	(revision d9f51ccca28f7f0d2f420bdcd72ea70a1d5c9431)
+++ softfloat/include/softfloat.h	(revision afffa1e44aef43386339b85a639e4fef30603a8a)
@@ -112,4 +112,19 @@
 long double __floattixf(long long i);
  
+float __floatunsisf(unsigned int i);
+double __floatunsidf(unsigned int i);
+long double __floatunsitf(unsigned int i);
+long double __floatunsixf(unsigned int i);
+ 
+float __floatundisf(unsigned long i);
+double __floatundidf(unsigned long i);
+long double __floatunditf(unsigned long i);
+long double __floatundixf(unsigned long i);
+ 
+float __floatuntisf(unsigned long long i);
+double __floatuntidf(unsigned long long i);
+long double __floatuntitf(unsigned long long i);
+long double __floatuntixf(unsigned long long i);
+ 
 int __cmpsf2(float a, float b);
 int __cmpdf2(double a, double b);
