]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/fortran/doc/gfortran/intrinsic-procedures/mvbits.rst
sphinx: copy files from texi2rst-generated repository
[thirdparty/gcc.git] / gcc / fortran / doc / gfortran / intrinsic-procedures / mvbits.rst
1 ..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6 .. _mvbits:
7
8 .. index:: MVBITS
9
10 .. index:: BMVBITS
11
12 .. index:: IMVBITS
13
14 .. index:: JMVBITS
15
16 .. index:: KMVBITS
17
18 .. index:: bits, move
19
20 MVBITS --- Move bits from one integer to another
21 ************************************************
22
23 .. function:: MVBITS(FROM, FROMPOS, LEN, TO, TOPOS)
24
25 Moves :samp:`{LEN}` bits from positions :samp:`{FROMPOS}` through
26 ``FROMPOS+LEN-1`` of :samp:`{FROM}` to positions :samp:`{TOPOS}` through
27 ``TOPOS+LEN-1`` of :samp:`{TO}`. The portion of argument :samp:`{TO}` not
28 affected by the movement of bits is unchanged. The values of
29 ``FROMPOS+LEN-1`` and ``TOPOS+LEN-1`` must be less than
30 ``BIT_SIZE(FROM)``.
31
32 :param FROM:
33 The type shall be ``INTEGER``.
34
35 :param FROMPOS:
36 The type shall be ``INTEGER``.
37
38 :param LEN:
39 The type shall be ``INTEGER``.
40
41 :param TO:
42 The type shall be ``INTEGER``, of the
43 same kind as :samp:`{FROM}`.
44
45 :param TOPOS:
46 The type shall be ``INTEGER``.
47
48 Standard:
49 Fortran 90 and later, has overloads that are GNU extensions
50
51 Class:
52 Elemental subroutine
53
54 Syntax:
55 .. code-block:: fortran
56
57 CALL MVBITS(FROM, FROMPOS, LEN, TO, TOPOS)
58
59 Specific names:
60 .. list-table::
61 :header-rows: 1
62
63 * - Name
64 - Argument
65 - Return type
66 - Standard
67
68 * - ``MVBITS(A)``
69 - ``INTEGER A``
70 - ``INTEGER``
71 - Fortran 90 and later
72 * - ``BMVBITS(A)``
73 - ``INTEGER(1) A``
74 - ``INTEGER(1)``
75 - GNU extension
76 * - ``IMVBITS(A)``
77 - ``INTEGER(2) A``
78 - ``INTEGER(2)``
79 - GNU extension
80 * - ``JMVBITS(A)``
81 - ``INTEGER(4) A``
82 - ``INTEGER(4)``
83 - GNU extension
84 * - ``KMVBITS(A)``
85 - ``INTEGER(8) A``
86 - ``INTEGER(8)``
87 - GNU extension
88
89 See also:
90 :ref:`IBCLR`,
91 :ref:`IBSET`,
92 :ref:`IBITS`,
93 :ref:`IAND`,
94 :ref:`IOR`,
95 :ref:`IEOR`