To: J3 07-197 From: Bill Long Subject: UTI 109 (page 408): popcnt result kind Date: 2007 April 28 References: J3/07-007r1 Discussion The argument for allowing a non-default integer result for POPCNT paralleled that for LEN. In particular, the value of POPCNT for a "large" bits variable could be even larger that the value of LEN for a character variable that occupied the same amount of memory. There is no requirement that KIND type parameters, in general, be of type default integer. Kind and length type parameters are both of type integer [46:2-3]. However, the current definition of the KIND intrinsic (13.7.97, [389:16]) assumes that the kind type parameters for all intrinsic types are of type default integer. There appear to be two options. Option 1: Make the KIND type parameter for BITS be default integer. This makes BITS consistent with other intrinsic types. This limitation could be removed in some future standard without creating an incompatibility. Intrinsic assignment of a character expression to a bits variable is not defined, so potentially huge character expressions are not a problem. Option 2: Add an optional KIND argument to the POPCNT, KIND, and BITS_KIND intrinsics that will permit bits objects with larger kind type parameters. Overall, Option 1 seems less disruptive. Edits for Option 1 are supplied below. Option 1 is consistent with the change made to the POPCNT intrinsic description as part of UTI 109. Edits to J3/07-007r1 [57:28] After the second sentence in 4.4.7 BITS, add a new sentence "This kind type parameter is of type default integer."