forked from sysprog21/datalab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bits.h
170 lines (170 loc) · 4.33 KB
/
bits.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
int absVal(int);
int test_absVal(int);
int addOK(int, int);
int test_addOK(int, int);
int allEvenBits();
int test_allEvenBits();
int allOddBits();
int test_allOddBits();
int anyEvenBit();
int test_anyEvenBit();
int anyOddBit();
int test_anyOddBit();
int bang(int);
int test_bang(int);
int bitAnd(int, int);
int test_bitAnd(int, int);
int bitCount(int);
int test_bitCount(int);
int bitMask(int, int);
int test_bitMask(int, int);
int bitMatch(int, int);
int test_bitMatch(int, int);
int bitNor(int, int);
int test_bitNor(int, int);
int bitOr(int, int);
int test_bitOr(int, int);
int bitParity(int);
int test_bitParity(int);
int bitReverse(int);
int test_bitReverse(int);
int bitXor(int, int);
int test_bitXor(int, int);
int byteSwap(int, int, int);
int test_byteSwap(int, int, int);
int conditional(int, int, int);
int test_conditional(int, int, int);
int countLeadingZero(int);
int test_countLeadingZero(int);
int copyLSB(int);
int test_copyLSB(int);
int distinctNegation(int);
int test_distinctNegation(int);
int dividePower2(int, int);
int test_dividePower2(int, int);
int evenBits();
int test_evenBits();
int ezThreeFourths(int);
int test_ezThreeFourths(int);
int fitsBits(int, int);
int test_fitsBits(int, int);
int fitsShort(int);
int test_fitsShort(int);
unsigned floatAbsVal(unsigned);
unsigned test_floatAbsVal(unsigned);
int floatFloat2Int(unsigned);
int test_floatFloat2Int(unsigned);
unsigned floatInt2Float(int);
unsigned test_floatInt2Float(int);
int floatIsEqual(unsigned, unsigned);
int test_floatIsEqual(unsigned, unsigned);
int floatIsLess(unsigned, unsigned);
int test_floatIsLess(unsigned, unsigned);
unsigned floatNegate(unsigned);
unsigned test_floatNegate(unsigned);
unsigned floatPower2(int);
unsigned test_floatPower2(int);
unsigned floatScale1d2(unsigned);
unsigned test_floatScale1d2(unsigned);
unsigned floatScale2(unsigned);
unsigned test_floatScale2(unsigned);
unsigned floatScale64(unsigned);
unsigned test_floatScale64(unsigned);
unsigned floatUnsigned2Float(unsigned);
unsigned test_floatUnsigned2Float(unsigned);
int getByte(int, int);
int test_getByte(int, int);
int greatestBitPos(int);
int test_greatestBitPos(int);
int howManyBits(int);
int test_howManyBits(int);
int implication(int, int);
int test_implication(int, int);
int intLog2(int);
int test_intLog2(int);
int isAsciiDigit(int);
int test_isAsciiDigit(int);
int isEqual(int, int);
int test_isEqual(int, int);
int isGreater(int, int);
int test_isGreater(int, int);
int isLess(int, int);
int test_isLess(int, int);
int isLessOrEqual(int, int);
int test_isLessOrEqual(int, int);
int isNegative(int);
int test_isNegative(int);
int isNonNegative(int);
int test_isNonNegative(int);
int isNonZero(int);
int test_isNonZero(int);
int isNotEqual(int, int);
int test_isNotEqual(int, int);
int isPallindrome(int);
int test_isPallindrome(int);
int isPositive(int);
int test_isPositive(int);
int isPower2(int);
int test_isPower2(int);
int isTmax(int);
int test_isTmax(int);
int isTmin(int);
int test_isTmin(int);
int isZero(int);
int test_isZero(int);
int leastBitPos(int);
int test_leastBitPos(int);
int leftBitCount(int);
int test_leftBitCount(int);
int logicalNeg(int);
int test_logicalNeg(int);
int logicalShift(int, int);
int test_logicalShift(int, int);
int maximumOfTwo(int, int);
int test_maximumOfTwo(int, int);
int minimumOfTwo(int, int);
int test_minimumOfTwo(int, int);
int minusOne();
int test_minusOne();
int multFiveEighths(int);
int test_multFiveEighths(int);
int negate(int);
int test_negate(int);
int oddBits();
int test_oddBits();
int remainderPower2(int, int);
int test_remainderPower2(int, int);
int replaceByte(int, int, int);
int test_replaceByte(int, int, int);
int rotateLeft(int, int);
int test_rotateLeft(int, int);
int rotateRight(int, int);
int test_rotateRight(int, int);
int satAdd(int, int);
int test_satAdd(int, int);
int satMul2(int);
int test_satMul2(int);
int satMul3(int);
int test_satMul3(int);
int sign(int);
int test_sign(int);
int signMag2TwosComp(int);
int test_signMag2TwosComp(int);
int specialBits();
int test_specialBits();
int subtractionOK(int, int);
int test_subtractionOK(int, int);
int thirdBits();
int test_thirdBits();
int tmax();
int test_tmax();
int tmin();
int test_tmin();
int trueFiveEighths(int);
int test_trueFiveEighths(int);
int trueThreeFourths(int);
int test_trueThreeFourths(int);
int twosComp2SignMag(int);
int test_twosComp2SignMag(int);
int upperBits(int);
int test_upperBits(int);