OLD | NEW |
1 {{+bindTo:partials.standard_nacl_article}} | 1 {{+bindTo:partials.standard_nacl_article}} |
2 | 2 |
3 <section id="pnacl-c-c-language-support"> | 3 <section id="pnacl-c-c-language-support"> |
4 <h1 id="pnacl-c-c-language-support">PNaCl C/C++ Language Support</h1> | 4 <h1 id="pnacl-c-c-language-support">PNaCl C/C++ Language Support</h1> |
5 <div class="contents local" id="contents" style="display: none"> | 5 <div class="contents local" id="contents" style="display: none"> |
6 <ul class="small-gap"> | 6 <ul class="small-gap"> |
7 <li><p class="first"><a class="reference internal" href="#source-language-suppor
t" id="id2">Source language support</a></p> | 7 <li><p class="first"><a class="reference internal" href="#source-language-suppor
t" id="id2">Source language support</a></p> |
8 <ul class="small-gap"> | 8 <ul class="small-gap"> |
9 <li><a class="reference internal" href="#preprocessor-definitions" id="id3">Prep
rocessor definitions</a></li> | 9 <li><a class="reference internal" href="#preprocessor-definitions" id="id3">Prep
rocessor definitions</a></li> |
10 </ul> | 10 </ul> |
11 </li> | 11 </li> |
12 <li><p class="first"><a class="reference internal" href="#memory-model-and-atomi
cs" id="id4">Memory Model and Atomics</a></p> | 12 <li><p class="first"><a class="reference internal" href="#memory-model-and-atomi
cs" id="id4">Memory Model and Atomics</a></p> |
13 <ul class="small-gap"> | 13 <ul class="small-gap"> |
14 <li><a class="reference internal" href="#memory-model-for-concurrent-operations"
id="id5">Memory Model for Concurrent Operations</a></li> | 14 <li><a class="reference internal" href="#memory-model-for-concurrent-operations"
id="id5">Memory Model for Concurrent Operations</a></li> |
15 <li><a class="reference internal" href="#atomic-memory-ordering-constraints" id=
"id6">Atomic Memory Ordering Constraints</a></li> | 15 <li><a class="reference internal" href="#atomic-memory-ordering-constraints" id=
"id6">Atomic Memory Ordering Constraints</a></li> |
16 <li><a class="reference internal" href="#volatile-memory-accesses" id="id7">Vola
tile Memory Accesses</a></li> | 16 <li><a class="reference internal" href="#volatile-memory-accesses" id="id7">Vola
tile Memory Accesses</a></li> |
17 </ul> | 17 </ul> |
18 </li> | 18 </li> |
19 <li><a class="reference internal" href="#threading" id="id8">Threading</a></li> | 19 <li><a class="reference internal" href="#threading" id="id8">Threading</a></li> |
20 <li><a class="reference internal" href="#setjmp-and-longjmp" id="id9"><code>setj
mp</code> and <code>longjmp</code></a></li> | 20 <li><a class="reference internal" href="#setjmp-and-longjmp" id="id9"><code>setj
mp</code> and <code>longjmp</code></a></li> |
21 <li><a class="reference internal" href="#c-exception-handling" id="id10">C++ Exc
eption Handling</a></li> | 21 <li><a class="reference internal" href="#c-exception-handling" id="id10">C++ Exc
eption Handling</a></li> |
22 <li><a class="reference internal" href="#inline-assembly" id="id11">Inline Assem
bly</a></li> | 22 <li><a class="reference internal" href="#inline-assembly" id="id11">Inline Assem
bly</a></li> |
23 <li><a class="reference internal" href="#undefined-behavior" id="id12">Undefined
Behavior</a></li> | 23 <li><a class="reference internal" href="#undefined-behavior" id="id12">Undefined
Behavior</a></li> |
24 <li><a class="reference internal" href="#floating-point" id="id13">Floating-Poin
t</a></li> | 24 <li><a class="reference internal" href="#floating-point" id="id13">Floating-Poin
t</a></li> |
25 <li><p class="first"><a class="reference internal" href="#future-directions" id=
"id14">Future Directions</a></p> | 25 <li><a class="reference internal" href="#computed-goto" id="id14">Computed <code
>goto</code></a></li> |
| 26 <li><p class="first"><a class="reference internal" href="#future-directions" id=
"id15">Future Directions</a></p> |
26 <ul class="small-gap"> | 27 <ul class="small-gap"> |
27 <li><a class="reference internal" href="#simd" id="id15">SIMD</a></li> | 28 <li><a class="reference internal" href="#simd" id="id16">SIMD</a></li> |
28 <li><a class="reference internal" href="#inter-process-communication" id="id16">
Inter-Process Communication</a></li> | 29 <li><a class="reference internal" href="#inter-process-communication" id="id17">
Inter-Process Communication</a></li> |
29 <li><a class="reference internal" href="#posix-style-signal-handling" id="id17">
POSIX-style Signal Handling</a></li> | 30 <li><a class="reference internal" href="#posix-style-signal-handling" id="id18">
POSIX-style Signal Handling</a></li> |
30 <li><a class="reference internal" href="#computed-goto" id="id18">Computed <code
>goto</code></a></li> | |
31 </ul> | 31 </ul> |
32 </li> | 32 </li> |
33 </ul> | 33 </ul> |
34 | 34 |
35 </div><section id="source-language-support"> | 35 </div><section id="source-language-support"> |
36 <h2 id="source-language-support">Source language support</h2> | 36 <h2 id="source-language-support">Source language support</h2> |
37 <p>The currently supported languages are C and C++. The PNaCl toolchain is | 37 <p>The currently supported languages are C and C++. The PNaCl toolchain is |
38 based on Clang 3.3, which fully supports C++11 and most of C11. A | 38 based on Clang 3.3, which fully supports C++11 and most of C11. A |
39 detailed status of the language support is available <a class="reference externa
l" href="http://clang.llvm.org/cxx_status.html">here</a>.</p> | 39 detailed status of the language support is available <a class="reference externa
l" href="http://clang.llvm.org/cxx_status.html">here</a>.</p> |
40 <p>For information on using languages other than C/C++, see the <a class="refere
nce internal" href="/native-client/faq.html#other-languages"><em>FAQ | 40 <p>For information on using languages other than C/C++, see the <a class="refere
nce internal" href="/native-client/faq.html#other-languages"><em>FAQ |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 emulated. PNaCl could (but currently doesn’t) only generate them in | 198 emulated. PNaCl could (but currently doesn’t) only generate them in |
199 the backend if fast-math were specified and the hardware supports | 199 the backend if fast-math were specified and the hardware supports |
200 the operation.</li> | 200 the operation.</li> |
201 <li>Transcendentals aren’t exposed by PNaCl’s ABI; they are part of
the | 201 <li>Transcendentals aren’t exposed by PNaCl’s ABI; they are part of
the |
202 math library that is included in the <em>pexe</em>. PNaCl could, but | 202 math library that is included in the <em>pexe</em>. PNaCl could, but |
203 currently doesn’t, use hardware support if fast-math were provided | 203 currently doesn’t, use hardware support if fast-math were provided |
204 in the <em>pexe</em>.</li> | 204 in the <em>pexe</em>.</li> |
205 </ul> | 205 </ul> |
206 </li> | 206 </li> |
207 </ul> | 207 </ul> |
| 208 </section><section id="computed-goto"> |
| 209 <h2 id="computed-goto">Computed <code>goto</code></h2> |
| 210 <p>PNaCl supports computed <code>goto</code>, a non-standard GCC extension to C
used |
| 211 by some interpreters, by lowering them to <code>switch</code> statements. The |
| 212 resulting use of <code>switch</code> might not be as fast as the original |
| 213 indirect branches. If you are compiling a program that has a |
| 214 compile-time option for using computed <code>goto</code>, it’s possible th
at the |
| 215 program will run faster with the option turned off (e.g., if the program |
| 216 does extra work to take advantage of computed <code>goto</code>).</p> |
| 217 <p>NaCl supports computed <code>goto</code> without any transformation.</p> |
208 </section><section id="future-directions"> | 218 </section><section id="future-directions"> |
209 <h2 id="future-directions">Future Directions</h2> | 219 <h2 id="future-directions">Future Directions</h2> |
210 <section id="simd"> | 220 <section id="simd"> |
211 <h3 id="simd">SIMD</h3> | 221 <h3 id="simd">SIMD</h3> |
212 <p>PNaCl currently doesn’t support SIMD. We plan to add SIMD support in th
e | 222 <p>PNaCl currently doesn’t support SIMD. We plan to add SIMD support in th
e |
213 very near future.</p> | 223 very near future.</p> |
214 <p>NaCl supports SIMD.</p> | 224 <p>NaCl supports SIMD.</p> |
215 </section><section id="inter-process-communication"> | 225 </section><section id="inter-process-communication"> |
216 <h3 id="inter-process-communication">Inter-Process Communication</h3> | 226 <h3 id="inter-process-communication">Inter-Process Communication</h3> |
217 <p>Inter-process communication through shared memory is currently not | 227 <p>Inter-process communication through shared memory is currently not |
(...skipping 18 matching lines...) Expand all Loading... |
236 <p>A similar feature is <strong>thread suspension</strong>: The ability to | 246 <p>A similar feature is <strong>thread suspension</strong>: The ability to |
237 asynchronously suspend and resume a thread and inspect or modify its | 247 asynchronously suspend and resume a thread and inspect or modify its |
238 execution state (such as register state).</p> | 248 execution state (such as register state).</p> |
239 <p>Neither PNaCl nor NaCl currently support asynchronous interruption | 249 <p>Neither PNaCl nor NaCl currently support asynchronous interruption |
240 or suspension of threads.</p> | 250 or suspension of threads.</p> |
241 </li> | 251 </li> |
242 </ul> | 252 </ul> |
243 <p>If PNaCl were to support either of these, the interaction of | 253 <p>If PNaCl were to support either of these, the interaction of |
244 <code>volatile</code> and atomics with same-thread signal handling would need | 254 <code>volatile</code> and atomics with same-thread signal handling would need |
245 to be carefully detailed.</p> | 255 to be carefully detailed.</p> |
246 </section><section id="computed-goto"> | |
247 <h3 id="computed-goto">Computed <code>goto</code></h3> | |
248 <p>PNaCl currently doesn’t support computed <code>goto</code>, a non-stand
ard | |
249 extension to C used by some interpreters.</p> | |
250 <p>NaCl supports computed <code>goto</code>.</p> | |
251 </section></section></section> | 256 </section></section></section> |
252 | 257 |
253 {{/partials.standard_nacl_article}} | 258 {{/partials.standard_nacl_article}} |
OLD | NEW |