--- a/QuadFloat.st Thu Jun 06 22:55:04 2019 +0200
+++ b/QuadFloat.st Thu Jun 06 23:01:38 2019 +0200
@@ -13,6 +13,11 @@
!QuadFloat primitiveDefinitions!
%{
+#if __POINTER_SIZE__ == 8
+# define SUPPORT_QUADFLOAT
+#endif
+
+#ifdef SUPPORT_QUADFLOAT
/*----------------------------------------------------------------------------
| Software floating-point underflow tininess-detection mode.
*----------------------------------------------------------------------------*/
@@ -78,12 +83,16 @@
};
struct exp16_sig64 { int_fast16_t exp; uint_fast64_t sig; };
+#endif // SUPPORT_QUADFLOAT
+
%}
! !
!QuadFloat primitiveVariables!
%{
+#ifdef SUPPORT_QUADFLOAT
+
uint_fast8_t softfloat_exceptionFlags;
uint_fast8_t softfloat_roundingMode = softfloat_round_near_even;
uint_fast8_t softfloat_detectTininess = init_detectTininess;
@@ -107,12 +116,15 @@
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
};
+#endif // SUPPORT_QUADFLOAT
+
%}
! !
!QuadFloat primitiveFunctions!
%{
+#ifdef SUPPORT_QUADFLOAT
#if defined(LITTLEENDIAN) || defined(__LSB_FIRST__)
#define wordIncr 1
@@ -842,6 +854,7 @@
}
}
+#endif // SUPPORT_QUADFLOAT
%}
! !
@@ -898,7 +911,7 @@
binary stored in a device independent format)."
%{ /* NOCONTEXT */
-#ifndef __SCHTEAM__
+#ifdef SUPPORT_QUADFLOAT
OBJ newFloat;
if (sizeof(long double) == sizeof(float128_t)) {
@@ -909,8 +922,9 @@
__qMKQFLOAT(newFloat, qf); /* OBJECT ALLOCATION */
}
RETURN (newFloat);
-#endif /* not SCHTEAM */
-%}
+#endif /* SUPPORT_QUADFLOAT */
+%}.
+ self error:'QuadFloats not supported on this patform'
"Created: / 06-06-2019 / 17:18:58 / Claus Gittinger"
!
@@ -919,7 +933,7 @@
"return a new quadFloat, given a float value"
%{ /* NOCONTEXT */
-#ifndef __SCHTEAM__
+#ifdef SUPPORT_QUADFLOAT
OBJ newFloat;
float128_t f;
@@ -931,8 +945,11 @@
__qMKQFLOAT(newFloat, qf); /* OBJECT ALLOCATION */
RETURN (newFloat);
}
-#endif
+#endif /* SUPPORT_QUADFLOAT */
%}.
+ aFloat isFloat ifTrue:[
+ self error:'QuadFloats not supported on this patform'
+ ].
self error:'invalid argument'
"