Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: native_client_sdk/src/doc/reference/pnacl-undefined-behavior.rst

Issue 250433002: PNaCl documentation: add SIMD vectors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address dschuff's comments. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 ======================== 1 ========================
2 PNaCl Undefined Behavior 2 PNaCl Undefined Behavior
3 ======================== 3 ========================
4 4
5 .. contents:: 5 .. contents::
6 :local: 6 :local:
7 :backlinks: none 7 :backlinks: none
8 :depth: 3 8 :depth: 3
9 9
10 .. _undefined_behavior: 10 .. _undefined_behavior:
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 could mandate flush-to-zero, and may give an API to enable denormals 170 could mandate flush-to-zero, and may give an API to enable denormals
171 in a future release. The latter is problematic for SIMD and 171 in a future release. The latter is problematic for SIMD and
172 vectorization support, where some platforms do not support denormal 172 vectorization support, where some platforms do not support denormal
173 SIMD operations. 173 SIMD operations.
174 * ``NaN`` values are currently not guaranteed to be canonical; see `bug 174 * ``NaN`` values are currently not guaranteed to be canonical; see `bug
175 3536 <https://code.google.com/p/nativeclient/issues/detail?id=3536>`_. 175 3536 <https://code.google.com/p/nativeclient/issues/detail?id=3536>`_.
176 * Passing ``NaN`` to STL functions (the math is defined, but the 176 * Passing ``NaN`` to STL functions (the math is defined, but the
177 function implementation isn't, e.g. ``std::min`` and ``std::max``), is 177 function implementation isn't, e.g. ``std::min`` and ``std::max``), is
178 well-defined in the *pexe*. 178 well-defined in the *pexe*.
179 179
180 SIMD Vectors
181 ^^^^^^^^^^^^
182
183 SIMD vector instructions aren't part of the C/C++ standards and as such
184 their behavior isn't specified at all in C/C++; it is usually left up to
185 the target architecture to specify behavior. Portable Native Client
186 instead exposed :ref:`Portable SIMD Vectors <portable_simd_vectors>` and
187 offers the same guarantees on these vectors as the guarantees offered by
188 the contained elements. Of notable interest amongst these guarantees are
189 those of alignment for load/store instructions on vectors: they have the
190 same alignment restriction as the contained elements.
191
180 Hard to Fix 192 Hard to Fix
181 ^^^^^^^^^^^ 193 ^^^^^^^^^^^
182 194
183 * Null pointer/reference has behavior determined by the NaCl sandbox: 195 * Null pointer/reference has behavior determined by the NaCl sandbox:
184 196
185 * Raises a segmentation fault in the bottom ``64KiB`` bytes on all 197 * Raises a segmentation fault in the bottom ``64KiB`` bytes on all
186 platforms, and on some sandboxes there are further non-writable 198 platforms, and on some sandboxes there are further non-writable
187 pages after the initial ``64KiB``. 199 pages after the initial ``64KiB``.
188 * Negative offsets aren't handled consistently on all platforms: 200 * Negative offsets aren't handled consistently on all platforms:
189 x86-64 and ARM will wrap around to the stack (because they mask the 201 x86-64 and ARM will wrap around to the stack (because they mask the
(...skipping 22 matching lines...) Expand all
212 * PNaCl could offer "portable" JIT capabilities where the code hands 224 * PNaCl could offer "portable" JIT capabilities where the code hands
213 PNaCl some form of LLVM IR, which PNaCl then JIT-compiles. 225 PNaCl some form of LLVM IR, which PNaCl then JIT-compiles.
214 226
215 * Out-of-scope variable usage: will produce unknown data, mostly 227 * Out-of-scope variable usage: will produce unknown data, mostly
216 dependent on stack and memory allocation. 228 dependent on stack and memory allocation.
217 * Data races: any two operations that conflict (target overlapping 229 * Data races: any two operations that conflict (target overlapping
218 memory), at least one of which is a store or atomic read-modify-write, 230 memory), at least one of which is a store or atomic read-modify-write,
219 and at least one of which is not atomic: this will be very dependent 231 and at least one of which is not atomic: this will be very dependent
220 on processor and execution sequence, see :ref:`Memory Model and 232 on processor and execution sequence, see :ref:`Memory Model and
221 Atomics <memory_model_and_atomics>`. 233 Atomics <memory_model_and_atomics>`.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698