OLD | NEW |
1 ============================== | 1 ============================== |
2 PNaCl Bitcode Reference Manual | 2 PNaCl Bitcode Reference Manual |
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 Introduction | 10 Introduction |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 Scalar types | 191 Scalar types |
192 ------------ | 192 ------------ |
193 | 193 |
194 * The only scalar types allowed are integer, float (32-bit floating point), | 194 * The only scalar types allowed are integer, float (32-bit floating point), |
195 double (64-bit floating point) and void. | 195 double (64-bit floating point) and void. |
196 | 196 |
197 * The only integer sizes allowed are i1, i8, i16, i32 and i64. | 197 * The only integer sizes allowed are i1, i8, i16, i32 and i64. |
198 * The only integer sizes allowed for function arguments and function return | 198 * The only integer sizes allowed for function arguments and function return |
199 values are i32 and i64. | 199 values are i32 and i64. |
200 | 200 |
| 201 Vector types |
| 202 ------------ |
| 203 |
| 204 The only vector types allowed are: |
| 205 |
| 206 * 128-bit vectors integers of elements size i8, i16, i32. |
| 207 * 128-bit vectors of float elements. |
| 208 * Vectors of i1 type with element counts corresponding to the allowed |
| 209 element counts listed previously (their width is therefore not |
| 210 128-bits). |
| 211 |
201 Array and struct types | 212 Array and struct types |
202 ---------------------- | 213 ---------------------- |
203 | 214 |
204 Array and struct types are only allowed in | 215 Array and struct types are only allowed in |
205 :ref:`global variable initializers <bitcode_globalvariables>`. | 216 :ref:`global variable initializers <bitcode_globalvariables>`. |
206 | 217 |
207 .. _bitcode_pointertypes: | 218 .. _bitcode_pointertypes: |
208 | 219 |
209 Pointer types | 220 Pointer types |
210 ------------- | 221 ------------- |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 | 373 |
363 The pointer argument of a ``bitcast`` instruction must be a *inherent* pointer | 374 The pointer argument of a ``bitcast`` instruction must be a *inherent* pointer |
364 (see :ref:`pointer types <bitcode_pointertypes>`). | 375 (see :ref:`pointer types <bitcode_pointertypes>`). |
365 | 376 |
366 * ``icmp`` | 377 * ``icmp`` |
367 * ``fcmp`` | 378 * ``fcmp`` |
368 * ``phi`` | 379 * ``phi`` |
369 * ``select`` | 380 * ``select`` |
370 * ``call`` | 381 * ``call`` |
371 * ``unreachable`` | 382 * ``unreachable`` |
| 383 * ``insertelement`` |
| 384 * ``extractelement`` |
372 | 385 |
373 .. _bitcode_allocainst: | 386 .. _bitcode_allocainst: |
374 | 387 |
375 ``alloca`` | 388 ``alloca`` |
376 ---------- | 389 ---------- |
377 | 390 |
378 The only allowed type for ``alloca`` instructions in PNaCl bitcode is i8. The | 391 The only allowed type for ``alloca`` instructions in PNaCl bitcode is i8. The |
379 size argument must be an i32. For example: | 392 size argument must be an i32. For example: |
380 | 393 |
381 .. naclcode:: | 394 .. naclcode:: |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 | 559 |
547 declare i1 @llvm.nacl.atomic.is.lock.free(i32 <byte_size>, i8* <address>) | 560 declare i1 @llvm.nacl.atomic.is.lock.free(i32 <byte_size>, i8* <address>) |
548 | 561 |
549 The ``llvm.nacl.atomic.is.lock.free`` intrinsic is designed to | 562 The ``llvm.nacl.atomic.is.lock.free`` intrinsic is designed to |
550 determine at translation time whether atomic operations of a certain | 563 determine at translation time whether atomic operations of a certain |
551 ``byte_size`` (a compile-time constant), at a particular ``address``, | 564 ``byte_size`` (a compile-time constant), at a particular ``address``, |
552 are lock-free or not. This reflects the C11 ``atomic_is_lock_free`` | 565 are lock-free or not. This reflects the C11 ``atomic_is_lock_free`` |
553 function from header ``<stdatomic.h>`` and the C++11 ``is_lock_free`` | 566 function from header ``<stdatomic.h>`` and the C++11 ``is_lock_free`` |
554 member function in header ``<atomic>``. It can be used through the | 567 member function in header ``<atomic>``. It can be used through the |
555 ``__nacl_atomic_is_lock_free`` builtin. | 568 ``__nacl_atomic_is_lock_free`` builtin. |
OLD | NEW |