Index: uspace/lib/softfloat/include/add.h
===================================================================
--- uspace/lib/softfloat/include/add.h	(revision 750636ac4a65360c44846b7681af6ae46854dd3a)
+++ uspace/lib/softfloat/include/add.h	(revision 0f963cba7b2dd43c6842c525c83b9a01d876d331)
@@ -1,4 +1,5 @@
 /*
  * Copyright (c) 2005 Josef Cejka
+ * Copyright (c) 2011 Petr Koupy
  * All rights reserved.
  *
@@ -30,5 +31,5 @@
  * @{
  */
-/** @file
+/** @file Addition functions.
  */
 
@@ -38,4 +39,5 @@
 extern float32 addFloat32(float32, float32);
 extern float64 addFloat64(float64, float64);
+extern float128 addFloat128(float128, float128);
 
 #endif
Index: uspace/lib/softfloat/include/common.h
===================================================================
--- uspace/lib/softfloat/include/common.h	(revision 750636ac4a65360c44846b7681af6ae46854dd3a)
+++ uspace/lib/softfloat/include/common.h	(revision 0f963cba7b2dd43c6842c525c83b9a01d876d331)
@@ -1,4 +1,5 @@
 /*
  * Copyright (c) 2005 Josef Cejka
+ * Copyright (c) 2011 Petr Koupy
  * All rights reserved.
  *
@@ -30,5 +31,5 @@
  * @{
  */
-/** @file
+/** @file Common helper operations.
  */
 
@@ -39,11 +40,34 @@
 
 extern float64 finishFloat64(int32_t, uint64_t, char);
+extern float128 finishFloat128(int32_t, uint64_t, uint64_t, char, uint64_t);
 
+extern int countZeroes8(uint8_t);
+extern int countZeroes32(uint32_t);
 extern int countZeroes64(uint64_t);
-extern int countZeroes32(uint32_t);
-extern int countZeroes8(uint8_t);
 
 extern void roundFloat32(int32_t *, uint32_t *);
 extern void roundFloat64(int32_t *, uint64_t *);
+extern void roundFloat128(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/include/comparison.h
===================================================================
--- uspace/lib/softfloat/include/comparison.h	(revision 750636ac4a65360c44846b7681af6ae46854dd3a)
+++ uspace/lib/softfloat/include/comparison.h	(revision 0f963cba7b2dd43c6842c525c83b9a01d876d331)
@@ -1,4 +1,5 @@
 /*
  * Copyright (c) 2005 Josef Cejka
+ * Copyright (c) 2011 Petr Koupy
  * All rights reserved.
  *
@@ -30,5 +31,5 @@
  * @{
  */
-/** @file
+/** @file Comparison functions.
  */
 
@@ -42,4 +43,8 @@
 extern int isFloat32Zero(float32);
 
+extern int isFloat32eq(float32, float32);
+extern int isFloat32lt(float32, float32);
+extern int isFloat32gt(float32, float32);
+
 extern int isFloat64NaN(float64);
 extern int isFloat64SigNaN(float64);
@@ -48,7 +53,17 @@
 extern int isFloat64Zero(float64);
 
-extern int isFloat32eq(float32, float32);
-extern int isFloat32lt(float32, float32);
-extern int isFloat32gt(float32, float32);
+extern int isFloat64eq(float64, float64);
+extern int isFloat64lt(float64, float64);
+extern int isFloat64gt(float64, float64);
+
+extern int isFloat128NaN(float128);
+extern int isFloat128SigNaN(float128);
+
+extern int isFloat128Infinity(float128);
+extern int isFloat128Zero(float128);
+
+extern int isFloat128eq(float128, float128);
+extern int isFloat128lt(float128, float128);
+extern int isFloat128gt(float128, float128);
 
 #endif
Index: uspace/lib/softfloat/include/conversion.h
===================================================================
--- uspace/lib/softfloat/include/conversion.h	(revision 750636ac4a65360c44846b7681af6ae46854dd3a)
+++ uspace/lib/softfloat/include/conversion.h	(revision 0f963cba7b2dd43c6842c525c83b9a01d876d331)
@@ -1,4 +1,5 @@
 /*
  * Copyright (c) 2005 Josef Cejka
+ * Copyright (c) 2011 Petr Koupy
  * All rights reserved.
  *
@@ -30,5 +31,5 @@
  * @{
  */
-/** @file
+/** @file Conversion of precision and conversion between integers and floats.
  */
 
@@ -37,5 +38,12 @@
 
 extern float64 convertFloat32ToFloat64(float32);
+extern float128 convertFloat32ToFloat128(float32);
+extern float128 convertFloat64ToFloat128(float64);
+
+
 extern float32 convertFloat64ToFloat32(float64);
+extern float32 convertFloat128ToFloat32(float128);
+extern float64 convertFloat128ToFloat64(float128);
+
 
 extern uint32_t float32_to_uint32(float32);
@@ -45,9 +53,16 @@
 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 float64_to_uint32(float64);
-extern int32_t float64_to_int32(float64);
+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);
@@ -63,4 +78,10 @@
 extern float64 int64_to_float64(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);
