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

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

Contents


BOOL(3F)							      BOOL(3F)


NAME    [Toc]    [Back]

     bool: iand, kiand,	and, iior, ior,	or, jior, kior,	inot, jnot, knot, not,
     iieor, jieor, kieor, ieor,	xor, iishft, jishft, kishft, ishft, lshift,
     rshift, iishftc, jishftc, kishftc,	ishftc,	iibits,	jibits,	kibits,	ibits,
     iibset, jibset, kibset, ibset, bitest, bjtest, bktest, btest, iibclr,
     jibclr, kibclr, ibclr, mvbits - FORTRAN bitwise boolean functions

SYNOPSIS    [Toc]    [Back]

     integer i,	k, l, m, n, len
     integer*2 ii1, ii2, ii3
     integer*8 kk1, kk2, kk3
     logical b
     logical*2 c
     logical*8 cc

     i = iand(m, n)
     kk3 = kiand(kk1, kk2)
     i = and(m,	n)

     ii3 = iior(ii1, ii2)
     kk3 = kior(kk1, kk2)
     i = ior(m,	n)
     i = or(m, n)
     i = jior(m, n)

     ii3 = inot(ii1)
     kk3 = knot(kk1)
     i = jnot(m)
     i = not(m)

     ii3 = iieor(ii1, ii2)
     kk3 = kieor(kk1, kk2)
     i = jieor(m, n)
     i = ieor(m, n)
     i = xor(m,	n)

     ii3 = iishft(ii1, ii2)
     kk3 = kishft(kk1, kk2)
     i = jishft(m, k)
     i = ishft(m, k)
     i = lshift(m, k)
     i = rshift(m, k)

     ii3 = iishftc(ii1,	ii2, len)
     kk3 = kishftc(kk1,	kk2, len)
     i = jishftc(m, k, len)
     i = ishftc(m, k, len)

     ii3 = iibits(ii1, ii2, len)
     kk3 = kibits(kk1, kk2, len)
     i = jibits(m, k, len)
     i = ibits(m, k, len)



									Page 1






BOOL(3F)							      BOOL(3F)



     ii3 = iibset(ii1, ii2)
     kk3 = kibset(kk1, kk2)
     i = jibset(n, k)
     i = ibset(n, k)

     c = bitest(ii1, ii2)
     cc	= bktest(kk1, kk2)
     b = bjtest(n, k)
     b = btest(n, k)

     ii3 = iibclr(ii1, ii2)
     kk3 = kibclr(kk1, kk2)
     i = jibclr(n, k)
     i = ibclr(n, k)

     call mvbits(m, k, len, n, l)

DESCRIPTION    [Toc]    [Back]

     bool is the general name for the bit field	manipulation intrinsic
     functions and subroutines from the	FORTRAN	Military Standard (MIL-STD1753).


     and, or and xor return the	value of the binary operations on their
     arguments.	 not is	a unary	operator returning the one's complement	of its
     argument.	ior, iand, not,	ieor - return the same results as and, or,
     not, and xor.

     lshift and	rshift return the value	of the first argument shifted left or
     right, respectively, the number of	times specified	by the second
     (integer) argument.  lshift and rshift are	implemented as logical shifts,
     in	other words, zeros are shifted in.

     ishft, ishftc - m specifies the integer to	be shifted.  k specifies the
     shift count.  k > 0 indicates a left shift.  k = 0	indicates no shift.  k
     < 0 indicates a right shift.  In ishft, zeros are shifted in.  In ishftc,
     the rightmost len bits are	shifted	circularly k bits.  If k is greater
     than the machine word-size, ishftc	will not shift.

     iand, ior,	not, ieor, and ishft accept either integer*2 or	integer*4
     arguments and the result is the same type.	 When one of these intrinsics
     is	specified as an	argument in a subroutine call or function reference,
     the compiler supplies either an integer*2 or integer*4 function depending
     on	the -i2	command	line option.

     Bit fields	are numbered from right	to left	and the	rightmost bit position
     is	zero.  The length of the len field must	be greater than	zero.

     ibits - extract a subfield	of len bits from m starting with bit position
     k and extending left for len bits.	 The result field is right justified
     and the remaining bits are	set to zero.





									Page 2






BOOL(3F)							      BOOL(3F)



     btest - The kth bit of argument n is tested.  The value of	the function
     is	.TRUE. if the bit is a 1 and .FALSE. if	the bit	is 0.

     ibset - the result	is the value of	n with the kth bit set to 1.

     ibclr - the result	is the value of	n with the kth bit set to 0.

     mvbits - len bits are moved beginning at position k of argument m to
     position l	of argument n.

NOTE    [Toc]    [Back]

     The rightmost bit is bit position 0.

