-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBitPattern_8h_source.html
523 lines (523 loc) · 91.3 KB
/
BitPattern_8h_source.html
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>ROSE: BitPattern.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link rel="search" href="search_opensearch.php?v=opensearch.xml" type="application/opensearchdescription+xml" title="ROSE"/>
<link href="roseDoxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">ROSE<span id="projectnumber"> 0.11.145.141</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(function() {
initMenu('',true,true,'search.html','Search');
$(document).ready(function() {
if ($('.searchresults').length > 0) { searchBox.DOMSearchField().focus(); }
});
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(document).ready(function() { init_codefold(0); });
/* @license-end */
</script>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_8509b06bafa958d2011203a730bf5778.html">frontend</a></li><li class="navelem"><a class="el" href="dir_01d256553a57eab573128ced8c11ea22.html">Disassemblers</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">BitPattern.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="preprocessor">#ifndef ROSE_BitPattern_H</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="preprocessor">#define ROSE_BitPattern_H</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span> </div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="preprocessor">#include <featureTests.h></span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#ifdef ROSE_ENABLE_BINARY_ANALYSIS</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include "integerOps.h"</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include <Rose/StringUtility.h></span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include <iostream></span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include <vector></span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> </div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespaceRose.html">Rose</a> {</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> </div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span><span class="keyword">template</span><<span class="keyword">typename</span> T></div>
<div class="foldopen" id="foldopen00056" data-start="{" data-end="};">
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html"> 56</a></span><span class="keyword">class </span><a class="code hl_class" href="classRose_1_1BitPattern.html">BitPattern</a> {</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <span class="keyword">typedef</span> std::vector<T> Words;</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keyword">typedef</span> std::vector<Words> Alternatives;</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> Words mask_; <span class="comment">// significant bits</span></div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> Alternatives patterns_; <span class="comment">// set of alternative patterns; each pattern has the same size as the mask</span></div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> </div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#a380aad58c2f125027549680ca3430fda"> 64</a></span> <a class="code hl_function" href="classRose_1_1BitPattern.html#a380aad58c2f125027549680ca3430fda">BitPattern</a>() {}</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> </div>
<div class="foldopen" id="foldopen00068" data-start="{" data-end="}">
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#a0d2801d2ee413bf4b3c9b4d644056ea2"> 68</a></span> <a class="code hl_function" href="classRose_1_1BitPattern.html#a0d2801d2ee413bf4b3c9b4d644056ea2">BitPattern</a>(T msk, T pat, <span class="keywordtype">size_t</span> wordnum) {</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <a class="code hl_function" href="classRose_1_1BitPattern.html#a4c9fc1051dae7a5b935a443f6c8eefe3">insert</a>(msk, pat, wordnum);</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> }</div>
</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> </div>
<div class="foldopen" id="foldopen00075" data-start="{" data-end="}">
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#a35aa70d03eafb149bf1e30760f37dc54"> 75</a></span> <a class="code hl_function" href="classRose_1_1BitPattern.html#a35aa70d03eafb149bf1e30760f37dc54">BitPattern</a>(<span class="keywordtype">size_t</span> lo_bit, <span class="keywordtype">size_t</span> hi_bit, T pat, <span class="keywordtype">size_t</span> wordnum) {</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <a class="code hl_function" href="classRose_1_1BitPattern.html#ae10696ac36de6e2de0a3822499c55f50">bits</a>(lo_bit, hi_bit, pat, wordnum);</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> }</div>
</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> </div>
<div class="foldopen" id="foldopen00080" data-start="{" data-end="}">
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#a6e393885473298cf881646ad0c3f2c6a"> 80</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classRose_1_1BitPattern.html#a6e393885473298cf881646ad0c3f2c6a">is_consistent</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i=0; i<patterns_.size(); ++i) {</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="keywordflow">if</span> (patterns_[i].size()!=mask_.size()) {</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> std::cerr <<<span class="stringliteral">"BitPattern::is_consistent failed\n"</span></div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <<<span class="stringliteral">" mask_.size() = "</span> <<mask_.size() <<<span class="stringliteral">"\n"</span></div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <<<span class="stringliteral">" patterns_["</span> <<i <<<span class="stringliteral">"].size() = "</span> <<patterns_[i].size() <<<span class="stringliteral">"\n"</span></div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <<<span class="stringliteral">" these two vectors should have been the same size\n"</span>;</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> std::cerr <<<span class="stringliteral">" this = "</span>;</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <a class="code hl_function" href="classRose_1_1BitPattern.html#ab22421f330283b763572b14ea54a5478">print</a>(std::cerr); <span class="comment">// printing might fail</span></div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> std::cerr <<<span class="stringliteral">"\n"</span>;</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> }</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> }</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> }</div>
</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> </div>
<div class="foldopen" id="foldopen00097" data-start="{" data-end="}">
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#a3902da5f4b6840db07d61d2bb322239f"> 97</a></span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="classRose_1_1BitPattern.html#a3902da5f4b6840db07d61d2bb322239f">nsignificant</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <span class="keywordtype">size_t</span> retval = 0;</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i=0; i<mask_.size(); ++i)</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> retval += <a class="code hl_function" href="namespaceIntegerOps.html#ad8d6e8b6826be3ee7a86824f82b7b853">IntegerOps::countSet</a>(mask_[i]);</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="keywordflow">return</span> retval;</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> }</div>
</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> </div>
<div class="foldopen" id="foldopen00106" data-start="{" data-end="}">
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#a17da0f8c17e4af34169811f9e5b05950"> 106</a></span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="classRose_1_1BitPattern.html#a17da0f8c17e4af34169811f9e5b05950">nwords</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keywordflow">return</span> mask_.size();</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> }</div>
</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> </div>
<div class="foldopen" id="foldopen00112" data-start="{" data-end="}">
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#aee9ba7ca402affa176d167ac43ba75df"> 112</a></span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="classRose_1_1BitPattern.html#aee9ba7ca402affa176d167ac43ba75df">width</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="keywordflow">if</span> (0==mask_.size())</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> assert(mask_.back()!=0);</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <span class="keywordflow">return</span> 8*<span class="keyword">sizeof</span>(T)*(mask_.size()-1) + <a class="code hl_function" href="namespaceIntegerOps.html#a5a16068e76330aa48beb66df72ecf622">IntegerOps::msb_set</a>(mask_.back()).get() + 1;</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> }</div>
</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> </div>
<div class="foldopen" id="foldopen00120" data-start="{" data-end="}">
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#ae206f4c7fab9e8436aecbc1d44d8300f"> 120</a></span> T <a class="code hl_function" href="classRose_1_1BitPattern.html#ae206f4c7fab9e8436aecbc1d44d8300f">mask</a>(<span class="keywordtype">size_t</span> wordnum) {</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="keywordflow">if</span> (wordnum >= mask_.size())</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <span class="keywordflow">return</span> mask_[wordnum];</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> }</div>
</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> </div>
<div class="foldopen" id="foldopen00131" data-start="{" data-end="}">
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#ac19ad2d81b6503b0ff0bfc230d6dad34"> 131</a></span> std::pair<T, T> <a class="code hl_function" href="classRose_1_1BitPattern.html#ac19ad2d81b6503b0ff0bfc230d6dad34">invariants</a>(T msk, <span class="keywordtype">size_t</span> wordnum) {</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="keywordflow">if</span> (msk==0 || wordnum>mask_.size() || patterns_.empty())</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> <span class="keywordflow">return</span> std::pair<T, T>(0, 0);</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> T retmsk = msk & mask_[wordnum];</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> T retpat = retmsk & patterns_[0][wordnum];</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i=1; i<patterns_.size() && retmsk!=0; ++i)</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> retmsk &= ~(retpat ^ patterns_[i][wordnum]); <span class="comment">// retmsk reduced to set of bits that are the same</span></div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="keywordflow">return</span> std::pair<T, T>(retpat & retmsk, retmsk);</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> }</div>
</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> </div>
<div class="foldopen" id="foldopen00142" data-start="{" data-end="}">
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#a71b44f54dfb61e1f8879a4299dc860bf"> 142</a></span> <span class="keywordtype">size_t</span> <a class="code hl_function" href="classRose_1_1BitPattern.html#a71b44f54dfb61e1f8879a4299dc860bf">nalternatives</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> <span class="keywordflow">return</span> patterns_.size();</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> }</div>
</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> </div>
<div class="foldopen" id="foldopen00149" data-start="{" data-end="}">
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#a65c43b902d0461b3ac984a71ad76509d"> 149</a></span> T <a class="code hl_function" href="classRose_1_1BitPattern.html#a65c43b902d0461b3ac984a71ad76509d">conflict</a>(T msk, T pat, <span class="keywordtype">size_t</span> wordnum, <span class="keywordtype">size_t</span> altnum)<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> <span class="keywordflow">if</span> (wordnum < mask_.size()) {</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> <span class="keywordflow">if</span> (T overlap = mask_[wordnum] & msk) {</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> assert(altnum < patterns_.size());</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> <span class="keywordflow">if</span> (T differ = (patterns_[altnum][wordnum] & overlap) ^ (pat & overlap))</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <span class="keywordflow">return</span> differ;</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> }</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> }</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> }</div>
</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> </div>
<div class="foldopen" id="foldopen00163" data-start="{" data-end="}">
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#aedbafd5f8ed33680a25910884deff605"> 163</a></span> T <a class="code hl_function" href="classRose_1_1BitPattern.html#aedbafd5f8ed33680a25910884deff605">conflict</a>(T msk, T pat, <span class="keywordtype">size_t</span> wordnum)<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> <span class="keywordflow">if</span> (wordnum < mask_.size()) {</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> altnum=0; altnum<<a class="code hl_function" href="classRose_1_1BitPattern.html#a71b44f54dfb61e1f8879a4299dc860bf">nalternatives</a>(); ++altnum) {</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> <span class="keywordflow">if</span> (T differ = <a class="code hl_function" href="classRose_1_1BitPattern.html#a65c43b902d0461b3ac984a71ad76509d">conflict</a>(msk, pat, wordnum, altnum))</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> <span class="keywordflow">return</span> differ;</div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> }</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> }</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> }</div>
</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> </div>
<div class="foldopen" id="foldopen00175" data-start="{" data-end="}">
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#a3081639ed848f37c7007daa2f691de5c"> 175</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classRose_1_1BitPattern.html#a3081639ed848f37c7007daa2f691de5c">check_insertion</a>(T msk, T pat, <span class="keywordtype">size_t</span> wordnum)<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> <span class="keywordflow">if</span> (0!=msk && wordnum<mask_.size()) {</div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> <span class="keywordflow">if</span> (T differ = <a class="code hl_function" href="classRose_1_1BitPattern.html#a65c43b902d0461b3ac984a71ad76509d">conflict</a>(msk, pat, wordnum)) {</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> std::cerr <<<span class="stringliteral">"BitPattern::insert(msk="</span> <<<a class="code hl_function" href="namespaceRose_1_1StringUtility.html#a1601608fa2856aa31397370b8b5923c4">Rose::StringUtility::addrToString</a>(msk, 8*<span class="keyword">sizeof</span>(T))</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> <<<span class="stringliteral">", pat="</span> <<<a class="code hl_function" href="namespaceRose_1_1StringUtility.html#a1601608fa2856aa31397370b8b5923c4">Rose::StringUtility::addrToString</a>(pat, 8*<span class="keyword">sizeof</span>(T))</div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> <<<span class="stringliteral">", wordnum="</span> <<wordnum <<<span class="stringliteral">") conflicts with existing pattern "</span>;</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> <a class="code hl_function" href="classRose_1_1BitPattern.html#ab22421f330283b763572b14ea54a5478">print</a>(std::cerr);</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> std::cerr <<<span class="stringliteral">" at bits "</span> <<<a class="code hl_function" href="namespaceRose_1_1StringUtility.html#a1601608fa2856aa31397370b8b5923c4">Rose::StringUtility::addrToString</a>(differ, 8*<span class="keyword">sizeof</span>(T)) <<<span class="stringliteral">"\n"</span>;</div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> assert(!<span class="stringliteral">"new bit pattern conflicts with existing pattern"</span>);</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> abort();</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> }</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> }</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> }</div>
</div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> </div>
<div class="foldopen" id="foldopen00191" data-start="{" data-end="}">
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#a8e50a6bbe8cd9a36eb5e5e0ac548b337"> 191</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classRose_1_1BitPattern.html#a8e50a6bbe8cd9a36eb5e5e0ac548b337">any_same</a>(<span class="keyword">const</span> <a class="code hl_class" href="classRose_1_1BitPattern.html">BitPattern</a> &other, std::pair<size_t, size_t> *alternatives=NULL)<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="classRose_1_1BitPattern.html#a17da0f8c17e4af34169811f9e5b05950">nwords</a>()!=other.<a class="code hl_function" href="classRose_1_1BitPattern.html#a17da0f8c17e4af34169811f9e5b05950">nwords</a>())</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> wordnum=0; wordnum<<a class="code hl_function" href="classRose_1_1BitPattern.html#a17da0f8c17e4af34169811f9e5b05950">nwords</a>(); ++wordnum) {</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> <span class="keywordflow">if</span> (mask_[wordnum]!=other.mask_[wordnum])</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> }</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> a1=0; a1<<a class="code hl_function" href="classRose_1_1BitPattern.html#a71b44f54dfb61e1f8879a4299dc860bf">nalternatives</a>(); ++a1) {</div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> a2=0; a2<other.<a class="code hl_function" href="classRose_1_1BitPattern.html#a71b44f54dfb61e1f8879a4299dc860bf">nalternatives</a>(); ++a2) {</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> <span class="keywordtype">bool</span> are_same = <span class="keyword">true</span>;</div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> wordnum=0; are_same && wordnum<<a class="code hl_function" href="classRose_1_1BitPattern.html#a17da0f8c17e4af34169811f9e5b05950">nwords</a>(); ++wordnum)</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> are_same = patterns_[a1][wordnum] == other.patterns_[a2][wordnum];</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> <span class="keywordflow">if</span> (are_same) {</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> <span class="keywordflow">if</span> (alternatives!=NULL)</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> *alternatives = std::make_pair(a1, a2);</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> }</div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> }</div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> }</div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> }</div>
</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> </div>
<div class="foldopen" id="foldopen00215" data-start="{" data-end="}">
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#a4c9fc1051dae7a5b935a443f6c8eefe3"> 215</a></span> <a class="code hl_class" href="classRose_1_1BitPattern.html">BitPattern</a>& <a class="code hl_function" href="classRose_1_1BitPattern.html#a4c9fc1051dae7a5b935a443f6c8eefe3">insert</a>(T msk, T pat, <span class="keywordtype">size_t</span> wordnum=0) {</div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> assert(<a class="code hl_function" href="classRose_1_1BitPattern.html#a6e393885473298cf881646ad0c3f2c6a">is_consistent</a>());</div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> assert(0 == (pat & ~msk));</div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span> <a class="code hl_function" href="classRose_1_1BitPattern.html#a3081639ed848f37c7007daa2f691de5c">check_insertion</a>(msk, pat, wordnum);</div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span> <span class="keywordflow">if</span> (msk != 0) {</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span> <span class="keywordflow">if</span> (wordnum >= mask_.size())</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> mask_.resize(wordnum+1, T(0));</div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> mask_[wordnum] |= msk;</div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> <span class="keywordflow">if</span> (patterns_.empty()) {</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> patterns_.resize(1);</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> patterns_[0].resize(wordnum+1, T(0));</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span> patterns_[0][wordnum] = pat;</div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"> 228</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> altnum=0; altnum<<a class="code hl_function" href="classRose_1_1BitPattern.html#a71b44f54dfb61e1f8879a4299dc860bf">nalternatives</a>(); ++altnum) {</div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span> <span class="keywordflow">if</span> (wordnum >= patterns_[altnum].size())</div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span> patterns_[altnum].resize(wordnum+1, T(0));</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> patterns_[altnum][wordnum] |= pat;</div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> }</div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> }</div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> }</div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span> assert(<a class="code hl_function" href="classRose_1_1BitPattern.html#a6e393885473298cf881646ad0c3f2c6a">is_consistent</a>());</div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span> <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> }</div>
</div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span> </div>
<div class="foldopen" id="foldopen00242" data-start="{" data-end="}">
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#ae10696ac36de6e2de0a3822499c55f50"> 242</a></span> <a class="code hl_class" href="classRose_1_1BitPattern.html">BitPattern</a>& <a class="code hl_function" href="classRose_1_1BitPattern.html#ae10696ac36de6e2de0a3822499c55f50">bits</a>(<span class="keywordtype">size_t</span> lo_bit, <span class="keywordtype">size_t</span> hi_bit, T value, <span class="keywordtype">size_t</span> wordnum) {</div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> T msk = IntegerOps::genMask<T>(lo_bit, hi_bit);</div>
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span> value = <a class="code hl_function" href="namespaceIntegerOps.html#aeec37aecfc82bac943a3b454f8a70a76">IntegerOps::shiftLeft2</a>(value, lo_bit);</div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span> <span class="keywordflow">return</span> <a class="code hl_function" href="classRose_1_1BitPattern.html#a4c9fc1051dae7a5b935a443f6c8eefe3">insert</a>(msk, value, wordnum);</div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span> }</div>
</div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span> </div>
<div class="foldopen" id="foldopen00249" data-start="{" data-end="}">
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#a9dfc5a1a0acf5c165fa691fb5d55dab0"> 249</a></span> <a class="code hl_class" href="classRose_1_1BitPattern.html">BitPattern</a> <a class="code hl_function" href="classRose_1_1BitPattern.html#a9dfc5a1a0acf5c165fa691fb5d55dab0">shift_left</a>(<span class="keywordtype">size_t</span> nbits)<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span> assert(<a class="code hl_function" href="classRose_1_1BitPattern.html#a6e393885473298cf881646ad0c3f2c6a">is_consistent</a>());</div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span> <span class="keywordflow">if</span> (0==nbits || patterns_.empty())</div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span> <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno"> 253</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> word_size = 8*<span class="keyword">sizeof</span>(T);</div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno"> 254</span> <span class="keywordtype">size_t</span> need_nbits = <a class="code hl_function" href="classRose_1_1BitPattern.html#aee9ba7ca402affa176d167ac43ba75df">width</a>() + nbits;</div>
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno"> 255</span> <span class="keywordtype">size_t</span> need_nwords = (need_nbits + word_size - 1) / word_size;</div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span> <span class="keywordtype">size_t</span> word_delta = nbits / word_size;</div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</span> <span class="keywordtype">size_t</span> bit_delta_lt = nbits % word_size;</div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span> <span class="keywordtype">size_t</span> bit_delta_rt = word_size - bit_delta_lt;</div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span> <a class="code hl_class" href="classRose_1_1BitPattern.html">BitPattern</a> retval;</div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span> </div>
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno"> 261</span> <span class="comment">// shift the mask</span></div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"> 262</span> retval.mask_.resize(need_nwords, 0);</div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"> 263</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i=0; i<mask_.size(); ++i) {</div>
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno"> 264</span> retval.mask_[i+word_delta] |= <a class="code hl_function" href="namespaceIntegerOps.html#aeec37aecfc82bac943a3b454f8a70a76">IntegerOps::shiftLeft2</a>(mask_[i], bit_delta_lt);</div>
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno"> 265</span> <span class="keywordflow">if</span> (i+word_delta+1<need_nwords)</div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno"> 266</span> retval.mask_[i+word_delta+1] = <a class="code hl_function" href="namespaceIntegerOps.html#af6de25fd32a0400f6bdb57f39b90b4df">IntegerOps::shiftRightLogical2</a>(mask_[i], bit_delta_rt);</div>
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno"> 267</span> }</div>
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"> 268</span> </div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span> <span class="comment">// shift each pattern</span></div>
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"> 270</span> retval.patterns_.resize(patterns_.size());</div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i=0; i<patterns_.size(); ++i) {</div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</span> retval.patterns_[i].resize(need_nwords, 0);</div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> j=0; j<patterns_[i].size(); ++j) {</div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span> retval.patterns_[i][j+word_delta] |= <a class="code hl_function" href="namespaceIntegerOps.html#aeec37aecfc82bac943a3b454f8a70a76">IntegerOps::shiftLeft2</a>(patterns_[i][j], bit_delta_lt);</div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span> <span class="keywordflow">if</span> (j+word_delta+1<need_nwords)</div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"> 276</span> retval.patterns_[i][j+word_delta+1] = <a class="code hl_function" href="namespaceIntegerOps.html#af6de25fd32a0400f6bdb57f39b90b4df">IntegerOps::shiftRightLogical2</a>(patterns_[i][j], bit_delta_rt);</div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"> 277</span> }</div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span> }</div>
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span> assert(<a class="code hl_function" href="classRose_1_1BitPattern.html#a6e393885473298cf881646ad0c3f2c6a">is_consistent</a>());</div>
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno"> 280</span> <span class="keywordflow">return</span> retval;</div>
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span> }</div>
</div>
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"> 282</span> </div>
<div class="foldopen" id="foldopen00288" data-start="{" data-end="}">
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#aad87c10856f956371c832ba56f2086e3"> 288</a></span> <a class="code hl_class" href="classRose_1_1BitPattern.html">BitPattern</a>& <a class="code hl_function" href="classRose_1_1BitPattern.html#aad87c10856f956371c832ba56f2086e3">conjunction</a>(<span class="keyword">const</span> <a class="code hl_class" href="classRose_1_1BitPattern.html">BitPattern</a> &other) {</div>
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno"> 289</span> assert(<a class="code hl_function" href="classRose_1_1BitPattern.html#a6e393885473298cf881646ad0c3f2c6a">is_consistent</a>());</div>
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span> assert(other.<a class="code hl_function" href="classRose_1_1BitPattern.html#a6e393885473298cf881646ad0c3f2c6a">is_consistent</a>());</div>
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"> 291</span> <span class="comment">// check that the operation is possible</span></div>
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno"> 292</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> altnum=0; altnum<other.<a class="code hl_function" href="classRose_1_1BitPattern.html#a71b44f54dfb61e1f8879a4299dc860bf">nalternatives</a>(); ++altnum) {</div>
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno"> 293</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> wordnum=0; wordnum<other.<a class="code hl_function" href="classRose_1_1BitPattern.html#a17da0f8c17e4af34169811f9e5b05950">nwords</a>(); ++wordnum)</div>
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno"> 294</span> <a class="code hl_function" href="classRose_1_1BitPattern.html#a3081639ed848f37c7007daa2f691de5c">check_insertion</a>(other.mask_[wordnum], other.patterns_[altnum][wordnum], wordnum);</div>
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno"> 295</span> }</div>
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"> 296</span> </div>
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno"> 297</span> <span class="comment">// merge masks</span></div>
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno"> 298</span> <span class="keywordtype">size_t</span> this_nwords = mask_.size();</div>
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"> 299</span> <span class="keywordtype">size_t</span> result_nwords = std::max(this_nwords, other.mask_.size());</div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno"> 300</span> mask_.resize(result_nwords, T(0));</div>
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno"> 301</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> wordnum=0; wordnum<other.mask_.size(); ++wordnum)</div>
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno"> 302</span> mask_[wordnum] |= other.mask_[wordnum];</div>
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno"> 303</span> </div>
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno"> 304</span> <span class="comment">// do the conjunction</span></div>
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno"> 305</span> Alternatives retval;</div>
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno"> 306</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> a1=0; a1<patterns_.size(); ++a1) {</div>
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno"> 307</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> a2=0; a2<other.patterns_.size(); ++a2) {</div>
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno"> 308</span> retval.push_back(Words(result_nwords, T(0)));</div>
<div class="line"><a id="l00309" name="l00309"></a><span class="lineno"> 309</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i=0; i<this_nwords; ++i)</div>
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno"> 310</span> retval.back()[i] = patterns_[a1][i];</div>
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno"> 311</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i=0; i<other.<a class="code hl_function" href="classRose_1_1BitPattern.html#a17da0f8c17e4af34169811f9e5b05950">nwords</a>(); ++i)</div>
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno"> 312</span> retval.back()[i] |= other.patterns_[a2][i];</div>
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno"> 313</span> </div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno"> 314</span> <span class="comment">// check for and remove duplicate pattern</span></div>
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno"> 315</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> a3=0; a3+1<retval.size(); ++a3) {</div>
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno"> 316</span> <span class="keywordtype">bool</span> isdup = <span class="keyword">true</span>;</div>
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno"> 317</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i=0; isdup && i<result_nwords; ++i)</div>
<div class="line"><a id="l00318" name="l00318"></a><span class="lineno"> 318</span> isdup = retval[a3][i] == retval.back()[i];</div>
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno"> 319</span> <span class="keywordflow">if</span> (isdup) {</div>
<div class="line"><a id="l00320" name="l00320"></a><span class="lineno"> 320</span> retval.pop_back();</div>
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno"> 321</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno"> 322</span> }</div>
<div class="line"><a id="l00323" name="l00323"></a><span class="lineno"> 323</span> }</div>
<div class="line"><a id="l00324" name="l00324"></a><span class="lineno"> 324</span> }</div>
<div class="line"><a id="l00325" name="l00325"></a><span class="lineno"> 325</span> }</div>
<div class="line"><a id="l00326" name="l00326"></a><span class="lineno"> 326</span> patterns_ = retval;</div>
<div class="line"><a id="l00327" name="l00327"></a><span class="lineno"> 327</span> assert(<a class="code hl_function" href="classRose_1_1BitPattern.html#a6e393885473298cf881646ad0c3f2c6a">is_consistent</a>());</div>
<div class="line"><a id="l00328" name="l00328"></a><span class="lineno"> 328</span> <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a id="l00329" name="l00329"></a><span class="lineno"> 329</span> }</div>
</div>
<div class="line"><a id="l00330" name="l00330"></a><span class="lineno"> 330</span> </div>
<div class="foldopen" id="foldopen00334" data-start="{" data-end="}">
<div class="line"><a id="l00334" name="l00334"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#a7e9ca79ad92b755302d79fd68c65934c"> 334</a></span> <a class="code hl_class" href="classRose_1_1BitPattern.html">BitPattern</a>& <a class="code hl_function" href="classRose_1_1BitPattern.html#a7e9ca79ad92b755302d79fd68c65934c">disjunction</a>(<span class="keyword">const</span> <a class="code hl_class" href="classRose_1_1BitPattern.html">BitPattern</a> &other) {</div>
<div class="line"><a id="l00335" name="l00335"></a><span class="lineno"> 335</span> assert(<a class="code hl_function" href="classRose_1_1BitPattern.html#a6e393885473298cf881646ad0c3f2c6a">is_consistent</a>());</div>
<div class="line"><a id="l00336" name="l00336"></a><span class="lineno"> 336</span> assert(other.<a class="code hl_function" href="classRose_1_1BitPattern.html#a6e393885473298cf881646ad0c3f2c6a">is_consistent</a>());</div>
<div class="line"><a id="l00337" name="l00337"></a><span class="lineno"> 337</span> <span class="keywordflow">if</span> (0==<a class="code hl_function" href="classRose_1_1BitPattern.html#a71b44f54dfb61e1f8879a4299dc860bf">nalternatives</a>()) {</div>
<div class="line"><a id="l00338" name="l00338"></a><span class="lineno"> 338</span> *<span class="keyword">this</span> = other;</div>
<div class="line"><a id="l00339" name="l00339"></a><span class="lineno"> 339</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (0==other.<a class="code hl_function" href="classRose_1_1BitPattern.html#a71b44f54dfb61e1f8879a4299dc860bf">nalternatives</a>()) {</div>
<div class="line"><a id="l00340" name="l00340"></a><span class="lineno"> 340</span> <span class="comment">// void</span></div>
<div class="line"><a id="l00341" name="l00341"></a><span class="lineno"> 341</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00342" name="l00342"></a><span class="lineno"> 342</span> assert(<a class="code hl_function" href="classRose_1_1BitPattern.html#a17da0f8c17e4af34169811f9e5b05950">nwords</a>()==other.<a class="code hl_function" href="classRose_1_1BitPattern.html#a17da0f8c17e4af34169811f9e5b05950">nwords</a>());</div>
<div class="line"><a id="l00343" name="l00343"></a><span class="lineno"> 343</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> wordnum=0; wordnum<<a class="code hl_function" href="classRose_1_1BitPattern.html#a17da0f8c17e4af34169811f9e5b05950">nwords</a>(); ++wordnum)</div>
<div class="line"><a id="l00344" name="l00344"></a><span class="lineno"> 344</span> assert(mask_[wordnum]==other.mask_[wordnum]);</div>
<div class="line"><a id="l00345" name="l00345"></a><span class="lineno"> 345</span> <span class="keywordtype">size_t</span> na = <a class="code hl_function" href="classRose_1_1BitPattern.html#a71b44f54dfb61e1f8879a4299dc860bf">nalternatives</a>();</div>
<div class="line"><a id="l00346" name="l00346"></a><span class="lineno"> 346</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> a1=0; a1<other.<a class="code hl_function" href="classRose_1_1BitPattern.html#a71b44f54dfb61e1f8879a4299dc860bf">nalternatives</a>(); ++a1) {</div>
<div class="line"><a id="l00347" name="l00347"></a><span class="lineno"> 347</span> <span class="keywordtype">bool</span> isdup = <span class="keyword">false</span>;</div>
<div class="line"><a id="l00348" name="l00348"></a><span class="lineno"> 348</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> a2=0; !isdup && a2<na; ++a2) {</div>
<div class="line"><a id="l00349" name="l00349"></a><span class="lineno"> 349</span> isdup = <span class="keyword">true</span>;</div>
<div class="line"><a id="l00350" name="l00350"></a><span class="lineno"> 350</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> wordnum=0; isdup && wordnum<<a class="code hl_function" href="classRose_1_1BitPattern.html#a17da0f8c17e4af34169811f9e5b05950">nwords</a>(); ++wordnum)</div>
<div class="line"><a id="l00351" name="l00351"></a><span class="lineno"> 351</span> isdup = patterns_[a2][wordnum] == other.patterns_[a1][wordnum];</div>
<div class="line"><a id="l00352" name="l00352"></a><span class="lineno"> 352</span> }</div>
<div class="line"><a id="l00353" name="l00353"></a><span class="lineno"> 353</span> <span class="keywordflow">if</span> (!isdup)</div>
<div class="line"><a id="l00354" name="l00354"></a><span class="lineno"> 354</span> patterns_.push_back(other.patterns_[a1]);</div>
<div class="line"><a id="l00355" name="l00355"></a><span class="lineno"> 355</span> }</div>
<div class="line"><a id="l00356" name="l00356"></a><span class="lineno"> 356</span> }</div>
<div class="line"><a id="l00357" name="l00357"></a><span class="lineno"> 357</span> assert(<a class="code hl_function" href="classRose_1_1BitPattern.html#a6e393885473298cf881646ad0c3f2c6a">is_consistent</a>());</div>
<div class="line"><a id="l00358" name="l00358"></a><span class="lineno"> 358</span> <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a id="l00359" name="l00359"></a><span class="lineno"> 359</span> }</div>
</div>
<div class="line"><a id="l00360" name="l00360"></a><span class="lineno"> 360</span> </div>
<div class="foldopen" id="foldopen00364" data-start="{" data-end="}">
<div class="line"><a id="l00364" name="l00364"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#a9ead4b52eb3d0a2e4d8c18e669f6934a"> 364</a></span> <a class="code hl_class" href="classRose_1_1BitPattern.html">BitPattern</a> <a class="code hl_function" href="classRose_1_1BitPattern.html#a9ead4b52eb3d0a2e4d8c18e669f6934a">operator&</a>(<span class="keyword">const</span> <a class="code hl_class" href="classRose_1_1BitPattern.html">BitPattern</a> &other)<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00365" name="l00365"></a><span class="lineno"> 365</span> <a class="code hl_class" href="classRose_1_1BitPattern.html">BitPattern</a> retval = *<span class="keyword">this</span>;</div>
<div class="line"><a id="l00366" name="l00366"></a><span class="lineno"> 366</span> <span class="keywordflow">return</span> retval.<a class="code hl_function" href="classRose_1_1BitPattern.html#aad87c10856f956371c832ba56f2086e3">conjunction</a>(other);</div>
<div class="line"><a id="l00367" name="l00367"></a><span class="lineno"> 367</span> }</div>
</div>
<div class="foldopen" id="foldopen00368" data-start="{" data-end="}">
<div class="line"><a id="l00368" name="l00368"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#a28063fb98d920c6d2854246a592d1dfe"> 368</a></span> <a class="code hl_class" href="classRose_1_1BitPattern.html">BitPattern</a>& <a class="code hl_function" href="classRose_1_1BitPattern.html#a28063fb98d920c6d2854246a592d1dfe">operator&=</a>(<span class="keyword">const</span> <a class="code hl_class" href="classRose_1_1BitPattern.html">BitPattern</a> &other) {</div>
<div class="line"><a id="l00369" name="l00369"></a><span class="lineno"> 369</span> <span class="keywordflow">return</span> <a class="code hl_function" href="classRose_1_1BitPattern.html#aad87c10856f956371c832ba56f2086e3">conjunction</a>(other);</div>
<div class="line"><a id="l00370" name="l00370"></a><span class="lineno"> 370</span> }</div>
</div>
<div class="foldopen" id="foldopen00376" data-start="{" data-end="}">
<div class="line"><a id="l00376" name="l00376"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#a844dae3aef16dd8534e1f64f23000836"> 376</a></span> <a class="code hl_class" href="classRose_1_1BitPattern.html">BitPattern</a> <a class="code hl_function" href="classRose_1_1BitPattern.html#a844dae3aef16dd8534e1f64f23000836">operator|</a>(<span class="keyword">const</span> <a class="code hl_class" href="classRose_1_1BitPattern.html">BitPattern</a> &other)<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00377" name="l00377"></a><span class="lineno"> 377</span> <a class="code hl_class" href="classRose_1_1BitPattern.html">BitPattern</a> retval = *<span class="keyword">this</span>;</div>
<div class="line"><a id="l00378" name="l00378"></a><span class="lineno"> 378</span> <span class="keywordflow">return</span> retval.<a class="code hl_function" href="classRose_1_1BitPattern.html#a7e9ca79ad92b755302d79fd68c65934c">disjunction</a>(other);</div>
<div class="line"><a id="l00379" name="l00379"></a><span class="lineno"> 379</span> }</div>
</div>
<div class="foldopen" id="foldopen00380" data-start="{" data-end="}">
<div class="line"><a id="l00380" name="l00380"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#aba07e5808c53a33e8cbd08630cf7765f"> 380</a></span> <a class="code hl_class" href="classRose_1_1BitPattern.html">BitPattern</a>& <a class="code hl_function" href="classRose_1_1BitPattern.html#aba07e5808c53a33e8cbd08630cf7765f">operator|=</a>(<span class="keyword">const</span> <a class="code hl_class" href="classRose_1_1BitPattern.html">BitPattern</a> &other) {</div>
<div class="line"><a id="l00381" name="l00381"></a><span class="lineno"> 381</span> <span class="keywordflow">return</span> <a class="code hl_function" href="classRose_1_1BitPattern.html#a7e9ca79ad92b755302d79fd68c65934c">disjunction</a>(other);</div>
<div class="line"><a id="l00382" name="l00382"></a><span class="lineno"> 382</span> }</div>
</div>
<div class="foldopen" id="foldopen00387" data-start="{" data-end="}">
<div class="line"><a id="l00387" name="l00387"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#acaa4d22e751d52728ae8f5ddac30d026"> 387</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classRose_1_1BitPattern.html#acaa4d22e751d52728ae8f5ddac30d026">matches</a>(<span class="keyword">const</span> std::vector<T> value_words)<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00388" name="l00388"></a><span class="lineno"> 388</span> <span class="keywordflow">if</span> (0==<a class="code hl_function" href="classRose_1_1BitPattern.html#a71b44f54dfb61e1f8879a4299dc860bf">nalternatives</a>())</div>
<div class="line"><a id="l00389" name="l00389"></a><span class="lineno"> 389</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00390" name="l00390"></a><span class="lineno"> 390</span> <span class="keywordflow">if</span> (value_words.size() < <a class="code hl_function" href="classRose_1_1BitPattern.html#a17da0f8c17e4af34169811f9e5b05950">nwords</a>())</div>
<div class="line"><a id="l00391" name="l00391"></a><span class="lineno"> 391</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00392" name="l00392"></a><span class="lineno"> 392</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> altnum=0; altnum<<a class="code hl_function" href="classRose_1_1BitPattern.html#a71b44f54dfb61e1f8879a4299dc860bf">nalternatives</a>(); ++altnum) {</div>
<div class="line"><a id="l00393" name="l00393"></a><span class="lineno"> 393</span> <span class="keywordtype">bool</span> eq = <span class="keyword">true</span>;</div>
<div class="line"><a id="l00394" name="l00394"></a><span class="lineno"> 394</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> wordnum=0; eq && wordnum<<a class="code hl_function" href="classRose_1_1BitPattern.html#a17da0f8c17e4af34169811f9e5b05950">nwords</a>(); ++wordnum)</div>
<div class="line"><a id="l00395" name="l00395"></a><span class="lineno"> 395</span> eq = (value_words[wordnum] & mask_[wordnum]) == (patterns_[altnum][wordnum] & mask_[wordnum]);</div>
<div class="line"><a id="l00396" name="l00396"></a><span class="lineno"> 396</span> <span class="keywordflow">if</span> (eq)</div>
<div class="line"><a id="l00397" name="l00397"></a><span class="lineno"> 397</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00398" name="l00398"></a><span class="lineno"> 398</span> }</div>
<div class="line"><a id="l00399" name="l00399"></a><span class="lineno"> 399</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00400" name="l00400"></a><span class="lineno"> 400</span> }</div>
</div>
<div class="foldopen" id="foldopen00401" data-start="{" data-end="}">
<div class="line"><a id="l00401" name="l00401"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#a4e8794cdba622a1af58e3030af3f3039"> 401</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classRose_1_1BitPattern.html#a4e8794cdba622a1af58e3030af3f3039">matches</a>(<span class="keyword">const</span> T *value_words, <span class="keywordtype">size_t</span> sz)<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00402" name="l00402"></a><span class="lineno"> 402</span> std::vector<T> vv;</div>
<div class="line"><a id="l00403" name="l00403"></a><span class="lineno"> 403</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i=0; i<sz; ++i)</div>
<div class="line"><a id="l00404" name="l00404"></a><span class="lineno"> 404</span> vv.push_back(value_words[i]);</div>
<div class="line"><a id="l00405" name="l00405"></a><span class="lineno"> 405</span> <span class="keywordflow">return</span> <a class="code hl_function" href="classRose_1_1BitPattern.html#acaa4d22e751d52728ae8f5ddac30d026">matches</a>(vv);</div>
<div class="line"><a id="l00406" name="l00406"></a><span class="lineno"> 406</span> }</div>
</div>
<div class="foldopen" id="foldopen00410" data-start="{" data-end="}">
<div class="line"><a id="l00410" name="l00410"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#a24d5818bc86c722739406b05787a04b0"> 410</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classRose_1_1BitPattern.html#a24d5818bc86c722739406b05787a04b0">matches_word</a>(T value, <span class="keywordtype">size_t</span> wordnum)<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00411" name="l00411"></a><span class="lineno"> 411</span> <span class="keywordflow">if</span> (0==<a class="code hl_function" href="classRose_1_1BitPattern.html#a71b44f54dfb61e1f8879a4299dc860bf">nalternatives</a>() || wordnum>=<a class="code hl_function" href="classRose_1_1BitPattern.html#a17da0f8c17e4af34169811f9e5b05950">nwords</a>())</div>
<div class="line"><a id="l00412" name="l00412"></a><span class="lineno"> 412</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00413" name="l00413"></a><span class="lineno"> 413</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> altnum=0; altnum<<a class="code hl_function" href="classRose_1_1BitPattern.html#a71b44f54dfb61e1f8879a4299dc860bf">nalternatives</a>(); ++altnum) {</div>
<div class="line"><a id="l00414" name="l00414"></a><span class="lineno"> 414</span> <span class="keywordflow">if</span> ((value & mask_[wordnum]) == (patterns_[altnum][wordnum] & mask_[wordnum]))</div>
<div class="line"><a id="l00415" name="l00415"></a><span class="lineno"> 415</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00416" name="l00416"></a><span class="lineno"> 416</span> }</div>
<div class="line"><a id="l00417" name="l00417"></a><span class="lineno"> 417</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00418" name="l00418"></a><span class="lineno"> 418</span> }</div>
</div>
<div class="line"><a id="l00419" name="l00419"></a><span class="lineno"> 419</span> </div>
<div class="foldopen" id="foldopen00421" data-start="{" data-end="}">
<div class="line"><a id="l00421" name="l00421"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#ab22421f330283b763572b14ea54a5478"> 421</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classRose_1_1BitPattern.html#ab22421f330283b763572b14ea54a5478">print</a>(std::ostream &o, <span class="keywordtype">size_t</span> altnum, <span class="keywordtype">bool</span> with_mask=<span class="keyword">true</span>)<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00422" name="l00422"></a><span class="lineno"> 422</span> assert(altnum<<a class="code hl_function" href="classRose_1_1BitPattern.html#a71b44f54dfb61e1f8879a4299dc860bf">nalternatives</a>());</div>
<div class="line"><a id="l00423" name="l00423"></a><span class="lineno"> 423</span> o <<(1==<a class="code hl_function" href="classRose_1_1BitPattern.html#a17da0f8c17e4af34169811f9e5b05950">nwords</a>()?<span class="stringliteral">""</span>:<span class="stringliteral">"{"</span>);</div>
<div class="line"><a id="l00424" name="l00424"></a><span class="lineno"> 424</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> wordnum=0; wordnum<<a class="code hl_function" href="classRose_1_1BitPattern.html#a17da0f8c17e4af34169811f9e5b05950">nwords</a>(); ++wordnum) {</div>
<div class="line"><a id="l00425" name="l00425"></a><span class="lineno"> 425</span> o <<(0==wordnum?<span class="stringliteral">""</span>:<span class="stringliteral">","</span>) <<<a class="code hl_function" href="namespaceRose_1_1StringUtility.html#a1601608fa2856aa31397370b8b5923c4">Rose::StringUtility::addrToString</a>(patterns_[altnum][wordnum], 8*<span class="keyword">sizeof</span>(T));</div>
<div class="line"><a id="l00426" name="l00426"></a><span class="lineno"> 426</span> <span class="keywordflow">if</span> (with_mask)</div>
<div class="line"><a id="l00427" name="l00427"></a><span class="lineno"> 427</span> o <<<span class="stringliteral">"/"</span> <<<a class="code hl_function" href="namespaceRose_1_1StringUtility.html#a1601608fa2856aa31397370b8b5923c4">Rose::StringUtility::addrToString</a>(mask_[wordnum], 8*<span class="keyword">sizeof</span>(T));</div>
<div class="line"><a id="l00428" name="l00428"></a><span class="lineno"> 428</span> }</div>
<div class="line"><a id="l00429" name="l00429"></a><span class="lineno"> 429</span> o <<(1==<a class="code hl_function" href="classRose_1_1BitPattern.html#a17da0f8c17e4af34169811f9e5b05950">nwords</a>()?<span class="stringliteral">""</span>:<span class="stringliteral">"}"</span>);</div>
<div class="line"><a id="l00430" name="l00430"></a><span class="lineno"> 430</span> }</div>
</div>
<div class="line"><a id="l00431" name="l00431"></a><span class="lineno"> 431</span> </div>
<div class="foldopen" id="foldopen00433" data-start="{" data-end="}">
<div class="line"><a id="l00433" name="l00433"></a><span class="lineno"><a class="line" href="classRose_1_1BitPattern.html#a0421cc7f41007485d111a2f02442b0d4"> 433</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="classRose_1_1BitPattern.html#a0421cc7f41007485d111a2f02442b0d4">print</a>(std::ostream &o)<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00434" name="l00434"></a><span class="lineno"> 434</span> <span class="keywordflow">if</span> (0==<a class="code hl_function" href="classRose_1_1BitPattern.html#a17da0f8c17e4af34169811f9e5b05950">nwords</a>()) {</div>
<div class="line"><a id="l00435" name="l00435"></a><span class="lineno"> 435</span> o <<<span class="stringliteral">"empty"</span>;</div>
<div class="line"><a id="l00436" name="l00436"></a><span class="lineno"> 436</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00437" name="l00437"></a><span class="lineno"> 437</span> o <<(1==<a class="code hl_function" href="classRose_1_1BitPattern.html#a71b44f54dfb61e1f8879a4299dc860bf">nalternatives</a>()?<span class="stringliteral">""</span>:<span class="stringliteral">"("</span>);</div>
<div class="line"><a id="l00438" name="l00438"></a><span class="lineno"> 438</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> altnum=0; altnum<<a class="code hl_function" href="classRose_1_1BitPattern.html#a71b44f54dfb61e1f8879a4299dc860bf">nalternatives</a>(); ++altnum) {</div>
<div class="line"><a id="l00439" name="l00439"></a><span class="lineno"> 439</span> o <<(0==altnum?<span class="stringliteral">""</span>:<span class="stringliteral">" | "</span>);</div>
<div class="line"><a id="l00440" name="l00440"></a><span class="lineno"> 440</span> <a class="code hl_function" href="classRose_1_1BitPattern.html#ab22421f330283b763572b14ea54a5478">print</a>(o, altnum, <span class="keyword">false</span>);</div>
<div class="line"><a id="l00441" name="l00441"></a><span class="lineno"> 441</span> }</div>
<div class="line"><a id="l00442" name="l00442"></a><span class="lineno"> 442</span> o <<(1==<a class="code hl_function" href="classRose_1_1BitPattern.html#a71b44f54dfb61e1f8879a4299dc860bf">nalternatives</a>()?<span class="stringliteral">""</span>:<span class="stringliteral">")"</span>);</div>
<div class="line"><a id="l00443" name="l00443"></a><span class="lineno"> 443</span> o <<<span class="stringliteral">"/"</span> <<(1==<a class="code hl_function" href="classRose_1_1BitPattern.html#a17da0f8c17e4af34169811f9e5b05950">nwords</a>()?<span class="stringliteral">""</span>:<span class="stringliteral">"{"</span>);</div>
<div class="line"><a id="l00444" name="l00444"></a><span class="lineno"> 444</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> wordnum=0; wordnum<<a class="code hl_function" href="classRose_1_1BitPattern.html#a17da0f8c17e4af34169811f9e5b05950">nwords</a>(); ++wordnum)</div>
<div class="line"><a id="l00445" name="l00445"></a><span class="lineno"> 445</span> o <<(wordnum>0?<span class="stringliteral">","</span>:<span class="stringliteral">""</span>) <<<a class="code hl_function" href="namespaceRose_1_1StringUtility.html#a1601608fa2856aa31397370b8b5923c4">Rose::StringUtility::addrToString</a>(mask_[wordnum], 8*<span class="keyword">sizeof</span>(T));</div>
<div class="line"><a id="l00446" name="l00446"></a><span class="lineno"> 446</span> o <<(1==<a class="code hl_function" href="classRose_1_1BitPattern.html#a17da0f8c17e4af34169811f9e5b05950">nwords</a>()?<span class="stringliteral">""</span>:<span class="stringliteral">"}"</span>);</div>
<div class="line"><a id="l00447" name="l00447"></a><span class="lineno"> 447</span> }</div>
<div class="line"><a id="l00448" name="l00448"></a><span class="lineno"> 448</span> }</div>
</div>
<div class="line"><a id="l00449" name="l00449"></a><span class="lineno"> 449</span>};</div>
</div>
<div class="line"><a id="l00450" name="l00450"></a><span class="lineno"> 450</span> </div>
<div class="line"><a id="l00451" name="l00451"></a><span class="lineno"> 451</span>} <span class="comment">// namespace</span></div>
<div class="line"><a id="l00452" name="l00452"></a><span class="lineno"> 452</span> </div>
<div class="line"><a id="l00453" name="l00453"></a><span class="lineno"> 453</span><span class="keyword">template</span><<span class="keyword">typename</span> T></div>
<div class="line"><a id="l00454" name="l00454"></a><span class="lineno"> 454</span>std::ostream& operator<<(std::ostream &o, <span class="keyword">const</span> <a class="code hl_class" href="classRose_1_1BitPattern.html">Rose::BitPattern<T></a> &bp) </div>
<div class="line"><a id="l00455" name="l00455"></a><span class="lineno"> 455</span>{</div>
<div class="line"><a id="l00456" name="l00456"></a><span class="lineno"> 456</span> bp.<a class="code hl_function" href="classRose_1_1BitPattern.html#ab22421f330283b763572b14ea54a5478">print</a>(o);</div>
<div class="line"><a id="l00457" name="l00457"></a><span class="lineno"> 457</span> <span class="keywordflow">return</span> o;</div>
<div class="line"><a id="l00458" name="l00458"></a><span class="lineno"> 458</span>}</div>
<div class="line"><a id="l00459" name="l00459"></a><span class="lineno"> 459</span> </div>
<div class="line"><a id="l00460" name="l00460"></a><span class="lineno"> 460</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00461" name="l00461"></a><span class="lineno"> 461</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html"><div class="ttname"><a href="classRose_1_1BitPattern.html">Rose::BitPattern</a></div><div class="ttdoc">Describes a pattern of bits in a finite number of words.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00056">BitPattern.h:56</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_a0421cc7f41007485d111a2f02442b0d4"><div class="ttname"><a href="classRose_1_1BitPattern.html#a0421cc7f41007485d111a2f02442b0d4">Rose::BitPattern::print</a></div><div class="ttdeci">void print(std::ostream &o) const</div><div class="ttdoc">Print all alternatives of the pattern.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00433">BitPattern.h:433</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_a0d2801d2ee413bf4b3c9b4d644056ea2"><div class="ttname"><a href="classRose_1_1BitPattern.html#a0d2801d2ee413bf4b3c9b4d644056ea2">Rose::BitPattern::BitPattern</a></div><div class="ttdeci">BitPattern(T msk, T pat, size_t wordnum)</div><div class="ttdoc">Creates a new bit pattern for a single word using a mask and value.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00068">BitPattern.h:68</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_a17da0f8c17e4af34169811f9e5b05950"><div class="ttname"><a href="classRose_1_1BitPattern.html#a17da0f8c17e4af34169811f9e5b05950">Rose::BitPattern::nwords</a></div><div class="ttdeci">size_t nwords() const</div><div class="ttdoc">Returns the number of words in the pattern.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00106">BitPattern.h:106</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_a24d5818bc86c722739406b05787a04b0"><div class="ttname"><a href="classRose_1_1BitPattern.html#a24d5818bc86c722739406b05787a04b0">Rose::BitPattern::matches_word</a></div><div class="ttdeci">bool matches_word(T value, size_t wordnum) const</div><div class="ttdoc">Returns true if one word of this pattern matches the specified value.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00410">BitPattern.h:410</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_a28063fb98d920c6d2854246a592d1dfe"><div class="ttname"><a href="classRose_1_1BitPattern.html#a28063fb98d920c6d2854246a592d1dfe">Rose::BitPattern::operator&=</a></div><div class="ttdeci">BitPattern & operator&=(const BitPattern &other)</div><div class="ttdoc">Creates a new BitPattern that is the conjunction of two bit patterns.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00368">BitPattern.h:368</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_a3081639ed848f37c7007daa2f691de5c"><div class="ttname"><a href="classRose_1_1BitPattern.html#a3081639ed848f37c7007daa2f691de5c">Rose::BitPattern::check_insertion</a></div><div class="ttdeci">void check_insertion(T msk, T pat, size_t wordnum) const</div><div class="ttdoc">Check that a pattern insertion does not conflict with an existing pattern.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00175">BitPattern.h:175</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_a35aa70d03eafb149bf1e30760f37dc54"><div class="ttname"><a href="classRose_1_1BitPattern.html#a35aa70d03eafb149bf1e30760f37dc54">Rose::BitPattern::BitPattern</a></div><div class="ttdeci">BitPattern(size_t lo_bit, size_t hi_bit, T pat, size_t wordnum)</div><div class="ttdoc">Create a new bit pattern for a single word using bit offsets.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00075">BitPattern.h:75</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_a380aad58c2f125027549680ca3430fda"><div class="ttname"><a href="classRose_1_1BitPattern.html#a380aad58c2f125027549680ca3430fda">Rose::BitPattern::BitPattern</a></div><div class="ttdeci">BitPattern()</div><div class="ttdoc">Creates a new, empty bit pattern.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00064">BitPattern.h:64</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_a3902da5f4b6840db07d61d2bb322239f"><div class="ttname"><a href="classRose_1_1BitPattern.html#a3902da5f4b6840db07d61d2bb322239f">Rose::BitPattern::nsignificant</a></div><div class="ttdeci">size_t nsignificant() const</div><div class="ttdoc">Returns the number of significant bits.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00097">BitPattern.h:97</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_a4c9fc1051dae7a5b935a443f6c8eefe3"><div class="ttname"><a href="classRose_1_1BitPattern.html#a4c9fc1051dae7a5b935a443f6c8eefe3">Rose::BitPattern::insert</a></div><div class="ttdeci">BitPattern & insert(T msk, T pat, size_t wordnum=0)</div><div class="ttdoc">Creates a new pattern by adding significant bits to all alternatives of a pattern.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00215">BitPattern.h:215</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_a4e8794cdba622a1af58e3030af3f3039"><div class="ttname"><a href="classRose_1_1BitPattern.html#a4e8794cdba622a1af58e3030af3f3039">Rose::BitPattern::matches</a></div><div class="ttdeci">bool matches(const T *value_words, size_t sz) const</div><div class="ttdoc">Returns true if this pattern matches the specified values.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00401">BitPattern.h:401</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_a65c43b902d0461b3ac984a71ad76509d"><div class="ttname"><a href="classRose_1_1BitPattern.html#a65c43b902d0461b3ac984a71ad76509d">Rose::BitPattern::conflict</a></div><div class="ttdeci">T conflict(T msk, T pat, size_t wordnum, size_t altnum) const</div><div class="ttdoc">Determines if the specified bits conflict with a particular pattern alternative.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00149">BitPattern.h:149</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_a6e393885473298cf881646ad0c3f2c6a"><div class="ttname"><a href="classRose_1_1BitPattern.html#a6e393885473298cf881646ad0c3f2c6a">Rose::BitPattern::is_consistent</a></div><div class="ttdeci">bool is_consistent() const</div><div class="ttdoc">Verify internal consistency.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00080">BitPattern.h:80</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_a71b44f54dfb61e1f8879a4299dc860bf"><div class="ttname"><a href="classRose_1_1BitPattern.html#a71b44f54dfb61e1f8879a4299dc860bf">Rose::BitPattern::nalternatives</a></div><div class="ttdeci">size_t nalternatives() const</div><div class="ttdoc">Returns the number of alternatives.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00142">BitPattern.h:142</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_a7e9ca79ad92b755302d79fd68c65934c"><div class="ttname"><a href="classRose_1_1BitPattern.html#a7e9ca79ad92b755302d79fd68c65934c">Rose::BitPattern::disjunction</a></div><div class="ttdeci">BitPattern & disjunction(const BitPattern &other)</div><div class="ttdoc">Combines this BitPattern with another by forming their disjunction.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00334">BitPattern.h:334</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_a844dae3aef16dd8534e1f64f23000836"><div class="ttname"><a href="classRose_1_1BitPattern.html#a844dae3aef16dd8534e1f64f23000836">Rose::BitPattern::operator|</a></div><div class="ttdeci">BitPattern operator|(const BitPattern &other) const</div><div class="ttdoc">Creates a new BitPattern that is the inclusive disjunction of two bit patterns.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00376">BitPattern.h:376</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_a8e50a6bbe8cd9a36eb5e5e0ac548b337"><div class="ttname"><a href="classRose_1_1BitPattern.html#a8e50a6bbe8cd9a36eb5e5e0ac548b337">Rose::BitPattern::any_same</a></div><div class="ttdeci">bool any_same(const BitPattern &other, std::pair< size_t, size_t > *alternatives=NULL) const</div><div class="ttdoc">Determines whether two patterns can match the same input.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00191">BitPattern.h:191</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_a9dfc5a1a0acf5c165fa691fb5d55dab0"><div class="ttname"><a href="classRose_1_1BitPattern.html#a9dfc5a1a0acf5c165fa691fb5d55dab0">Rose::BitPattern::shift_left</a></div><div class="ttdeci">BitPattern shift_left(size_t nbits) const</div><div class="ttdoc">Return a new BitPattern with the pattern bits shifted left by the indicated amount.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00249">BitPattern.h:249</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_a9ead4b52eb3d0a2e4d8c18e669f6934a"><div class="ttname"><a href="classRose_1_1BitPattern.html#a9ead4b52eb3d0a2e4d8c18e669f6934a">Rose::BitPattern::operator&</a></div><div class="ttdeci">BitPattern operator&(const BitPattern &other) const</div><div class="ttdoc">Creates a new BitPattern that is the conjunction of two bit patterns.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00364">BitPattern.h:364</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_aad87c10856f956371c832ba56f2086e3"><div class="ttname"><a href="classRose_1_1BitPattern.html#aad87c10856f956371c832ba56f2086e3">Rose::BitPattern::conjunction</a></div><div class="ttdeci">BitPattern & conjunction(const BitPattern &other)</div><div class="ttdoc">Combines this BitPattern with another by forming their conjunction.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00288">BitPattern.h:288</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_ab22421f330283b763572b14ea54a5478"><div class="ttname"><a href="classRose_1_1BitPattern.html#ab22421f330283b763572b14ea54a5478">Rose::BitPattern::print</a></div><div class="ttdeci">void print(std::ostream &o, size_t altnum, bool with_mask=true) const</div><div class="ttdoc">Print one pattern alternative.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00421">BitPattern.h:421</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_aba07e5808c53a33e8cbd08630cf7765f"><div class="ttname"><a href="classRose_1_1BitPattern.html#aba07e5808c53a33e8cbd08630cf7765f">Rose::BitPattern::operator|=</a></div><div class="ttdeci">BitPattern & operator|=(const BitPattern &other)</div><div class="ttdoc">Creates a new BitPattern that is the inclusive disjunction of two bit patterns.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00380">BitPattern.h:380</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_ac19ad2d81b6503b0ff0bfc230d6dad34"><div class="ttname"><a href="classRose_1_1BitPattern.html#ac19ad2d81b6503b0ff0bfc230d6dad34">Rose::BitPattern::invariants</a></div><div class="ttdeci">std::pair< T, T > invariants(T msk, size_t wordnum)</div><div class="ttdoc">Returns invariant bits.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00131">BitPattern.h:131</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_acaa4d22e751d52728ae8f5ddac30d026"><div class="ttname"><a href="classRose_1_1BitPattern.html#acaa4d22e751d52728ae8f5ddac30d026">Rose::BitPattern::matches</a></div><div class="ttdeci">bool matches(const std::vector< T > value_words) const</div><div class="ttdoc">Returns true if this pattern matches the specified values.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00387">BitPattern.h:387</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_ae10696ac36de6e2de0a3822499c55f50"><div class="ttname"><a href="classRose_1_1BitPattern.html#ae10696ac36de6e2de0a3822499c55f50">Rose::BitPattern::bits</a></div><div class="ttdeci">BitPattern & bits(size_t lo_bit, size_t hi_bit, T value, size_t wordnum)</div><div class="ttdoc">Adds significant bits to all alternatives of a pattern.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00242">BitPattern.h:242</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_ae206f4c7fab9e8436aecbc1d44d8300f"><div class="ttname"><a href="classRose_1_1BitPattern.html#ae206f4c7fab9e8436aecbc1d44d8300f">Rose::BitPattern::mask</a></div><div class="ttdeci">T mask(size_t wordnum)</div><div class="ttdoc">Returns the mask for the specified word.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00120">BitPattern.h:120</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_aedbafd5f8ed33680a25910884deff605"><div class="ttname"><a href="classRose_1_1BitPattern.html#aedbafd5f8ed33680a25910884deff605">Rose::BitPattern::conflict</a></div><div class="ttdeci">T conflict(T msk, T pat, size_t wordnum) const</div><div class="ttdoc">Determines if the specified significant bits conflict with any of the existing pattern alternatives.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00163">BitPattern.h:163</a></div></div>
<div class="ttc" id="aclassRose_1_1BitPattern_html_aee9ba7ca402affa176d167ac43ba75df"><div class="ttname"><a href="classRose_1_1BitPattern.html#aee9ba7ca402affa176d167ac43ba75df">Rose::BitPattern::width</a></div><div class="ttdeci">size_t width() const</div><div class="ttdoc">Returns the size of the pattern in bits.</div><div class="ttdef"><b>Definition</b> <a href="BitPattern_8h_source.html#l00112">BitPattern.h:112</a></div></div>
<div class="ttc" id="anamespaceIntegerOps_html_a5a16068e76330aa48beb66df72ecf622"><div class="ttname"><a href="namespaceIntegerOps.html#a5a16068e76330aa48beb66df72ecf622">IntegerOps::msb_set</a></div><div class="ttdeci">boost::optional< size_t > msb_set(T val)</div><div class="ttdoc">Optionally returns the zero-origin position of the most significant set bit.</div><div class="ttdef"><b>Definition</b> <a href="integerOps_8h_source.html#l00303">integerOps.h:303</a></div></div>
<div class="ttc" id="anamespaceIntegerOps_html_ad8d6e8b6826be3ee7a86824f82b7b853"><div class="ttname"><a href="namespaceIntegerOps.html#ad8d6e8b6826be3ee7a86824f82b7b853">IntegerOps::countSet</a></div><div class="ttdeci">size_t countSet(T val)</div><div class="ttdoc">Counts how many bits are set (one).</div><div class="ttdef"><b>Definition</b> <a href="integerOps_8h_source.html#l00279">integerOps.h:279</a></div></div>
<div class="ttc" id="anamespaceIntegerOps_html_aeec37aecfc82bac943a3b454f8a70a76"><div class="ttname"><a href="namespaceIntegerOps.html#aeec37aecfc82bac943a3b454f8a70a76">IntegerOps::shiftLeft2</a></div><div class="ttdeci">T shiftLeft2(T value, size_t count, size_t width=8 *sizeof(T))</div><div class="ttdoc">Shifts bits of value left by count bits.</div><div class="ttdef"><b>Definition</b> <a href="integerOps_8h_source.html#l00108">integerOps.h:108</a></div></div>
<div class="ttc" id="anamespaceIntegerOps_html_af6de25fd32a0400f6bdb57f39b90b4df"><div class="ttname"><a href="namespaceIntegerOps.html#af6de25fd32a0400f6bdb57f39b90b4df">IntegerOps::shiftRightLogical2</a></div><div class="ttdeci">T shiftRightLogical2(T value, size_t count, size_t width=8 *sizeof(T))</div><div class="ttdoc">Shifts bits of value right by count bits without sign extension.</div><div class="ttdef"><b>Definition</b> <a href="integerOps_8h_source.html#l00122">integerOps.h:122</a></div></div>
<div class="ttc" id="anamespaceRose_1_1StringUtility_html_a1601608fa2856aa31397370b8b5923c4"><div class="ttname"><a href="namespaceRose_1_1StringUtility.html#a1601608fa2856aa31397370b8b5923c4">Rose::StringUtility::addrToString</a></div><div class="ttdeci">ROSE_UTIL_API std::string addrToString(uint64_t value, size_t nbits=0)</div><div class="ttdoc">Convert a virtual address to a string.</div></div>
<div class="ttc" id="anamespaceRose_html"><div class="ttname"><a href="namespaceRose.html">Rose</a></div><div class="ttdoc">The ROSE library.</div><div class="ttdef"><b>Definition</b> <a href="BinaryTutorial_8dox_source.html#l00003">BinaryTutorial.dox:3</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Oct 2 2024 00:07:47 for ROSE by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>