-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGraphSnippets.html
263 lines (263 loc) · 11 KB
/
GraphSnippets.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
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Firm - <span class="algo">Firm</span> By Example</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
<link rel="stylesheet" type="text/css" href="pygments.css"/>
<link rel="icon" type="image/png" href="logo-simple.png"/>
</head>
<body>
<div class="layout-header">
<a href="index.html"><img src="logo.png" alt="Firm Logo" /></a>
</div>
<div class="layout-content-wrapper">
<div class="layout-content">
<div class="layout-sidebar">
<ul>
<li><a href="index.html">About</a></li>
<li><a href="Features.html">Features</a></li>
<li><a href="Download.html">Download</a></li>
<li><a href="Documentation.html">Documentation</a></li>
<li><a href="Projects.html">Projects</a></li>
<li><a href="Development.html">Development</a></li>
<li><a href="Contact.html">Contact</a></li>
</ul>
<ul class="external">
<li><a href="http://pp.info.uni-karlsruhe.de/projects/firm_publications.php">Publications</a></li>
</ul>
</div>
<div class="layout-document">
<h1><span class="algo">Firm</span> By Example</h1>
<div id="preamble">
<div class="sectionbody">
<div class="paragraph"><p><strong>Attention:</strong> The following graph snippets are for the latest revision in
the git repository. The last stable release may require slightly different
graphs.</p></div>
</div>
</div>
<div class="sect1">
<h2 id="_basic_operations">Basic Operations</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_simple_arithmetic_with_constants">Simple Arithmetic with Constants</h3>
<div class="listingblock">
<div class="content"><div class="highlight"><pre><span></span><span class="mi">5</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="mi">3</span>
</pre></div></div></div>
<div class="imageblock">
<div class="content">
<img src="simpleadd.svg" alt="simpleadd.svg" />
</div>
</div>
<div class="olist arabic"><ol class="arabic">
<li>
<p>
Modes
</p>
<div class="ulist"><ul>
<li>
<p>
<code>Is</code> 32 bit integer signed
</p>
</li>
<li>
<p>
<code>Iu</code> 32 bit integer unsigned
</p>
</li>
<li>
<p>
<code>Ls</code>/<code>Lu</code> 64 bit integer signed/unsigned
</p>
</li>
<li>
<p>
<code>Hs</code>/<code>Hu</code> 16 bit integer signed/unsigned
</p>
</li>
<li>
<p>
<code>Bs</code>/<code>Bu</code> 8 bit integer signed/unsigned
</p>
</li>
<li>
<p>
<code>F</code> ieee754 binary32 float "single precision"
</p>
</li>
<li>
<p>
<code>D</code> ieee754 binary64 float "double precision"
</p>
</li>
<li>
<p>
<code>b</code> boolean
</p>
</li>
<li>
<p>
<code>P</code> Pointer
</p>
</li>
<li>
<p>
<code>M</code> Memory, State
</p>
</li>
<li>
<p>
<code>X</code> Execution
</p>
</li>
<li>
<p>
<code>T</code> Tuple
</p>
</li>
</ul></div>
</li>
</ol></div>
</div>
<div class="sect2">
<h3 id="_load_arithmetic_multiple_users">Load, Arithmetic, Multiple Users</h3>
<div class="listingblock">
<div class="content"><div class="highlight"><pre><span></span><span class="n">x</span><span class="o">*</span><span class="n">x</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="mi">2</span>
</pre></div></div></div>
<div class="imageblock">
<div class="content">
<img src="load_mul.svg" alt="load_mul.svg" />
</div>
</div>
</div>
<div class="sect2">
<h3 id="_calls_sequencing_with_memory_value">Calls, Sequencing with Memory Value</h3>
<div class="listingblock">
<div class="content"><div class="highlight"><pre><span></span><span class="n">print_int</span><span class="p">(</span><span class="mi">7</span><span class="p">);</span>
<span class="n">print_int</span><span class="p">(</span><span class="mi">4</span><span class="p">);</span>
</pre></div></div></div>
<div class="imageblock">
<div class="content">
<img src="twocalls.svg" alt="twocalls.svg" />
</div>
</div>
</div>
<div class="sect2">
<h3 id="_compound_member_access">Compound Member access</h3>
<div class="listingblock">
<div class="content"><div class="highlight"><pre><span></span><span class="n">x</span><span class="p">.</span><span class="n">z</span>
</pre></div></div></div>
<div class="imageblock">
<div class="content">
<img src="member.svg" alt="member.svg" />
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_control_flow">Control Flow</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_jump">Jump</h3>
<div class="listingblock">
<div class="content"><div class="highlight"><pre><span></span><span class="k">goto</span><span class="w"> </span><span class="n">a</span><span class="p">;</span>
<span class="nl">a</span><span class="p">:</span>
</pre></div></div></div>
<div class="imageblock">
<div class="content">
<img src="jump.svg" alt="jump.svg" />
</div>
</div>
</div>
<div class="sect2">
<h3 id="_comparison_conditional_jump">Comparison / Conditional Jump</h3>
<div class="listingblock">
<div class="content"><div class="highlight"><pre><span></span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="mi">4</span><span class="p">;</span>
<span class="p">}</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="mi">7</span><span class="p">;</span>
<span class="p">}</span>
</pre></div></div></div>
<div class="imageblock">
<div class="content">
<img src="condjump.svg" alt="condjump.svg" />
</div>
</div>
</div>
<div class="sect2">
<h3 id="_conditional_jump_phi">Conditional Jump / Phi</h3>
<div class="listingblock">
<div class="content"><div class="highlight"><pre><span></span><span class="kt">int</span><span class="w"> </span><span class="n">x</span><span class="p">;</span>
<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="mi">7</span><span class="w"> </span><span class="o">></span><span class="w"> </span><span class="mi">4</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">9</span><span class="p">;</span>
<span class="p">}</span><span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">3</span><span class="p">;</span>
<span class="p">}</span>
<span class="k">return</span><span class="w"> </span><span class="n">x</span><span class="p">;</span>
</pre></div></div></div>
<div class="imageblock">
<div class="content">
<img src="phi.svg" alt="phi.svg" />
</div>
</div>
</div>
<div class="sect2">
<h3 id="_simple_loop">Simple Loop</h3>
<div class="listingblock">
<div class="content"><div class="highlight"><pre><span></span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
<span class="k">do</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span>
<span class="p">}</span><span class="w"> </span><span class="k">while</span><span class="w"> </span><span class="p">(</span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="mi">100</span><span class="p">);</span>
</pre></div></div></div>
<div class="imageblock">
<div class="content">
<img src="loop.svg" alt="loop.svg" />
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_function_begin_return">Function Begin/Return</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_start_return_end">Start + Return + End</h3>
<div class="listingblock">
<div class="content"><div class="highlight"><pre><span></span><span class="kt">void</span><span class="w"> </span><span class="nf">empty</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span>
<span class="p">{</span>
<span class="p">}</span>
</pre></div></div></div>
<div class="imageblock">
<div class="content">
<img src="start_return.svg" alt="start_return.svg" />
</div>
</div>
</div>
<div class="sect2">
<h3 id="_parameters">Parameters</h3>
<div class="listingblock">
<div class="content"><div class="highlight"><pre><span></span><span class="kt">int</span><span class="w"> </span><span class="nf">add</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">y</span><span class="p">)</span>
<span class="p">{</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">y</span><span class="p">;</span>
<span class="p">}</span>
</pre></div></div></div>
<div class="imageblock">
<div class="content">
<img src="params.svg" alt="params.svg" />
</div>
</div>
</div>
</div>
</div>
</div>
<div class="clear"></div>
</div>
</div>
<div class="layout-footer">
<span><a href="https://lists.ira.uni-karlsruhe.de/mailman/listinfo/firm">Mailing list</a>: <a href="mailto:[email protected]">[email protected]</a></span>
</div>
</body>
</html>