'\" t .\" Title: bitfieldExtract .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 01/03/2018 .\" Manual: [FIXME: manual] .\" Source: [FIXME: source] .\" Language: English .\" .TH "BITFIELDEXTRACT" "3G" "01/03/2018" "[FIXME: source]" "[FIXME: manual]" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" bitfieldExtract \- extract a range of bits from an integer .SH "DECLARATION" .HP \w'genIType\ bitfieldExtract('u .BI "genIType bitfieldExtract(genIType\ " "value" ", int\ " "offset" ", int\ " "bits" ");" .HP \w'genUType\ bitfieldExtract('u .BI "genUType bitfieldExtract(genUType\ " "value" ", int\ " "offset" ", int\ " "bits" ");" .SH "PARAMETERS" .PP \fIvalue\fR .RS 4 Specifies the integer from which to extract bits\&. .RE .PP \fIoffset\fR .RS 4 Specifies the index of the first bit to extract\&. .RE .PP \fIbits\fR .RS 4 Specifies the number of bits to extract\&. .RE .SH "DESCRIPTION" .PP \fBbitfieldExtract\fR extracts a subset of the bits of \fIvalue\fR and returns it in the least significant bits of the result\&. The range of bits extracted is [\fIoffset\fR, \fIoffset\fR + \fIbits\fR + 1]\&. .PP For unsigned data types, the most significant bits of the result will be set to zero\&. For signed data types, the most significant bits will be set to the value of bit \fIoffset\fR + \fIbase\fR \- 1 (i\&.e\&., it is \fIsign extended\fR to the width of the return type)\&. .PP If \fIbits\fR is zero, the result will be zero\&. The result will be undefined if \fIoffset\fR or \fIbits\fR is negative, or if the sum of \fIoffset\fR and \fIbits\fR is greater than the number of bits used to store the operand\&. .SH "VERSION SUPPORT" .TS allbox tab(:); lB cB s s s s s s s s s s s lB cB cB cB cB cB cB cB cB cB cB cB cB. T{ T}:T{ \fBOpenGL Shading Language Version\fR T} T{ \fBFunction Name\fR T}:T{ \fB1\&.10\fR T}:T{ \fB1\&.20\fR T}:T{ \fB1\&.30\fR T}:T{ \fB1\&.40\fR T}:T{ \fB1\&.50\fR T}:T{ \fB3\&.30\fR T}:T{ \fB4\&.00\fR T}:T{ \fB4\&.10\fR T}:T{ \fB4\&.20\fR T}:T{ \fB4\&.30\fR T}:T{ \fB4\&.40\fR T}:T{ \fB4\&.50\fR T} .T& l c c c c c c c c c c c c. T{ bitfieldInsert T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ \- T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T} .TE .sp 1 .SH "SEE ALSO" .PP \fBbitfieldExtract\fR() .SH "COPYRIGHT" .PP Copyright \(co 2011\-2014 Khronos Group\&. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1\&.0, 8 June 1999\&. \m[blue]\fBhttp://opencontent\&.org/openpub/\fR\m[]\&. .SH "COPYRIGHT" .br Copyright \(co 2011-2014 Khronos Group .br