[cfe-dev] Integer and Float type definitions with respect to bits number

Paul A. Bristow pbristow at hetp.u-net.com
Mon Nov 11 10:13:45 PST 2013


 
From: cfe-dev-bounces at cs.uiuc.edu [mailto:cfe-dev-bounces at cs.uiuc.edu] On Behalf Of Mehmet Erol Sanliturk
Sent: Sunday, November 10, 2013 3:38 PM
To: cfe-dev at cs.uiuc.edu
Subject: [cfe-dev] Integer and Float type definitions with respect to bits number
 

Dears All ,


It seems that , in Clang , there is no a type system like the following :


Integer_8_Bits_Positive 
Integer_8_Bits_Signed



Integer_16_Bits_Positive 
Integer_16_Bits_Signed

 

Integer_32_Bits_Positive 
Integer_32_Bits_Signed


Integer_64_Bits_Positive 
Integer_64_Bits_Signed




Float_48_Bits
Float_64_Bits
Float_80_Bits
Float_128_Bits


The following are defined with respect to above types AND Operating System , 
Processor requirements to enable to compile the SAME sources for different
environments :

Integer_Default_Bits_Positive 
Integer_Default_Bits_Signed

Float_Default_Bits


The existing definitions ( long , long long , etc. ) are very ambiguous and
depending on the platform without clearly showing exact bits number . 

Is there a possibility to include definitions such as above into Clang
or , if there exist such a definition , what is its name ?

There is a proposal to add *optional* floating-point definitions (adding to existing integer like int32_t) to the next version of the C and C++ standards:
 <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3626.pdf> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3626.pdf
 <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1703.pdf> http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1703.pdf
This will at least standardise the names of *specified-width* typedefs.
Of course some typedefs may require compiler support,
or a multiprecision library like
 <http://www.boost.org/doc/libs/1_54_0/libs/multiprecision/doc/html/index.html> http://www.boost.org/doc/libs/1_54_0/libs/multiprecision/doc/html/index.html
which now also has experimental cpp_bin_float types
 <https://svn.boost.org/svn/boost/sandbox/multiprecision.cpp_bin_float/> https://svn.boost.org/svn/boost/sandbox/multiprecision.cpp_bin_float/
that can emulate various binary layouts.
HTH
 
Paul
 
---
Paul A. Bristow,
Prizet Farmhouse, Kendal LA8 8AB  UK
+44 1539 561830  07714330204
pbristow at hetp.u-net.com
 
 
 
 
 





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131111/a80e084f/attachment.html>


More information about the cfe-dev mailing list