+
 #endif
 
Index: uspace/lib/softfloat/include/div.h
===================================================================
--- uspace/lib/softfloat/include/div.h	(revision 750636ac4a65360c44846b7681af6ae46854dd3a)
+++ uspace/lib/softfloat/include/div.h	(revision 0f963cba7b2dd43c6842c525c83b9a01d876d331)
@@ -1,4 +1,5 @@
 /*
  * Copyright (c) 2005 Josef Cejka
+ * Copyright (c) 2011 Petr Koupy
  * All rights reserved.
  *
@@ -30,5 +31,5 @@
  * @{
  */
-/** @file
+/** @file Division functions.
  */
 
@@ -38,6 +39,5 @@
 extern float32 divFloat32(float32, float32);
 extern float64 divFloat64(float64, float64);
-
-extern uint64_t divFloat64estim(uint64_t, uint64_t);
+extern float128 divFloat128(float128, float128);
 
 #endif
Index: uspace/lib/softfloat/include/mul.h
===================================================================
--- uspace/lib/softfloat/include/mul.h	(revision 750636ac4a65360c44846b7681af6ae46854dd3a)
+++ uspace/lib/softfloat/include/mul.h	(revision 0f963cba7b2dd43c6842c525c83b9a01d876d331)
@@ -1,4 +1,5 @@
 /*
  * Copyright (c) 2005 Josef Cejka
+ * Copyright (c) 2011 Petr Koupy
  * All rights reserved.
  *
@@ -30,5 +31,5 @@
  * @{
  */
-/** @file
+/** @file Multiplication functions.
  */
 
@@ -38,6 +39,5 @@
 extern float32 mulFloat32(float32, float32);
 extern float64 mulFloat64(float64, float64);
-
-extern void mul64integers(uint64_t, uint64_t, uint64_t *, uint64_t *);
+extern float128 mulFloat128(float128, float128);
 
 #endif
Index: uspace/lib/softfloat/include/other.h
===================================================================
--- uspace/lib/softfloat/include/other.h	(revision 750636ac4a65360c44846b7681af6ae46854dd3a)
+++ uspace/lib/softfloat/include/other.h	(revision 0f963cba7b2dd43c6842c525c83b9a01d876d331)
@@ -30,5 +30,5 @@
  * @{
  */
-/** @file
+/** @file Other functions (power, complex).
  */
 
Index: uspace/lib/softfloat/include/sftypes.h
===================================================================
--- uspace/lib/softfloat/include/sftypes.h	(revision 750636ac4a65360c44846b7681af6ae46854dd3a)
+++ uspace/lib/softfloat/include/sftypes.h	(revision 0f963cba7b2dd43c6842c525c83b9a01d876d331)
@@ -1,4 +1,5 @@
 /*
  * Copyright (c) 2005 Josef Cejka
+ * Copyright (c) 2011 Petr Koupy
  * All rights reserved.
  *
@@ -30,5 +31,5 @@
  * @{
  */
-/** @file
+/** @file Floating point types and constants.
  */
 
@@ -77,11 +78,37 @@
 } float64;
 
-#define FLOAT32_MAX  0x7f800000
-#define FLOAT32_MIN  0xff800000
-#define FLOAT64_MAX
-#define FLOAT64_MIN
+typedef union {
+	long double ld;
+	struct {
+#if defined(__BE__)
+		uint64_t hi;
+		uint64_t lo;
+#elif defined(__LE__)
+		uint64_t lo;
+		uint64_t hi;
+#else
+	#error Unknown endianess
+#endif
+	} binary;
+
+	struct {
+#if defined(__BE__)
+		uint64_t sign : 1;
+		uint64_t exp : 15;
+		uint64_t frac_hi : 48;
+		uint64_t frac_lo : 64;
+#elif defined(__LE__)
+		uint64_t frac_lo : 64;
+		uint64_t frac_hi : 48;
+		uint64_t exp : 15;
+		uint64_t sign : 1;
+#else
+	#error Unknown endianess
+#endif
+	} parts __attribute__ ((packed));
+} float128;
 
 /*
- * For recognizing NaNs or infinity use isFloat32NaN and is Float32Inf,
+ * For recognizing NaNs or infinity use specialized comparison functions,
  * comparing with these constants is not sufficient.
  */
@@ -95,16 +122,30 @@
 #define FLOAT64_INF     0x7FF0000000000000ll
 
-#define FLOAT32_FRACTION_SIZE  23
-#define FLOAT64_FRACTION_SIZE  52
+#define FLOAT128_NAN_HI     0x7FFF800000000000ll
+#define FLOAT128_NAN_LO     0x0000000000000001ll
+#define FLOAT128_SIGNAN_HI  0x7FFF000000000000ll
+#define FLOAT128_SIGNAN_LO  0x0000000000000001ll
+#define FLOAT128_INF_HI     0x7FFF000000000000ll
+#define FLOAT128_INF_LO     0x0000000000000000ll
 
