Yi Kong | 8328301 | 2023-12-13 12:57:00 +0900 | [diff] [blame^] | 1 | //===- IntrinsicsSPIRV.td - Defines SPIRV intrinsics -------*- tablegen -*-===// |
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // This file defines all of the SPIRV-specific intrinsics. |
| 10 | // |
| 11 | //===----------------------------------------------------------------------===// |
| 12 | |
| 13 | let TargetPrefix = "spv" in { |
| 14 | def int_spv_assign_type : Intrinsic<[], [llvm_any_ty, llvm_metadata_ty]>; |
| 15 | def int_spv_assign_name : Intrinsic<[], [llvm_any_ty, llvm_vararg_ty]>; |
| 16 | |
| 17 | def int_spv_track_constant : Intrinsic<[llvm_any_ty], [llvm_any_ty, llvm_metadata_ty]>; |
| 18 | def int_spv_init_global : Intrinsic<[], [llvm_any_ty, llvm_any_ty]>; |
| 19 | def int_spv_unref_global : Intrinsic<[], [llvm_any_ty]>; |
| 20 | |
| 21 | def int_spv_gep : Intrinsic<[llvm_anyptr_ty], [llvm_i1_ty, llvm_any_ty, llvm_vararg_ty], [ImmArg<ArgIndex<0>>]>; |
| 22 | def int_spv_load : Intrinsic<[llvm_i32_ty], [llvm_anyptr_ty, llvm_i16_ty, llvm_i8_ty], [ImmArg<ArgIndex<1>>, ImmArg<ArgIndex<2>>]>; |
| 23 | def int_spv_store : Intrinsic<[], [llvm_any_ty, llvm_anyptr_ty, llvm_i16_ty, llvm_i8_ty], [ImmArg<ArgIndex<2>>, ImmArg<ArgIndex<3>>]>; |
| 24 | def int_spv_extractv : Intrinsic<[llvm_any_ty], [llvm_i32_ty, llvm_vararg_ty]>; |
| 25 | def int_spv_insertv : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_any_ty, llvm_vararg_ty]>; |
| 26 | def int_spv_extractelt : Intrinsic<[llvm_any_ty], [llvm_any_ty, llvm_anyint_ty]>; |
| 27 | def int_spv_insertelt : Intrinsic<[llvm_any_ty], [llvm_any_ty, llvm_any_ty, llvm_anyint_ty]>; |
| 28 | def int_spv_const_composite : Intrinsic<[llvm_i32_ty], [llvm_vararg_ty]>; |
| 29 | def int_spv_bitcast : Intrinsic<[llvm_any_ty], [llvm_any_ty]>; |
| 30 | def int_spv_switch : Intrinsic<[], [llvm_any_ty, llvm_vararg_ty]>; |
| 31 | def int_spv_cmpxchg : Intrinsic<[llvm_i32_ty], [llvm_any_ty, llvm_vararg_ty]>; |
| 32 | def int_spv_unreachable : Intrinsic<[], []>; |
| 33 | def int_spv_alloca : Intrinsic<[llvm_any_ty], []>; |
| 34 | def int_spv_undef : Intrinsic<[llvm_i32_ty], []>; |
| 35 | } |