URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [config/] [rs6000/] [darwin-ldouble-format] - Rev 282
Compare with Previous | Blame | View Log
Long double format==================Each long double is made up of two IEEE doubles. The value of thelong double is the sum of the values of the two parts (except for-0.0). The most significant part is required to be the value of thelong double rounded to the nearest double, as specified by IEEE. ForInf values, the least significant part is required to be one of +0.0or -0.0. No other requirements are made; so, for example, 1.0 may berepresented as (1.0, +0.0) or (1.0, -0.0), and the low part of a NaNis don't-care.Classification--------------A long double can represent any value of the forms * 2^e * sum(k=0...105: f_k * 2^(-k))where 's' is +1 or -1, 'e' is between 1022 and -968 inclusive, f_0 is1, and f_k for k>0 is 0 or 1. These are the 'normal' long doubles.A long double can also represent any value of the forms * 2^-968 * sum(k=0...105: f_k * 2^(-k))where 's' is +1 or -1, f_0 is 0, and f_k for k>0 is 0 or 1. These arethe 'subnormal' long doubles.There are four long doubles that represent zero, two that represent+0.0 and two that represent -0.0. The sign of the high part is thesign of the long double, and the sign of the low part is ignored.Likewise, there are four long doubles that represent infinities, twofor +Inf and two for -Inf.Each NaN, quiet or signalling, that can be represented as a 'double'can be represented as a 'long double'. In fact, there are 2^64equivalent representations for each one.There are certain other valid long doubles where both parts arenonzero but the low part represents a value which has a bit set below2^(e-105). These, together with the subnormal long doubles, make upthe denormal long doubles.Many possible long double bit patterns are not valid long doubles.These do not represent any value.Limits------The maximum representable long double is 2^1024-2^918. The smallest*normal* positive long double is 2^-968. The smallest denormalisedpositive long double is 2^-1074 (this is the same as for 'double').Conversions-----------A double can be converted to a long double by adding a zero low part.A long double can be converted to a double by removing the low part.Comparisons-----------Two long doubles can be compared by comparing the high parts, and ifthose compare equal, comparing the low parts.Arithmetic----------The unary negate operation operates by negating the low and high parts.An absolute or absolute-negate operation must be done by comparingagainst zero and negating if necessary.Addition and subtraction are performed using library routines. Theyare not at present performed perfectly accurately, the result producedwill be within 1ulp of the range generated by adding or subtracting1ulp from the input values, where a 'ulp' is 2^(e-106) given theexponent 'e'. In the presence of cancellation, this may bearbitrarily inaccurate. Subtraction is done by negation and addition.Multiplication is also performed using a library routine. Its resultwill be within 2ulp of the correct result.Division is also performed using a library routine. Its result willbe within 3ulp of the correct result.Copyright (C) 2004 Free Software Foundation, Inc.Copying and distribution of this file, with or without modification,are permitted in any medium without royalty provided the copyrightnotice and this notice are preserved.
