Expose the minimum and maximum finite normal floating-point exponents.
authorTaylor R Campbell <campbell@mumble.net>
Fri, 26 Oct 2018 23:32:37 +0000 (23:32 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Fri, 26 Oct 2018 23:32:37 +0000 (23:32 +0000)
src/microcode/utabmd.c
src/runtime/microcode-tables.scm
src/runtime/runtime.pkg

index 463a86bc9781ada32b8966210c9215a4fcd75b2f..a587ca64d7ac3873dcad27baba02701644cd5c2f 100644 (file)
@@ -60,8 +60,10 @@ static SCHEME_OBJECT names_to_vector (unsigned long, const char **);
 #define ID_STACK_TYPE          10      /* Scheme stack type (string) */
 #define ID_MACHINE_TYPE                11      /* Machine type (string) */
 #define ID_CC_ARCH             12      /* Compiled-code support (string) */
+#define ID_FLONUM_EXP_MIN      13      /* Minimum finite (normal) exponent */
+#define ID_FLONUM_EXP_MAX      14      /* Maximum finite exponent */
 
-#define N_IDENTITY_NAMES 0x0D
+#define N_IDENTITY_NAMES 0x0F
 static const char * identity_names [] =
 {
   /* 0x00 */   "system-release-string",
@@ -76,7 +78,9 @@ static const char * identity_names [] =
   /* 0x09 */   "os-variant-string",
   /* 0x0A */   "stack-type-string",
   /* 0x0B */   "machine-type-string",
-  /* 0x0C */   "cc-arch-string"
+  /* 0x0C */   "cc-arch-string",
+  /* 0x0D */   "flonum-exponent-min",
+  /* 0x0E */   "flonum-exponent-max",
 };
 
 SCHEME_OBJECT
@@ -94,6 +98,8 @@ make_microcode_identification_vector (void)
   VECTOR_SET (v, ID_OS_VARIANT, (char_pointer_to_string (OS_Variant)));
   VECTOR_SET (v, ID_STACK_TYPE, (char_pointer_to_string ("standard")));
   VECTOR_SET (v, ID_MACHINE_TYPE, (char_pointer_to_string (MACHINE_TYPE)));
+  VECTOR_SET (v, ID_FLONUM_EXP_MIN, (LONG_TO_FIXNUM (DBL_MIN_EXP - 1)));
+  VECTOR_SET (v, ID_FLONUM_EXP_MAX, (LONG_TO_FIXNUM (DBL_MAX_EXP - 1)));
   {
     const char * name = (cc_arch_name ());
     if (name != 0)
index a196d2c5a2c49d7bbcec84371e74c42ce7144848..ff26f220cf2618a488d220e70e3e75dc9d5e514c 100644 (file)
@@ -180,6 +180,8 @@ USA.
 (define microcode-version-string)
 (define microcode-id/floating-mantissa-bits)
 (define microcode-id/floating-epsilon)
+(define microcode-id/floating-exponent-min)
+(define microcode-id/floating-exponent-max)
 (define microcode-id/operating-system)
 (define microcode-id/operating-system-name)
 (define microcode-id/operating-system-variant)
@@ -194,6 +196,10 @@ USA.
        (microcode-identification-item 'flonum-mantissa-length))
   (set! microcode-id/floating-epsilon
        (microcode-identification-item 'flonum-epsilon))
+  (set! microcode-id/floating-exponent-min
+        (microcode-identification-item 'flonum-exponent-min))
+  (set! microcode-id/floating-exponent-max
+        (microcode-identification-item 'flonum-exponent-max))
   (set! microcode-id/operating-system-name
        (microcode-identification-item 'os-name-string))
   (set! microcode-id/operating-system
index dc5aa5ae8e341febb139588e7b6ba4560ad888e0..685c0b8a6474f0a2d5b5c8eb1d4f2606c84d989a 100644 (file)
@@ -3224,6 +3224,8 @@ USA.
          microcode-id/compiled-code-type
          microcode-id/floating-epsilon
          microcode-id/floating-mantissa-bits
+         microcode-id/floating-exponent-max
+         microcode-id/floating-exponent-min
          microcode-id/machine-type
          microcode-id/operating-system
          microcode-id/operating-system-suffix