*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> f90/popcnt (3)              
Title
Content
Arch
Section
 

Contents


POPCNT(3I)					       Last changed: 1-6-98

NAME    [Toc]    [Back]

     _popcnt, POPCNT - Counts number of	set bits

SYNOPSIS    [Toc]    [Back]

     C/C++:

     #include <intrinsics.h>
     int _popcnt (long i);

     Fortran:

     POPCNT ([I=]i)

IMPLEMENTATION    [Toc]    [Back]

     C/C++:  UNICOS and	UNICOS/mk systems

     Fortran:  UNICOS, UNICOS/mk, and IRIX systems

STANDARDS    [Toc]    [Back]

     C/C++:  Cray Research extension

     Fortran:  CF90 and	MIPSpro	7 Fortran 90 compiler extension	to Fortran
     90

C/C++ DESCRIPTION
     The _popcnt function returns the number of	bits set to 1 (the
     population	count) in argument i.

FORTRAN	DESCRIPTION
     This intrinsic function counts the	number of bits set in the argument.
     It	accepts	the following argument:

     i	  A Boolean, integer, real, or Cray pointer value.  On IRIX
	  systems, i cannot be declared	as REAL(KIND=16).

     POPCNT is an elemental function.  The name	of this	intrinsic cannot be
     passed as an argument.

C/C++ NOTES
     Because _popcnt is	an intrinsic function, no externally visible
     library function is available for it.  The	compiler generates inline
     code to produce the result.

FORTRAN	NOTES
     The bit representation of the logical data	type is	not consistent
     among Cray	Research systems.  For further details,	see your compiler's
     reference manuals.

FORTRAN	RETURN VALUES
     POPCNT returns a value of type integer.

EXAMPLES    [Toc]    [Back]

     Fortran: The following section of Fortran code shows the POPCNT
     function used with	an argument of type integer.  The bit pattern of
     the argument and the value	of the result are also given.  For
     simplicity, a 16-bit object is used.

	  INTEGER I1, I2
	  ...
	  I2 = POPCNT(I1)


	   ---------------------------------------------------------------
	  | 0 |	0 | 0 |	0 | 0 |	1 | 1 |	0 | 0 |	1 | 1 |	1 | 0 |	0 | 1 |	0 |
	   ---------------------------------------------------------------
					 I1

     The POPCNT	function returns the value 6 to	the integer variable I2.

SEE ALSO    [Toc]    [Back]

      
      
     A complete	list of	C/C++ intrinsic	functions available on Cray
     Research systems is in the	Cray C/C++ Reference Manual, publication SR
     -2179.

     Intrinsic Procedures Reference Manual, publication	SR-2138, for the
     printed version of	this man page.

POPCNT(3I)					       Last changed: 1-6-98

NAME    [Toc]    [Back]

     _popcnt, POPCNT - Counts number of	set bits

SYNOPSIS    [Toc]    [Back]

     C/C++:

     #include <intrinsics.h>
     int _popcnt (long i);

     Fortran:

     POPCNT ([I=]i)

IMPLEMENTATION    [Toc]    [Back]

     C/C++:  UNICOS and	UNICOS/mk systems

     Fortran:  UNICOS, UNICOS/mk, and IRIX systems

STANDARDS    [Toc]    [Back]

     C/C++:  Cray Research extension

     Fortran:  CF90 and	MIPSpro	7 Fortran 90 compiler extension	to Fortran
     90

C/C++ DESCRIPTION
     The _popcnt function returns the number of	bits set to 1 (the
     population	count) in argument i.

FORTRAN	DESCRIPTION
     This intrinsic function counts the	number of bits set in the argument.
     It	accepts	the following argument:

     i	  A Boolean, integer, real, or Cray pointer value.  On IRIX
	  systems, i cannot be declared	as REAL(KIND=16).

     POPCNT is an elemental function.  The name	of this	intrinsic cannot be
     passed as an argument.

C/C++ NOTES
     Because _popcnt is	an intrinsic function, no externally visible
     library function is available for it.  The	compiler generates inline
     code to produce the result.

FORTRAN	NOTES
     The bit representation of the logical data	type is	not consistent
     among Cray	Research systems.  For further details,	see your compiler's
     reference manuals.

FORTRAN	RETURN VALUES
     POPCNT returns a value of type integer.

EXAMPLES    [Toc]    [Back]

     Fortran: The following section of Fortran code shows the POPCNT
     function used with	an argument of type integer.  The bit pattern of
     the argument and the value	of the result are also given.  For
     simplicity, a 16-bit object is used.

	  INTEGER I1, I2
	  ...
	  I2 = POPCNT(I1)


	   ---------------------------------------------------------------
	  | 0 |	0 | 0 |	0 | 0 |	1 | 1 |	0 | 0 |	1 | 1 |	1 | 0 |	0 | 1 |	0 |
	   ---------------------------------------------------------------
					 I1

     The POPCNT	function returns the value 6 to	the integer variable I2.

SEE ALSO    [Toc]    [Back]

      
      
     A complete	list of	C/C++ intrinsic	functions available on Cray
     Research systems is in the	Cray C/C++ Reference Manual, publication SR
     -2179.

     Intrinsic Procedures Reference Manual, publication	SR-2138, for the
     printed version of	this man page.

[ Back ]
 Similar pages
Name OS Title
leadz IRIX Counts number of leading 0 bits
count IRIX Counts the number of true array elements
XmTabListTabCount HP-UX A convenience function that counts the number of tabs
bit_size IRIX Returns the number of bits in an integer in the bit manipulation model
ipxfwstopsig IRIX Returns part of the lower bits of signal number that terminates child process
dumpcounts IRIX print out pixie .Counts file structure
cksum OpenBSD display file checksums and block counts
cksum IRIX display file checksums and block counts
cksum FreeBSD display file checksums and block counts
sum OpenBSD display file checksums and block counts
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service