J3/06-131
Date: 31-jan-2006
To: J3
From: Bill Long
Subject: Edits for BITS
References: Feature J3-047, J3/05-188, J3/05-274
--------------------------------------------------------------
Following are a draft ofthe edits to implement the J3-047
feature, BITS type, as amended by paper J3/05-274.
Note 1. < and > are used to delimit italic font. << and >> are
used to delimit bold font.
Note 2. All page and line numbers refer to j3/04-007.
EDITS
.....................................................................
[xiii] Introduction, the list of new Fortran 2008 features should
include
A BITS data type for non-numeric programming, enhanced handling of
BOZ constants, simplified interfaces, and standardization of common
extensions and intrinsics.
.....................................................................
In section 1.6 Compatibility, retain paragraph 3:5-9 regarding new
intrinsic procedure names. There are new intrinsics introduced in
this proposal.
In addition, add to a section on incompatibility with Fortran 2003:
[3:10-]
This standard specifies a new intrinsic type, BITS, which will
conflict with a user defined type of the same name.
This standard specifies a new intrinsic operator, .XOR., which
will conflict with a user defined operator of the same name.
.....................................................................
[15:39] Replace the second sentence of 2.4.1.1 Intrinsic type with:
The intrinsic types are integer, real, complex, character, logical,
and bits.
.....................................................................
[16:2-3] Replace the end of the first sentence in the second
paragraph of 2.4.1.1 Intrinsic types that begins with ", and the
representation..." with:
, the representation methods for the character and logical types
(4.4.4, 4.4.5), and the number of bits for the bits type (4.4.6).
.....................................................................
[26:28+] Add a new rule to '3.2.3 Operators' to make .XOR. a
kind of :
<> .XOR.
.....................................................................
[33:5] At the end of the second paragraph of 'Section 4: Types',
replace "character, and logical." with
"character, logical, and bits."
.....................................................................
[33:19] At the end if the second sentence of '4.1.1 Set of values',
replace "character, and real." with: "character, real, and bits."
.....................................................................
[35:29] In 4.4 Intrinsic types, replace the list of non-numeric types
with:
nonnumeric types: character, logical, and bits
.....................................................................
[36:7+] Add a new type entry in 4.4 Intrinsic types, to
R403 :
<> BITS []
.....................................................................
[37:1-18] Move the description of constants out of
4.4.1 Integer type to new section 4.4.6 Bits type - edits [44:17+].
.....................................................................
[37:19-25] Delete description of boz constants (replaced with new
text in [44:17+]) and remove constraint C410 in '4.4.1 Integer type'.
.....................................................................
[44:17+] Add a new subsection:
4.4.6 Bits type
The <> has a set of values composed of ordered
sequences of bits. The number of bits in the sequence is specified
by the kind type parameter, KIND, which shall be greater than or
equal to zero. A processor shall provide bits kinds with kind values
in the range zero through four times NUMERIC_STORAGE_SIZE (13.8.2.7).
The type specifier for the bits type uses the keyword BITS.
If the kind type paratmeter is not specified for a bits variable,
the default kind value is NUMERIC_STORAGE_SIZE, and the type
specified is default bits.
If the kind parameter is not specified for a BITS literal constant,
the kind value is assumed from the form of the constant. If the
constant is a the kind value is the number of
characters. If the constant is an the kind
value is three times the number of characters. If the constant
is a the kind value is four times the number of
characters.
Any bits value may be represented as a , or a
concatenation of multiple s.
***Note to editor: Insert the text from [37:1-18] here.
The digits of octal constants represent triples of bits, and the
digits of hexadecimal constants represent quartets of bits, according
to their numerical representations as binary integers, with leading
zero bits where needed.
A trailing is allowed for a BOZ constant. If the
specified has a value greater than the kind assumed from
the number of s or s in the constant, the constant
is padded on the left with enough 0 bits to create a constant of kind
. If the specified has a value smaller than
the kind assumed from the number of s or s in the
constant, bits on the left are removed to create a constant of kind
.
Note 4:15a:
Though the processor is required to provide bit kinds up to four
times NUMERIC_STORAGE_SIZE, it is expected that the actual size limit
is much larger, based on system capacity constraints. Use of BITS
objects with KIND values equal to small integer multiples of
NUMERIC_STORAGE_SIZE should result in more aggressive optimization.
[end Note]
.....................................................................
[76:5+] In '5.1.1.2 Class' in the discussion of type compatibility,
add a new paragraph:
An entity of type bits is <> with an entity of
type bits, integer, real, complex, or logical if and only if both
entities return the same value when supplied as arguments to the
inquiry intrinsic function COMPATIBLE_BITS_KIND.
.....................................................................
[76:7-9] In '5.1.1.2 Class', replace the paragraph defining TKR
compatible with:
An entity is type, kind, and rank compatible, or <>,
with another entity if the first entity is type compatible with
the second and the kind type parameters of the first entity have the
same values as corresponding kind type parameters of the second, or
the two entities are bits type compatible, and both entities have
the same rank.
.....................................................................
[89:20-22] Delete this paragraph from '5.2.5 DATA statement',
referring to in DATA statements.
.....................................................................
[119:2] In '7.1.1.4 Level-3 expressions' replace "character
operator " with "character operator and bits
concatenation operator ".
.....................................................................
[120:2] In '7.1.1.5 Level-5 expressions' replace "the logical
operators" with "the logical and bits operators".
.....................................................................
[120:12+] In '7.1.1.6 Level-5 expressions', extend rule R721 for
to include .XOR.:
<> .XOR.
.....................................................................
[121:7+] In 'Table 7.1: Type of operands and results for intrinsic
operators', replace boxes 3-7 with (redundant headings supplied for
clarity only):
Intrinsic operator Type of Type of Type of
[]
----------------------------------------------------------------
// C C C
B B B
----------------------------------------------------------------
I I,R,Z,B L,L,L,L
.EQ. .NE. R I,R,Z,B L,L,L,L
==, /= Z I,R,Z,B L,L,L,L
B I,R,Z,B L,L,L,L
C C L
----------------------------------------------------------------
I I,R,B L,L,L
.GT.,.GE.,.LT.,.LE. R I,R,B L,L,L
>, >=, <, <= B I,R,B L,L,L
C C L
----------------------------------------------------------------
.NOT. L,B L,B
----------------------------------------------------------------
.AND.,.OR.,.XOR.,.EQV, L L L
.NEQV. B B,I B,B
I B,I B,B
.....................................................................
[121:7+] In the Note at the bottom of 'Table 7.1: Type of operands
and results for intrinsic operatiors', replace the first sentence
with"
The symbols I, R, Z, C, L, and B stand for the types integer, real,
complex, character, logical, and bits respectively.
.....................................................................
[121:16+] After the 4th paragraph of '7.1.2 Intrinsic operations'
add a new paragraph:
A <> is an intrinsic operation for which at
least one of the operands is of type bits. For bits intrinsic
operations where the is not the <> (//), the two operands may be of different
types or different kind type parameters. If one operand, , is not
of type bits, that operand is converted to a value of type bits and
kind type parameter COMPATIBLE_BITS_KIND(), and the new value takes
the place of as an operand. If the resulting operands have
different kind type parameters, the operand with the smaller kind type
parameter is converted to a bits value with the kind type parameter of
the other operand before the operation is performed. The kind type
parameter of the result is that of the operand with the larger kind
type parameter. For a bits intrinsic operation where the
is the bits concatention opertor, the kind type
parameter of the result is the sum of the kind type parameters of the
operands.
.....................................................................
[121:17-20] In '7.1.2 Intrinsic operations' replace the first
sentence of the 5th paragraph with:
A <>, <>, and <> are similarly
defined in terms of a <> ( // in a
context where the operands are of type character), relational
intrinsic operators (.EQ.,.NE.,.GT.,.GE.,.LT.,.LE.,==, /=, >, >=,
<, and <=), and logical intrinsic operators (.AND.,.OR.,.XOR.,.NOT.,
.EQV., and .NEQV. is a context where the operands are of type
logical), respectively.
.....................................................................
[121:23-25] In '7.1.2 Intrinsic operations' add a qualification to
the first sentence and append a new sentence, so that the resulting
paragraph is:
A <> is a relational
intrinsic operation where both operands are of numeric type. A
<> is a relational
intrinsic operation where the operands are of type character. A
<> is a relational intrinsic
operation where one or both of the operands is of type bits.
.....................................................................
[123:24+] In '7.1.4 Type, type parameters, and shape of an
expression', add a syntax term for a bits expression:
R728a <>
C709a (R728a) shall be of type bits.
.....................................................................
[124:44+] In '7.1.4.2 Type, type parameters, and shape of the result
of an expression', add a new item in the list after item 5:
(5a) For an expression // where both operands are of type
bits, the kind type parameter of the result is the sum of the kind
type parameters of the operands. For an expression
where both operands are of type bits and is not // or a
relational intrinsic operator, if the operands have the same type kind
parameters, the kind type parameter of the expression is the same as
that of each operand; otherwise the kind type parameter of the
expression is the larger of the kind type parameters of the operands.
For an expression where is not // or a relational
intrinsic operator, and one of the operands is of type bits and the
other operand is not of type bits, the kind type parameter of the
expression is the larger of the kind type of the operand of type bits
and COMPATIBLE_BITS_KIND() where is the operand that is not of
type bits.
.....................................................................
[125:41] In the list of a specification inquiry in '7.1.6
Specification expression', replace item (4) with:
(4) the kind inquiry functions KIND and COMPATIBLE_BITS_KIND,
.....................................................................
[132:9+] Add a new subsection to '7.1.8 Evaluation of operations':
7.1.8.6a Evaluation of bits intrinsic operations
The rules given in 7.2.5 specify the interpretation of bits
intrinsic operations. Once the interpretation of an expression has
been established in accordance with those rules, the processor may
evaluate any other expression that is computationally equivalent,
provided that the integrity of parentheses in any expression is
not violated.
Note 7.23a
For example, for the variables B1, B2, and B3 of type logical, the
processor may choose to evaluate the expression
B1 .xor. B2 .xor. B3
as
B1 .xor. (B2 .xor. B3)
[end Note]
Two expressions of type bits are computationally equivalent if their
values are equal for all possible values of their primaries.
.....................................................................
[132:18] In the second sentence of '7.2 Interpretation of operations'
replace "character, relational, and logical" with "character,
relational, logical, and bits".
.....................................................................
[135:22-] At the end of '7.2.3 Relational intrinsic operations',
add two new paragraphs:
A bits relational intrinsic operation is interpreted as having the
logical value true if the values of the operands satisfy the relation
specified by the operator. A bits relational intrinsic operation is
interpreted as having the logical value false of the values of the
operands do not satisfy the relation specified by the operator.
For a bits relational intrinsic operation where the operands are both
of type bits and of the same kind type parameter, and are
equal if, at each bit position, their corresponding bits are the same,
or they both have kind type parameter value of zero; otherwise they
are unequal. If and are unequal, and the leftmost unequal
corresponding bit of is 1 and is 0 then is considered
to be greater than ; otherwise is considered to be less than
. If both and are of type bits but have unequal kind
type parameters, the operand with the smaller kind type parameter is
treated as if it were padded on the left with the number of 0 bits
required to make the number of bits in each operand the same. If one
of the operands is not of type bits, that operand, , is converted
to type bits with a kind type parameter of COMPATIBLE_BITS_KIND()
before the operation is evaluated.
.....................................................................
[135:28+] In Table 7.5 in '7.2.4 Logical intrinsic operations' add
a row following the entry for .NEQV. at the bottom of the page:
.XOR. Logical nonquivalence .XOR. True if either
or is true,
but not both.
.....................................................................
[136:2-] After Table 7.6 in '7.2.4 Logical intrinsic operations'
add a new paragraph:
The values for the logical intrinsic operation .XOR. are
identical to those for .NEQV. .
.....................................................................
[136:2-] At the end of section '7.2 Interpretation of operations',
add a new subsection:
7.2.5 Bits intrinsic operations
Bit operations are used to express bitwise operations on sequences of
bits, or to concatenate such sequences. Evaluation of a bits opertion
produces a result of type bits. The permitted types of operands of the
bits intrinsic operations are specified in 7.1.2.
The bits operators and their interpretation when used to form an
expression are given in Table 7.6a, where denotes the operand of
type bits to the left of the operator and of type bits denotes
the operand to the right of the operator. If one of the operands of
is not of type bits, or they are of unequal kind type, they are
converted as described in 7.1.2 before the operation is performed.
Table 7.6a Interpretaion of the bits intrinsic operators
---------------------------------------------------------------------
Operator Representing Use of operator Interpretation
---------------------------------------------------------------------
// concatenation // concatenate with
.NOT. bitwise not .NOT. bitwise not of
.AND. bitwise and .AND. bitwise and of and
.OR. bitwise or .OR. bitwise or of and
.XOR. bitwise .XOR. bitwise exclusive or of
exclusive or and
.NEQV. bitwise .NEQV. bitwise nonequivalence
nonequivalence of and
.EQV. bitwise .EQV. bitwise equivalence of
equivalence and
--------------------------------------------------------------------
The result of the bits concatenation operator // is a bits value
whose kind type parameter is the sum of the kind type parameters
of the operands. The leftmost KIND() bits of the result is the
value of and the righmost KIND() bits of the result is
the value of .
For the bits intrinsic operators other than //, the result value is
computed separately for each pair of bits at corresponding positions
in each operand. The value of each bit operation, for bits denoted
and are given in Table 7.6b.
Table 7.6b The values of bitwise operations involving bits intrinsic
operators
--------------------------------------------------------------------
.NOT. .AND. .OR. .XOR.
0 0 1 0 0 0
0 1 0 0 1 1
1 0 1 0 1 1
1 1 0 1 1 0
--------------------------------------------------------------------
The values for the operation .NEQV. are the same as for
the operation .XOR. . The values for the operation
.EQV. are the same as for the operation
.NOT. ( .XOR. ).
.....................................................................
[136:5+] In 'Table 7.7 Categories of operations and relative
precedence', in the column labeled "Category of operation" replace
"Logical" with "Logical or Bits" four times. In the second to last
row of the same table, replace ".EQV. or .NEQV." with ".EQV., .NEQV.,
or .XOR.".
.....................................................................
[139:2] In 'Table 7.8 Type conformance for the intrinsic assignment
statement', modify the entries for integer, real, complex, and
logical, and add an entry for bits as follows:
Type of Type of
integer integer, real, complex, bits
real integer, real, complex, bits
complex integer, real, complex, bits
bits integer, real, complex, bits, logical
logical logical, bits
.....................................................................
[139:6-7] In the paragraph following Table 7.8, before the last
sentence, insert a new sentence:
A <> is an intrinsic
assignment statement for which either or is of
type bits.
.....................................................................
[141:13+] In '7.4.1.3 Interpretation of intrinsic assignments' add
four new paragraphs and a Note:
For a bits intrinsic assignment statement where and
are both of type bits and have the same type kind parameter value, the
resulting value in is the same as that of . If
has a larger type kind parameter value than , the
lower KIND() bits of the resulting value in are the
same as those of and the upper KIND() - KIND()
bits are 0. If the has a smaller type kind parameter value
that , the lower KIND() bits of are the
resulting value in . Conversion of the bits value of a
variable, E, to a bits value with a different kind type parameter has
the effect of the bits intrinsic assignment V = E, where KIND(V) is
the kind type parameter of the converted value.
For a bits intrinsic assignment statement where the type of is
not bits, the value of is first converted to a bits value,
with a kind type parameter value of COMPATIBLE_BITS_KIND(X) where
X is a variable with the same type and type kind parameter as .
The bit sequence of the resulting bits value is the same as that of
the internal representation of .
For a bits intrinsic assignment statement where the type of
is not bits, the value of is first converted to a bits value
with a kind type parameter value of COMPATIBLE_BITS_KIND(X) where X is
a variable with the same type and kind type parameter as
. Following the assignment, the internal representation of
has the same sequence of bits as the converted value of
.
If the in a bits intrinsic assignment is not of type
bits, the seqeunce of bits in , after conversion to the kind
compatible with , shall represent a valid value for the
type and type kind parameters of .
Note 7.38a: Bits assignment is not always the same as the result of
the TRANSFER intrinsic. The TRANSFER operation is based on the memory
image of the data, while bits assignment is based on the data values.
For example, if S is a 32-bit integer array of size 8, and R is a
64-bit bits array of size 8, R = TRANSFER(S,R) will result in the
values of S packed into the first 4 elements of R. The way in which
this packing is done will be different on little endian and big endian
machines. The bits assignment, R = S, will result in all 8 elements
of R being defined, where R(i) contains the bits from S(i) in the
right 32 bits, and 0 in the left 32 bits. Bits assignment does not
depend on which endian the processor's memory system uses.
[end Note]
.....................................................................
[143:14] In C716 in section '7.4.2 Pointer assignment' replace the
last phrase "and the corresponding kind type parameters shall be
equal" to "and the corresponding kind type parameters shall be
equal, or and shall be bits
type compatible (5.1.1.2).
.....................................................................
[144:21] In '7.4.2.1 Data pointer assignment' replace the end of the
first sentence of the 4th paragraph "as the corresponding type
parameters of , or and
shall be bits type compatible (5.1.1.2)."
.....................................................................
[233:19-] After note 10.17 in section '10.6.3 Character editing'
add a new section:
10.6.3a Bits editing
The I, I, B, B, O, O, Z, and Z edit
descriptors indicate that the field to be edited occupies
positions, except when is zero. When is zero, the processor
selects the field width. On input, shall not be zero. The
specified input/output list item shall be of type bits. The G edit
descriptor also may be used to edit bits data (10.6.4.4).
On input, m has no effect.
In the input field for the I edit descriptor, the character string
shall be an (R406), except for the
intrepretation of blanks. For the B, O, and Z edit descriptors, the
character string shall consist of binary, octal, or hexadecimal
digits (as in R412, R413, R414) in the respective input field. The
lower-case hexadecimal digits a through f in a hexadecimal input
field are equivalent to the corresponding upper-case hexadecimal
digits.
The output field for the I edit descriptor consists of zero or
more leading blanks, followed by an optional plus sign, followed
by the internal value, as interpreted as a non-negative integer,
as a without leading zeros. The interpretation of
a bits value as a non-negative integer is described in 13.3.
Note 10.17a
The always consists of at least one digit.
[end Note]
The output field for the B, O, and Z descriptors consists
of zero or more leading blanks followed by the internal value in
a form identical to the digits of a binary, octasl, or hexadecimal
constant, respectively, with the same value and without leading
zeros.
Note 10.17b
A binary, octal, or hexadecimal constant always consists of at
least one digit.
[end Note]
The output field for the I, B, O, and Z edit
descriptor is the same as for the I, B, O, and Z edit
descriptor, except that the consists of at least
digits. If necessary, sufficient leading zeros are included to
achieve the minimum of digits. The value of shall not
exceed the value of , except when is zero. If is zero
and the internal value consists of all zero bits, the output field
consists of only blank characters. When and are both zero,
and the internal value consists of all zero bits, one blank
character is produced.
.....................................................................
[234:18+] After subsection 10.6.4.3, add a new subsection:
10.6.4.4 Generalized bits editing
When used to specify the input/output of bits data, the G and
GE edit descriptors follow the rules for the Zw edit
descriptor (10.6.1.1), except that shall not be zero.
.....................................................................
[237:42-43] Replace the first sentence of the third paragraph of
'10.7.6 BN annd BZ editing' with:
The blank interpretation mode affects only numeric editing (10.6.1),
bits editing (10.6.3a), generalized numeric editing (10.6.4.1), and
generalized bits editing (10.6.4.4) on input.
.....................................................................
[240:20+] At the end of '10.9.1 List-directed input' add a new
paragraph:
When the effective item is of type bits, the value on the input
record is interpreted as if a Z edit descriptor with a
suitable value of were used.
.....................................................................
[242:24+] At the end of '10.9.2 List-directed output' add a new
paragraph:
Bits output constants are produced with the effect of a Z edit
descriptor. A reasonable processor-dependent value of is
used for each of the bits constants output.
.....................................................................
[243:36] In the first sentence of '10.10.1.2' Namelist input values'
replace "list items of types logical, integer, and character" with
"list items of types logical, integer, character, and bits".
.....................................................................
[245:10+] At the end of '10.10.1.3 Namelist group object list items'
add a new paragraph:
When the next effective list item is of type bits, the value in the
input record is interpreted as if a Z edit descriptor with a
suitable value of were used.
.....................................................................
[247:22+] At the end of '10.10.2.1 Namelist output editing" add a
new paragraph:
Bits output constants are produced with the effect of a Z edit
descriptor. A reasonable processor-dependent value of is
used for each of the bits constants output.
.....................................................................
[268:21] In the first sentence of '12.4.1.2 Actual arguments
associated with dummy data objects', replace "it shall be type
compatible (5.1.1.2) with" with "it shall be type compatible or
bits type compatible (5.1.1.2) with".
.....................................................................
[269:1] Replace the beginning of the first sentence of the second
paragraph of '12.4.1.2 Actual arguments associated with dummy
data objects' "The type parameter values" with "Unless the actual
argument and the corresponding dummy argument are bits type
compatible, the type parameter values"
.....................................................................
[269:15-16] Replace the ends of each of the first two sentences in
this paragraph "and ranks shall agree" with "and ranks shall agree,
or the actual argument and the dummy argument shall be bits type
compatible and their ranks shall agree"
.....................................................................
[292:20-24] Replace the first paragraph of '13.3 Bit model' with:
The bit manipulation procedures are 23 elemental functions and one
elemental subroutine. Logical operations on bits are provided by
the elemental functions IOR, IAND, NOT, IEOR, and MERGE_BITS, and
the transformational functions IALL, IANY, and IPARITY; shift
operations are provided by the elemental functions ISHFT, ISHFTC,
SHIFTA, SHIFTL, SHIFTR, DSHIFTL, and DSHIFTR; bit subfields may be
referenced by the elemental function IBITS and by the elemental
subroutine MVBITS; single-bit processing is provided by the
elemental functions BTEST, IBSET, and IBCLR; characterization of
bit sequences are provided by the elemental functions POPCNT, POPPAR,
LEADZ, and TRAILZ.
.....................................................................
[292:25] In the first sentence of the second paragraph of '13.3 Bit
model' replace "a bit is defined to be" with:
a bit in the bit model for an integer is defined to be
.....................................................................
[292:28+] Add a new paragraph following the second paragraph of
'13.3 Bit model':
Using the notation of the formula above, the value of a bits object
of kind is represented as the ordered sequence of bits with
the bit at position . The rightmost bit is and the
leftmost bit is . Such a bits object may be interpreted as a
nonnegative integer with the value .
.....................................................................
[295:29-] In the list of '13.5.4 Kind functions' add a new entry:
COMPATIBLE_BITS_KIND(X) Bits kind type parameter compatible with
the argument
.....................................................................
[295:29+] In the list of '13.5.4 Kind functions' add a new entry:
SELECTED_BITS_KIND(N) Bits kind type parameter, given number
of bits
.....................................................................
[295:36-] In the list of '13.5.5 Miscellaneous type conversion
functions' add a new entry:
BITS(A [,KIND]) Conversion to type bits
.....................................................................
[296:20-31] In the list of '13.5.9 Bit manipulation procedures', add
the following at the correct alphabetical locations:
DSHIFTL (I, J, SHIFT) Double left shift
DSHIFTR (I, J, SHIFT) Double right shift
MERGE_BITS (I, J, MASK) Merge bits under mask
SHIFTA (I, SHIFT) Arithmetic right shift
SHIFTL (I, SHIFT) Left shift
SHIFTR (I, SHIFT) Right shift
.....................................................................
[296:31+] After '13.5.9 Bit manipulation procedures', add a two new
subsections:
13.5.9a Bit reduction functions
LEADZ (I [,KIND]) Number of leading zero bits
POPCNT (I [,KIND]) Number of one bits
POPPAR (I [,KIND]) Parity of one bits
TRAILZ (I [,KIND]) Number of trailing zero bits
13.5.9b Bit construction functions
MASKL (I [,KIND]) Left justified bit mask
MASKR (I [,KIND]) Right justified bit mask
.....................................................................
[297:4-11] In the list of '13.5.12 Array reduction functions', add
the following at the correct alphabetical locations:
IALL (ARRAY, DIM [,MASK]) or Bitwise AND of array elements
IALL (ARRAY [,MASK])
IANY (ARRAY, DIM [,MASK]) or Bitwise OR of array elements
IANY (ARRAY [,MASK])
IPARITY (ARRAY, DIM, [,MASK]) or Bitwise exclusive OR of elements
IPARITY (ARRAY [,MASK])
PARITY (MASK [,DIM]) True if an odd number of values
is true
.....................................................................
Modify the description of the ACHAR function (13.7.2):
[300:29] Change the description of the argument I to:
"shall be of type integer or bits. If I is of type bits, it is
interpreted as a non-negative integer as described in 13.3.
[301:6] Append to the current Example text:
ACHAR(z'41') has the value 'A'.
.....................................................................
[306:13+] Add a new intrinsic function, BITS:
13.7.15a BITS (A [, KIND])
<> Convert to bits type.
<> Elemental function.
<>
A shall be of type integer, real, complex, logical, or bits.
KIND shall be a scalar initialization expression.
<> Bits. If KIND is present, the kind
type parameter is that specified by the value of KIND; otherwise,
the kind type parameter is that of the default bits type.
<> The result value is that with which R becomes
defined as a result of the intrinisc assignment R = A, for a bits
variable R with the kind type parameter specified.
<> BITS(z"abcd",32) has the value z"0000abcd". BITS(-1)
has the value z"ffffffff" for an implementation where the default
integer representation is 32-bit two's-complement. BITS(.true.,5)
has the value b"00001" for an implementation that represents the
logical value true by setting the low order bit of the internal value
and clearing the other bits. BITS(Inf) has the value z"7f800000" if
the value of Inf is an IEEE 32-bit real Infinity and the default
bits kind is 32.
.....................................................................
[306:14-21] Replace the definition of BIT_SIZE (13.7.16):
13.7.16 BIT_SIZE(I)
<> Returns the number of bits.
<> Inquiry function.
<> I shall be of type integer or bits. It may be a scalar
or an array.
<> If I is of type integer the result has
is a scalar integer with the same kind type parameter as I. If I is of
type bits, the result is of type default integer.
<> If I is of type integer, the result has the value
of the number of bits of the model integer defined for bit
manipulation contexts in 13.3. If I is of type bits, the result
value is KIND(I).
<> BIT_SIZE(1) has the value 32 if of the model is 32.
BIT_SIZE(z"ffff") has the value 16.
.....................................................................
Modify the definition of BTEST (13.7.17)
[306:26] Change the description of the I argument to: "shall be of
type integer or bits."
[307:1+] Append to the current Example text:
BTEST(b"01000",3) has the value true.
.....................................................................
Modify the definition of CHAR (13.7.19)
[307:17] Change the description of the argument I to:
shall be of type integer or bits. If I is of type bits, it is
interpreted as a non-negative integer as described in 13.3. The
value of I shall be in the range 0 <= I <= -1, where is
the number of characters in the collating sequence associated
with the specified kind type parameter.
[307:26] Append to the current Example text:
CHAR(z'41') has the value 'A' on a processor using the ASCII
collating sequence.
.....................................................................
Modify the definition of CMPLX (13.7.20)
[307:31] In the descrption of the X argument, replace "or complex, or
a with "complex, or bits".
[308:1] On the description of the Y argument, replace "integer or
real, or a " with "integer, real, or bits".
.....................................................................
[308:20+] Add a new intrinsic function, COMPATIBLE_BITS_KIND:
13.7.21a COMPATIBLE_BITS_KIND (X)
<> Return bits compatible kind
<> Inquiry function.
<> Shall be of type bits, integer, real, complex, or
logical.
<> Default integer scalar.
<