]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/LibC/gdtoa/gdtoaimp.h
ArmPkg/TimerDxe: Add ISB for timer compare value reload
[mirror_edk2.git] / StdLib / LibC / gdtoa / gdtoaimp.h
index 635a177544c6f2767cc502ff0343f68bc9c8ffca..a5eaa72f4120aca83bd5ca9d66b3c642c9ec4c05 100644 (file)
@@ -3,13 +3,9 @@
   floating-point formats to and from decimal notation.  It uses\r
   double-precision arithmetic internally, so there are still\r
   various #ifdefs that adapt the calculations to the native\r
-  double-precision arithmetic (any of IEEE, VAX D_floating,\r
-  or IBM mainframe arithmetic).\r
+  IEEE double-precision arithmetic.\r
 \r
-  Please send bug reports to David M. Gay (dmg at acm dot org,\r
-  with " at " changed at "@" and " dot " changed to ".").\r
-\r
-  Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials are licensed and made available under\r
   the terms and conditions of the BSD License that accompanies this distribution.\r
   The full text of the license may be found at\r
@@ -18,6 +14,8 @@
   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
+  *****************************************************************\r
+\r
   The author of this software is David M. Gay.\r
 \r
   Copyright (C) 1998-2000 by Lucent Technologies\r
   ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\r
   THIS SOFTWARE.\r
 \r
-$NetBSD: gdtoaimp.h,v 1.5.4.1 2007/05/07 19:49:06 pavel Exp\r
+  Please send bug reports to David M. Gay (dmg at acm dot org,\r
+  with " at " changed at "@" and " dot " changed to ".").\r
+\r
+  *****************************************************************\r
+\r
+  NetBSD: gdtoaimp.h,v 1.5.4.1 2007/05/07 19:49:06 pavel Exp\r
 **/\r
 \r
 /* On a machine with IEEE extended-precision registers, it is\r
@@ -94,8 +97,6 @@ $NetBSD: gdtoaimp.h,v 1.5.4.1 2007/05/07 19:49:06 pavel Exp
  * #define Long int on machines with 32-bit ints and 64-bit longs.\r
  * #define Sudden_Underflow for IEEE-format machines without gradual\r
  *  underflow (i.e., that flush to zero on underflow).\r
- * #define IBM for IBM mainframe-style floating-point arithmetic.\r
- * #define VAX for VAX-style floating-point arithmetic (D_floating).\r
  * #define No_leftright to omit left-right logic in fast floating-point\r
  *  computation of dtoa.\r
  * #define Check_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3.\r
@@ -114,7 +115,6 @@ $NetBSD: gdtoaimp.h,v 1.5.4.1 2007/05/07 19:49:06 pavel Exp
  *  something other than "long long", #define Llong to be the name,\r
  *  and if "unsigned Llong" does not work as an unsigned version of\r
  *  Llong, #define #ULLong to be the corresponding unsigned type.\r
- * #define KR_headers for old-style C function headers.\r
  * #define Bad_float_h if your system lacks a float.h or if it does not\r
  *  define some or all of DBL_DIG, DBL_MAX_10_EXP, DBL_MAX_EXP,\r
  *  FLT_RADIX, FLT_ROUNDS, and DBL_MAX.\r
@@ -179,8 +179,8 @@ $NetBSD: gdtoaimp.h,v 1.5.4.1 2007/05/07 19:49:06 pavel Exp
 #include <stdint.h>\r
 #define Short   int16_t\r
 #define UShort uint16_t\r
-#define Long   EFI_LONG_T\r
-#define ULong  EFI_ULONG_T\r
+#define Long    int32_t\r
+#define ULong  uint32_t\r
 #define LLong   int64_t\r
 #define ULLong uint64_t\r
 \r
@@ -203,11 +203,7 @@ $NetBSD: gdtoaimp.h,v 1.5.4.1 2007/05/07 19:49:06 pavel Exp
 #include "stdlib.h"\r
 #include "string.h"\r
 \r
-#ifdef KR_headers\r
-#define Char char\r
-#else\r
 #define Char void\r
-#endif\r
 \r
 #ifdef MALLOC\r
 extern Char *MALLOC ANSI((size_t));\r
@@ -235,23 +231,6 @@ extern Char *MALLOC ANSI((size_t));
 #define DBL_MAX 1.7976931348623157e+308\r
 #endif\r
 \r
-#ifdef IBM\r
-#define DBL_DIG 16\r
-#define DBL_MAX_10_EXP 75\r
-#define DBL_MAX_EXP 63\r
-#define FLT_RADIX 16\r
-#define DBL_MAX 7.2370055773322621e+75\r
-#endif\r
-\r
-#ifdef VAX\r
-#define DBL_DIG 16\r
-#define DBL_MAX_10_EXP 38\r
-#define DBL_MAX_EXP 127\r
-#define FLT_RADIX 2\r
-#define DBL_MAX 1.7014118346046923e+38\r
-#define n_bigtens 2\r
-#endif\r
-\r
 #ifndef LONG_MAX\r
 #define LONG_MAX 2147483647\r
 #endif\r
@@ -265,26 +244,24 @@ extern Char *MALLOC ANSI((size_t));
 #define n_bigtens 5\r
 #endif\r
 \r
-#ifdef IBM\r
-#define n_bigtens 3\r
-#endif\r
-\r
-#ifdef VAX\r
-#define n_bigtens 2\r
-#endif\r
-\r
 #include "math.h"\r
 \r
 #ifdef __cplusplus\r
 extern "C" {\r
 #endif\r
 \r
-#if defined(IEEE_LITTLE_ENDIAN) + defined(IEEE_BIG_ENDIAN) + defined(VAX) + defined(IBM) != 1\r
-Exactly one of IEEE_LITTLE_ENDIAN, IEEE_BIG_ENDIAN, VAX, or IBM should be defined.\r
+#if defined(IEEE_LITTLE_ENDIAN) + defined(IEEE_BIG_ENDIAN) != 1\r
+Exactly one of IEEE_LITTLE_ENDIAN or IEEE_BIG_ENDIAN should be defined.\r
 #endif\r
 \r
-typedef union { double d; ULong L[2]; } U;\r
-//typedef union { double d; UINT32 L[2]; } U;\r
+/*  This union assumes that:\r
+      sizeof(double) == 8\r
+      sizeof(UINT32) == 4\r
+\r
+    If this is not the case, the type and dimension of the L member will\r
+    have to be modified.\r
+*/\r
+typedef union { double d; UINT32 L[2]; } U;\r
 \r
 #ifdef YES_ALIAS\r
 #define dval(x) x\r