WARNING    [Toc]    [Back]

     If	the user specifies a shift count larger	than or	equal to the machine
     word size the result of the shift operation is undefined.	Similarly, bit
     operations	which involve bit positions less than 0	or greater than	the
     machine word size will have indeterminate results.

     Since intrinsic functions promote their arguments to the largest type in
     the argument list,	unexpected sign	extensions may occur.  For example:

     integer *1	m,k,i,j
     m=-1
     k=1
     i=rshift(m,k)
     j=rshift(m,1)

     The value of i will be 127, a 0 is	shifted	into bit position 7 of the
     byte.  However the	value of j will	be -1, both arguments are converted to
     integer, sign extending m,	a shift	is performed, shifting a 0 into	bit
     position 31.  The result is truncated to 8	bits and stored	in j.






















									Page 3



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

NAME    [Toc]    [Back]

     ISHFTC - Performs a circular shift	of the rightmost bits

SYNOPSIS    [Toc]    [Back]

     ISHFTC ([I=]i, [SHIFT=]shift [,[SIZE=]size])

IMPLEMENTATION    [Toc]    [Back]

     UNICOS, UNICOS/mk,	and IRIX systems

STANDARDS    [Toc]    [Back]

     Fortran 90

DESCRIPTION    [Toc]    [Back]

     The ISHFTC	intrinsic function performs a circular shift of	the
     rightmost bits.  It accepts the following arguments:

     i	       Must be of type integer.

     shift     Must be of type integer.	 The absolute value of shift must
	       be less than or equal to	size.

     size      Must be of type integer.	 The value of size must	be positive
	       and must	not exceed BIT_SIZE(i).	 If size is absent, it is
	       as if it	were present with the value of BIT_SIZE(i).

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

RETURN VALUES    [Toc]    [Back]

     The result	type and type parameter	are the	same as	i.  The	result has
     the value obtained	by shifting the	size rightmost bits of i circularly
     by	shift positions.  If shift is positive,	the shift is to	the left;
     if	shift is negative, the shift is	to the right; and if shift is zero,
     no	shift is performed.  No	bits are lost.	The unshifted bits are
     unaltered.	 The bit model defines the interpretation of an	integer
     value as a	sequence of bits.  For more information	on the model, see
     the MODELS(3I) man	page.

EXAMPLES    [Toc]    [Back]

     ISHFTC(3, 2, 3) has the value 5.

SEE ALSO    [Toc]    [Back]

      
      
     MODELS(3I)

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

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

NAME    [Toc]    [Back]

     ISHFTC - Performs a circular shift	of the rightmost bits

SYNOPSIS    [Toc]    [Back]

     ISHFTC ([I=]i, [SHIFT=]shift [,[SIZE=]size])

IMPLEMENTATION    [Toc]    [Back]

     UNICOS, UNICOS/mk,	and IRIX systems

STANDARDS    [Toc]    [Back]

     Fortran 90

DESCRIPTION    [Toc]    [Back]

     The ISHFTC	intrinsic function performs a circular shift of	the
     rightmost bits.  It accepts the following arguments:

     i	       Must be of type integer.

     shift     Must be of type integer.	 The absolute value of shift must
	       be less than or equal to	size.

     size      Must be of type integer.	 The value of size must	be positive
	       and must	not exceed BIT_SIZE(i).	 If size is absent, it is
	       as if it	were present with the value of BIT_SIZE(i).

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

RETURN VALUES    [Toc]    [Back]

     The result	type and type parameter	are the	same as	i.  The	result has
     the value obtained	by shifting the	size rightmost bits of i circularly
     by	shift positions.  If shift is positive,	the shift is to	the left;
     if	shift is negative, the shift is	to the right; and if shift is zero,
     no	shift is performed.  No	bits are lost.	The unshifted bits are
     unaltered.	 The bit model defines the interpretation of an	integer
     value as a	sequence of bits.  For more information	on the model, see
     the MODELS(3I) man	page.

EXAMPLES    [Toc]    [Back]

     ISHFTC(3, 2, 3) has the value 5.

SEE ALSO    [Toc]    [Back]

      
      
     MODELS(3I)

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

[ Back ]
 Similar pages
Name OS Title
min IRIX FORTRAN minimum-value functions
max IRIX FORTRAN maximum-value functions
max IRIX FORTRAN maximum-value functions
min IRIX FORTRAN minimum-value functions
round IRIX FORTRAN nearest integer functions
mod IRIX FORTRAN remaindering intrinsic functions
lge IRIX FORTRAN string comparison intrinsic functions
strcmp IRIX FORTRAN string comparison intrinsic functions
dim IRIX FORTRAN positive difference intrinsic functions
dot IRIX BLAS level ONE, dot product functions FORTRAN 77 SYNOPSIS double precision ddot( n, x, incx, y, incy ) integer
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service