2 .\" Copyright (c) 2018 Netflix, Inc.
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions, and the following disclaimer,
10 .\" without modification, immediately at the beginning of the file.
11 .\" 2. The name of the author may not be used to endorse or promote products
12 .\" derived from this software without specific prior written permission.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
18 .\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 .Nd fixed-point math functions which manipulate the control/sign data bits
43 .Fn Q_SIGNSHFT "QTYPE q"
45 .Fn Q_SSIGN "QTYPE q" "bool isneg"
47 .Fn Q_CRAWMASK "QTYPE q"
49 .Fn Q_SRAWMASK "QTYPE q"
55 .Fn Q_SCVAL "QTYPE q" "ITYPE cv"
58 gets the bit position of
60 sign bit relative to bit zero.
75 control bits and sign bit respectively.
80 get the raw masked control bits and value of
82 control bits respectively.
87 control bits to the value
90 All of those functions operate on
91 the following data types:
101 which are referred to generically as
109 For more details, see
113 returns the sign bit's position as an integer.
125 return their respective values as integers of the same underlying ITYPE as
139 functions first appeared in
145 functions and this manual page were written by
146 .An Lawrence Stewart Aq Mt lstewart@FreeBSD.org
147 and sponsored by Netflix, Inc.