d4dfd0c276e9e7a9e6e52de90427b83d6418d452
[clinton/guile-figl.git] / upstream-man-pages / manglsl / bitfieldInsert.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id="bitfieldInsert">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>2011</year>
9 <holder>Khronos Group</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>bitfieldInsert</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>bitfieldInsert</refname>
17 <refpurpose>insert a range of bits into an integer</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>Declaration</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>genIType <function>bitfieldInsert</function></funcdef>
23 <paramdef>genIType <parameter>base</parameter></paramdef>
24 <paramdef>genIType <parameter>insert</parameter></paramdef>
25 <paramdef>int <parameter>offset</parameter></paramdef>
26 <paramdef>int <parameter>bits</parameter></paramdef>
27 </funcprototype> <funcprototype>
28 <funcdef>genUType <function>bitfieldInsert</function></funcdef>
29 <paramdef>genUType <parameter>base</parameter></paramdef>
30 <paramdef>genUType <parameter>insert</parameter></paramdef>
31 <paramdef>int <parameter>offset</parameter></paramdef>
32 <paramdef>int <parameter>bits</parameter></paramdef>
33 </funcprototype>
34 </funcsynopsis>
35 </refsynopsisdiv>
36 <refsect1 id="parameters"><title>Parameters</title>
37 <variablelist>
38 <varlistentry>
39 <term><parameter>base</parameter></term>
40 <listitem>
41 <para>
42 Specifies the integer into which to insert <parameter>insert</parameter>.
43 </para>
44 </listitem>
45 </varlistentry>
46 <varlistentry>
47 <term><parameter>insert</parameter></term>
48 <listitem>
49 <para>
50 Specifies the the value of the bits to insert.
51 </para>
52 </listitem>
53 </varlistentry>
54 <varlistentry>
55 <term><parameter>offset</parameter></term>
56 <listitem>
57 <para>
58 Specifies the index of the first bit to insert.
59 </para>
60 </listitem>
61 </varlistentry>
62 <varlistentry>
63 <term><parameter>bits</parameter></term>
64 <listitem>
65 <para>
66 Specifies the number of bits to insert.
67 </para>
68 </listitem>
69 </varlistentry>
70 </variablelist>
71 </refsect1>
72 <refsect1 id="description"><title>Description</title>
73 <para>
74 <function>bitfieldInsert</function> inserts the <parameter>bits</parameter> least significant bits of <parameter>insert</parameter>
75 into <parameter>base</parameter> at offset <parameter>offset</parameter>. The returned value will have bits
76 [<parameter>offset</parameter>, <parameter>offset</parameter> + <parameter>bits</parameter> + 1] taken from [0, <parameter>bits</parameter> - 1]
77 of <parameter>insert</parameter> and all other bits taken directly from the corresponding bits of <parameter>base</parameter>. If
78 <parameter>bits</parameter> is zero, the result will simply be the original value of <parameter>base</parameter>. The result will
79 be undefined if <parameter>offset</parameter> or <parameter>bits</parameter> is negative, or if the sum of <parameter>offset</parameter>
80 and <parameter>bits</parameter> is greater than the number of bits used to store the operand.
81 </para>
82 </refsect1>
83 <refsect1 id="versions"><title>Version Support</title>
84 <informaltable frame="topbot">
85 #VARTABLECOLS#
86 <thead>
87 #FUNCTABLEHEADER#
88 <row>
89 <entry>bitfieldInsert</entry>#newin40#
90 </row>
91 </thead>
92 </tgroup>
93 </informaltable>
94 </refsect1>
95 <refsect1 id="seealso"><title>See Also</title>
96 <para>
97 <citerefentry><refentrytitle>bitfieldExtract</refentrytitle></citerefentry>
98 </para>
99 </refsect1>
100 <refsect1 id="Copyright"><title>Copyright</title>
101 <para>
102 Copyright <trademark class="copyright"></trademark> 2011 Khronos Group.
103 This material may be distributed subject to the terms and conditions set forth in
104 the Open Publication License, v 1.0, 8 June 1999.
105 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
106 </para>
107 </refsect1>
108 </refentry>