Index: softfloat/generic/comparison.c
===================================================================
--- softfloat/generic/comparison.c	(revision 3af72dca342b59a46ccdece60c8c361608702518)
+++ softfloat/generic/comparison.c	(revision feef1cd3702ab8f3d1f357fb02cfdceb1a73b3e3)
@@ -35,7 +35,17 @@
 };
 
+inline int isFloat64NaN(float64 d)
+{	/* NaN : exp = 0x7ff and nonzero mantisa */
+	return ((d.parts.exp==0x7FF)&&(d.parts.mantisa));
+};
+
 inline int isFloat32SigNaN(float32 f)
 {	/* SigNaN : exp = 0xff mantisa = 1xxxxx..x (binary), where at least one x is nonzero */
 	return ((f.parts.exp==0xFF)&&(f.parts.mantisa>0x400000));
+};
+
+inline int isFloat64SigNaN(float64 d)
+{	/* SigNaN : exp = 0x7ff mantisa = 1xxxxx..x (binary), where at least one x is nonzero */
+	return ((d.parts.exp==0x7FF)&&(d.parts.mantisa>0x8000000000000ll));
 };
 
@@ -45,7 +55,17 @@
 };
 
+inline int isFloat64Infinity(float64 d) 
+{
+	return ((d.parts.exp==0x7FF)&&(d.parts.mantisa==0x0));
+};
+
 inline int isFloat32Zero(float32 f)
 {
 	return (((f.binary) & 0x7FFFFFFF) == 0);
+}
+
+inline int isFloat64Zero(float64 d)
+{
+	return (((d.binary) & 0x7FFFFFFFFFFFFFFFll) == 0);
 }
 
@@ -101,2 +121,3 @@
 
 
+
Index: softfloat/generic/conversion.c
===================================================================
--- softfloat/generic/conversion.c	(revision 3af72dca342b59a46ccdece60c8c361608702518)
+++ softfloat/generic/conversion.c	(revision feef1cd3702ab8f3d1f357fb02cfdceb1a73b3e3)
@@ -27,2 +27,110 @@
  */
 
+#include "sftypes.h"
+#include "conversion.h"
+
+float64 convertFloat32ToFloat64(float32 a) 
+{
+	float64 result;
+	__u64 mant;
+	
+	result.parts.sign = a.parts.sign;
+	result.parts.mantisa = a.parts.mantisa;
+	result.parts.mantisa <<= (FLOAT64_MANTISA_SIZE - FLOAT32_MANTISA_SIZE );
+	
+	if ((isFloat32Infinity(a))||(isFloat32NaN(a))) {
+		result.parts.exp = 0x7FF;
+		/* 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.mantisa == 0ll) { /* fix zero */
+			result.parts.exp = 0ll;
+			return result;
+		}
+			
+		mant = result.parts.mantisa;
+		
+		while (!(mant & (0x10000000000000ll))) {
+			mant <<= 1;
+			--result.parts.exp;
+		};
+		result.parts.mantisa = mant;
+	};
+	
+	return result;
+	
+};
+
+float32 convertFloat64ToFloat32(float64 a) 
+{
+	float32 result;
+	__s32 exp;
+	__u64 mant;
+	
+	result.parts.sign = a.parts.sign;
+	
+	if (isFloat64NaN(a)) {
+		
+		result.parts.exp = 0xFF;
+		
+		if (isFloat64SigNaN(a)) {
+			result.parts.mantisa = 0x800000; /* set first bit of mantisa nonzero */
+			return result;
+		}
+	
+		result.parts.mantisa = 0x1; /* mantisa nonzero but its first bit is zero */
+		return result;
+	};
+
+	if (isFloat64Infinity(a)) {
+		result.parts.mantisa = 0;
+		result.parts.exp = 0xFF;
+		return result;
+	};
+
+	exp = (int)a.parts.exp - FLOAT64_BIAS + FLOAT32_BIAS;
+	
+	if (exp >= 0xFF) {
+		/*FIXME: overflow*/
+		result.parts.mantisa = 0;
+		result.parts.exp = 0xFF;
+		return result;
+		
+	} else if (exp <= 0 ) {
+		
+		/* underflow or denormalized */
+		
+		result.parts.exp = 0;
+		
+		exp *= -1;	
+		
+		if (exp > FLOAT32_MANTISA_SIZE ) {
+			/* FIXME: underflow */
+			result.parts.mantisa = 0;
+			return result;
+		};
+		
+		/* denormalized */
+		
+		mant = result.parts.mantisa >> 1; 
+		mant |= 0x10000000000000ll; /* denormalize and set hidden bit */
+		
+		while (exp > 0) {
+			--exp;
+			mant >>= 1;
+		};
+		result.parts.mantisa = mant;
+		
+		return result;
+	};
+
+	result.parts.exp = exp;
+	result.parts.mantisa = a.parts.mantisa >> (FLOAT64_MANTISA_SIZE - FLOAT32_MANTISA_SIZE);
+	return result;
+};
+
Index: softfloat/generic/softfloat.c
===================================================================
--- softfloat/generic/softfloat.c	(revision 3af72dca342b59a46ccdece60c8c361608702518)
+++ softfloat/generic/softfloat.c	(revision feef1cd3702ab8f3d1f357fb02cfdceb1a73b3e3)
@@ -72,4 +72,12 @@
 }
 