-#define FLOAT32_HIDDEN_BIT_MASK  0x800000
-#define FLOAT64_HIDDEN_BIT_MASK  0x10000000000000ll
+#define FLOAT32_FRACTION_SIZE   23
+#define FLOAT64_FRACTION_SIZE   52
+#define FLOAT128_FRACTION_SIZE 112
+#define FLOAT128_FRAC_HI_SIZE   48
+#define FLOAT128_FRAC_LO_SIZE   64
+
+#define FLOAT32_HIDDEN_BIT_MASK      0x800000
+#define FLOAT64_HIDDEN_BIT_MASK      0x10000000000000ll
+#define FLOAT128_HIDDEN_BIT_MASK_HI  0x1000000000000ll
+#define FLOAT128_HIDDEN_BIT_MASK_LO  0x0000000000000000ll
 
 #define FLOAT32_MAX_EXPONENT  0xFF
 #define FLOAT64_MAX_EXPONENT  0x7FF
+#define FLOAT128_MAX_EXPONENT 0x7FFF
 
 #define FLOAT32_BIAS  0x7F
 #define FLOAT64_BIAS  0x3FF
 #define FLOAT80_BIAS  0x3FFF
+#define FLOAT128_BIAS 0x3FFF
 
 #endif
Index: uspace/lib/softfloat/include/softfloat.h
===================================================================
--- uspace/lib/softfloat/include/softfloat.h	(revision 750636ac4a65360c44846b7681af6ae46854dd3a)
+++ uspace/lib/softfloat/include/softfloat.h	(revision 0f963cba7b2dd43c6842c525c83b9a01d876d331)
@@ -1,4 +1,5 @@
 /*
  * Copyright (c) 2005 Josef Cejka
+ * Copyright (c) 2011 Petr Koupy
  * All rights reserved.
  *
@@ -30,5 +31,5 @@
  * @{
  */
-/** @file
+/** @file Softfloat API.
  */
 
@@ -156,4 +157,5 @@
 extern int __ltdf2(double, double);
 extern int __lttf2(long double, long double);
+
 extern int __lesf2(float, float);
 extern int __ledf2(double, double);
@@ -166,4 +168,44 @@
 /* Not implemented yet */
 extern float __powisf2(float, int);
+extern double __powidf2 (double, int);
+extern long double __powitf2 (long double, int);
+extern long double __powixf2 (long double, int);
+
+
+
+/* SPARC quadruple-precision wrappers */
+
+extern void _Qp_add(long double *, long double *, long double *);
+extern void _Qp_sub(long double *, long double *, long double *);
+extern void _Qp_mul(long double *, long double *, long double *);
+extern void _Qp_div(long double *, long double *, long double *);
+extern void _Qp_neg(long double *, long double *);
+
+extern void _Qp_stoq(long double *, float);
+extern void _Qp_dtoq(long double *, double);
+extern float _Qp_qtos(long double *);
+extern double _Qp_qtod(long double *);
+
+extern int _Qp_qtoi(long double *);
+extern unsigned int _Qp_qtoui(long double *);
+extern long _Qp_qtox(long double *);
+extern unsigned long _Qp_qtoux(long double *);
+
+extern void _Qp_itoq(long double *, int);
+extern void _Qp_uitoq(long double *, unsigned int);
+extern void _Qp_xtoq(long double *, long);
+extern void _Qp_uxtoq(long double *, unsigned long);
+
+extern int _Qp_cmp(long double *, long double *);
+extern int _Qp_cmpe(long double *, long double *);
+extern int _Qp_feq(long double *, long double *);
+extern int _Qp_fge(long double *, long double *);
+extern int _Qp_fgt(long double *, long double *);
+extern int _Qp_fle(long double*, long double *);
+extern int _Qp_flt(long double *, long double *);
+extern int _Qp_fne(long double *, long double *);
+
+/* Not implemented yet */
+extern void _Qp_sqrt(long double *, long double *);
 
 #endif
Index: uspace/lib/softfloat/include/sub.h
===================================================================
--- uspace/lib/softfloat/include/sub.h	(revision 750636ac4a65360c44846b7681af6ae46854dd3a)
+++ uspace/lib/softfloat/include/sub.h	(revision 0f963cba7b2dd43c6842c525c83b9a01d876d331)
@@ -1,4 +1,5 @@
 /*
  * Copyright (c) 2005 Josef Cejka
+ * Copyright (c) 2011 Petr Koupy
  * All rights reserved.
  *
@@ -30,5 +31,5 @@
  * @{
  */
-/** @file
+/** @file Substraction functions.
  */
 
@@ -38,4 +39,5 @@
 extern float32 subFloat32(float32, float32);
 extern float64 subFloat64(float64, float64);
+extern float128 subFloat128(float128, float128);
 
 #endif