@@ -297,20 +274,20 @@ typedef union { double d; ULong L[2]; } U;
 #endif\r
 #else /* !YES_ALIAS */\r
 #ifdef IEEE_LITTLE_ENDIAN\r
-#define word0(x) ( /* LINTED */ (U*)&x)->L[1]\r
-#define word1(x) ( /* LINTED */ (U*)&x)->L[0]\r
+#define word0(x)  ( /* LINTED */ (U*)&x)->L[1]\r
+#define word1(x)  ( /* LINTED */ (U*)&x)->L[0]\r
 #else\r
-#define word0(x) ( /* LINTED */ (U*)&x)->L[0]\r
-#define word1(x) ( /* LINTED */ (U*)&x)->L[1]\r
+#define word0(x)  ( /* LINTED */ (U*)&x)->L[0]\r
+#define word1(x)  ( /* LINTED */ (U*)&x)->L[1]\r
 #endif\r
-#define dval(x) ( /* LINTED */ (U*)&x)->d\r
+#define dval(x)   ( /* LINTED */ (U*)&x)->d\r
 #endif /* YES_ALIAS */\r
 \r
 /* The following definition of Storeinc is appropriate for MIPS processors.\r
  * An alternative that might be better on some machines is\r
  * #define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff)\r
  */\r
-#if defined(IEEE_LITTLE_ENDIAN) + defined(VAX)\r
+#if defined(IEEE_LITTLE_ENDIAN)\r
 #define Storeinc(a,b,c) \\r
  (((unsigned short *)(void *)a)[1] = (unsigned short)b, \\r
   ((unsigned short *)(void *)a)[0] = (unsigned short)c, \\r
@@ -427,11 +404,7 @@ typedef union { double d; ULong L[2]; } U;
 #ifdef RND_PRODQUOT\r
 #define rounded_product(a,b) a = rnd_prod(a, b)\r
 #define rounded_quotient(a,b) a = rnd_quot(a, b)\r
-#ifdef KR_headers\r
-extern double rnd_prod(), rnd_quot();\r
-#else\r
 extern double rnd_prod(double, double), rnd_quot(double, double);\r
-#endif\r
 #else\r
 #define rounded_product(a,b) a *= b\r
 #define rounded_quotient(a,b) a /= b\r
@@ -497,7 +470,7 @@ extern mutex_t __gdtoa_locks[2];
   } while (/* CONSTCOND */ 0)\r
 #endif\r
 \r
-#define Kmax 15\r
+#define Kmax (sizeof(size_t) << 3)\r
 \r
  struct\r
 Bigint {\r