+float __divsf3(float a, float b) 
+{
+	float32 fa, fb;
+	fa.f=a;
+	fb.f=b;
+//	return 	divFloat32(fa, fb).f;
+};
+
 float __negsf2(float a)
 {
@@ -90,4 +98,17 @@
 /* Conversion functions */
 
+double __extendsfdf2(float a) 
+{
+	float32 fa;
+	fa.f = a;
+	return convertFloat32ToFloat64(fa).d;
+};
+
+float __truncdfsf2(double a) 
+{
+	float64 da;
+	da.d = a;
+	return convertFloat64ToFloat32(da).f;
+}
 /* Comparison functions */
 
Index: softfloat/include/comparison.h
===================================================================
--- softfloat/include/comparison.h	(revision 3af72dca342b59a46ccdece60c8c361608702518)
+++ softfloat/include/comparison.h	(revision feef1cd3702ab8f3d1f357fb02cfdceb1a73b3e3)
@@ -36,4 +36,10 @@
 inline int isFloat32Zero(float32 f);
 
+inline int isFloat64NaN(float64 d);
+inline int isFloat64SigNaN(float64 d);
+
+inline int isFloat64Infinity(float64 d);
+inline int isFloat64Zero(float64 d);
+
 inline int isFloat32eq(float32 a, float32 b);
 inline int isFloat32lt(float32 a, float32 b);
Index: softfloat/include/conversion.h
===================================================================
--- softfloat/include/conversion.h	(revision 3af72dca342b59a46ccdece60c8c361608702518)
+++ softfloat/include/conversion.h	(revision feef1cd3702ab8f3d1f357fb02cfdceb1a73b3e3)
@@ -30,4 +30,8 @@
 #define __CONVERSION_H__
 
+float64 convertFloat32ToFloat64(float32 a);
+
+float32 convertFloat64ToFloat32(float64 a);
+
 #endif
 
Index: softfloat/include/sftypes.h
===================================================================
--- softfloat/include/sftypes.h	(revision 3af72dca342b59a46ccdece60c8c361608702518)
+++ softfloat/include/sftypes.h	(revision feef1cd3702ab8f3d1f357fb02cfdceb1a73b3e3)
@@ -29,5 +29,4 @@
 #ifndef __SFTYPES_H__
 #define __SFTYPES_H__
-
 
 typedef union {
@@ -80,4 +79,5 @@
 
 #define FLOAT32_MANTISA_SIZE 23
+#define FLOAT64_MANTISA_SIZE 52
 
 #define FLOAT32_BIAS 0x7F
