OLD | NEW |
1 //===- Intrinsics.td - Defines all LLVM intrinsics ---------*- tablegen -*-===// | 1 //===- Intrinsics.td - Defines all LLVM intrinsics ---------*- tablegen -*-===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file defines properties of all LLVM intrinsics. | 10 // This file defines properties of all LLVM intrinsics. |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 def int_nacl_tp_tls_offset : Intrinsic<[llvm_i32_ty], [llvm_i32_ty]>, | 491 def int_nacl_tp_tls_offset : Intrinsic<[llvm_i32_ty], [llvm_i32_ty]>, |
492 GCCBuiltin<"__builtin_nacl_tp_tls_offset">; | 492 GCCBuiltin<"__builtin_nacl_tp_tls_offset">; |
493 def int_nacl_tp_tdb_offset : Intrinsic<[llvm_i32_ty], [llvm_i32_ty]>, | 493 def int_nacl_tp_tdb_offset : Intrinsic<[llvm_i32_ty], [llvm_i32_ty]>, |
494 GCCBuiltin<"__builtin_nacl_tp_tdb_offset">; | 494 GCCBuiltin<"__builtin_nacl_tp_tdb_offset">; |
495 | 495 |
496 // The following intrinsic provides a target-specific constant value to | 496 // The following intrinsic provides a target-specific constant value to |
497 // indicate the target platform compiled to. The enum values are enumerated | 497 // indicate the target platform compiled to. The enum values are enumerated |
498 // pnaclintrin.h. | 498 // pnaclintrin.h. |
499 def int_nacl_target_arch : Intrinsic<[llvm_i32_ty], []>, | 499 def int_nacl_target_arch : Intrinsic<[llvm_i32_ty], []>, |
500 GCCBuiltin<"__builtin_nacl_target_arch">; | 500 GCCBuiltin<"__builtin_nacl_target_arch">; |
| 501 |
| 502 // Atomic intrinsics. |
| 503 // |
| 504 // Volatiles and atomics are encoded through these intrinsics to make |
| 505 // them platform-independent, remove some of LLVM's legacy, and isolate |
| 506 // PNaCl from future changes to IR. The intrinsics allow user code to |
| 507 // use `__sync_*` builtins as well as C11/C++11 atomics. |
| 508 // |
| 509 // The general signature is: |
| 510 // template<typename T> |
| 511 // T nacl.atomic.<size>(int32_t operation, T *location, T value, |
| 512 // T old_value, int32_t memory_order); |
| 513 // |
| 514 // Where `T` is a 8, 16, 32 or 64-bit integer (`size` bits), and |
| 515 // location is naturally aligned to `T`. Valid `operation` and |
| 516 // `memory_order` values are in llvm/IR/NaCl.h. |
| 517 // |
| 518 // Note that not all arguments are meaningful for all operations: |
| 519 // - result = load {atomic|volatile} T* location, align sizeof(T) |
| 520 // - store {atomic|volatile} T value, T* location memory_order |
| 521 // - result = atomicrmw OP T* location, T value memory_order |
| 522 // Where OP is one of: {add, sub, or, and, xor, xchg} |
| 523 // - result = cmpxchg T* location, T old_value, T value memory_order |
| 524 // - fence memory_order |
| 525 def int_nacl_atomic_8 : Intrinsic<[llvm_i8_ty], |
| 526 [llvm_i32_ty, LLVMPointerType<llvm_i8_ty>, |
| 527 llvm_i8_ty, llvm_i8_ty, llvm_i32_ty], |
| 528 [IntrReadWriteArgMem]>; |
| 529 def int_nacl_atomic_16 : Intrinsic<[llvm_i16_ty], |
| 530 [llvm_i32_ty, LLVMPointerType<llvm_i16_ty>, |
| 531 llvm_i16_ty, llvm_i16_ty, llvm_i32_ty], |
| 532 [IntrReadWriteArgMem]>; |
| 533 def int_nacl_atomic_32 : Intrinsic<[llvm_i32_ty], |
| 534 [llvm_i32_ty, LLVMPointerType<llvm_i32_ty>, |
| 535 llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], |
| 536 [IntrReadWriteArgMem]>; |
| 537 def int_nacl_atomic_64 : Intrinsic<[llvm_i64_ty], |
| 538 [llvm_i32_ty, LLVMPointerType<llvm_i64_ty>, |
| 539 llvm_i64_ty, llvm_i64_ty, llvm_i32_ty], |
| 540 [IntrReadWriteArgMem]>; |
501 // @LOCALMOD-END | 541 // @LOCALMOD-END |
502 | 542 |
503 //===----------------------------------------------------------------------===// | 543 //===----------------------------------------------------------------------===// |
504 // Target-specific intrinsics | 544 // Target-specific intrinsics |
505 //===----------------------------------------------------------------------===// | 545 //===----------------------------------------------------------------------===// |
506 | 546 |
507 include "llvm/IR/IntrinsicsPowerPC.td" | 547 include "llvm/IR/IntrinsicsPowerPC.td" |
508 include "llvm/IR/IntrinsicsX86.td" | 548 include "llvm/IR/IntrinsicsX86.td" |
509 include "llvm/IR/IntrinsicsARM.td" | 549 include "llvm/IR/IntrinsicsARM.td" |
510 include "llvm/IR/IntrinsicsXCore.td" | 550 include "llvm/IR/IntrinsicsXCore.td" |
511 include "llvm/IR/IntrinsicsHexagon.td" | 551 include "llvm/IR/IntrinsicsHexagon.td" |
512 include "llvm/IR/IntrinsicsNVVM.td" | 552 include "llvm/IR/IntrinsicsNVVM.td" |
513 include "llvm/IR/IntrinsicsMips.td" | 553 include "llvm/IR/IntrinsicsMips.td" |
514 include "llvm/IR/IntrinsicsR600.td" | 554 include "llvm/IR/IntrinsicsR600.td" |
OLD | NEW |