[Cfp-interest] CFP binary FP

Fred J. Tydeman tydeman at tybor.com
Thu Dec 8 16:37:55 PST 2011


On Wed, 7 Dec 2011 22:04:26 -0800 Jim Thomas wrote:
>
>http://wiki.edg.com/twiki/pub/CFP/WebHome/cfp.bfp.content.pdf

Here is a first pass at a set of WIDTH macros.

In 5.2.4.2.1 Sizes of integer types <limits.h>, add the following:

-- number of value bits for an object of type /char/
   CHAR_WIDTH 8u
-- number of value bits for an object of type /signed char/
   SCHAR_WIDTH 8u
-- number of value bits for an object of type /unsigned char/
   UCHAR_WIDTH 8u
-- number of value bits for an object of type /signed short int/
   SHRT_WIDTH 16u
-- number of value bits for an object of type /unsigned short int/
   USHRT_WIDTH 16u
-- number of value bits for an object of type /signed int/
   INT_WIDTH 16u
-- number of value bits for an object of type /unsigned int/
   UINT_WIDTH 16u
-- number of value bits for an object of type /signed long int/
   LONG_WIDTH 32u
-- number of value bits for an object of type /unsigned long int/
   ULONG_WIDTH 32u
-- number of value bits for an object of type /signed long long int/
   LLONG_WIDTH 64u
-- number of value bits for an object of type /unsigned long long int/
   ULLONG_WIDTH 64u
-- number of value bits for an object of type /intmax_t/
   INTMAX_WIDTH 64u
-- number of value bits for an object of type /uintmax_t/
   UINTMAX_WIDTH 64u

The type of all the *_WIDTH macros shall be /unsigned int/.  These
macros are for use with the /fromfp/, /ufromfp/, /fromfpxf/, and
/ufromfpx/ functions.

Forward references:  
  6.2.6.2 Integer types, 
  7.12.9.9 The fromfp and ufromfp functions
  7.12.9.10 The fromfpx and ufromfpx functions
  7.20.1.5 Greatest-width integer types

ISSUE:  Do we need *_WIDTH macros for:
  errno_t
  ptrdiff_t
  sig_atomic_t
  size_t
  rsize_t
  fpos_t
  char16_t
  char32_t
  wchar_t
  wint_t
  int_least*_t
  uint_least*_t
  int_fast*_t
  uint_fast*_t
  intptr_t
  uintptr_t
  atomic_*
  cnd_t
  thrd_t
  tss_t
  mtx_t
  clock_t
  time_t
  wctype_t
  wctrans_t


---
Fred J. Tydeman        Tydeman Consulting
tydeman at tybor.com      Testing, numerics, programming
+1 (775) 358-9748      Vice-chair of PL22.11 (ANSI "C")
Sample C99+FPCE tests: http://www.tybor.com
Savers sleep well, investors eat well, spenders work forever.



More information about the Cfp-interest mailing list