Subversion Repositories QNX 8.QNX8 LLVM/Clang compiler suite

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
14 pmbaty 1
//===- IntrinsicsBPF.td - Defines BPF 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 BPF-specific intrinsics.
10
//
11
//===----------------------------------------------------------------------===//
12
 
13
// Specialized loads from packet
14
let TargetPrefix = "bpf" in {  // All intrinsics start with "llvm.bpf."
15
  def int_bpf_load_byte : ClangBuiltin<"__builtin_bpf_load_byte">,
16
              Intrinsic<[llvm_i64_ty], [llvm_ptr_ty, llvm_i64_ty], [IntrReadMem]>;
17
  def int_bpf_load_half : ClangBuiltin<"__builtin_bpf_load_half">,
18
              Intrinsic<[llvm_i64_ty], [llvm_ptr_ty, llvm_i64_ty], [IntrReadMem]>;
19
  def int_bpf_load_word : ClangBuiltin<"__builtin_bpf_load_word">,
20
              Intrinsic<[llvm_i64_ty], [llvm_ptr_ty, llvm_i64_ty], [IntrReadMem]>;
21
  def int_bpf_pseudo : ClangBuiltin<"__builtin_bpf_pseudo">,
22
              Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_i64_ty]>;
23
  def int_bpf_preserve_field_info : ClangBuiltin<"__builtin_bpf_preserve_field_info">,
24
              Intrinsic<[llvm_i32_ty], [llvm_anyptr_ty, llvm_i64_ty],
25
              [IntrNoMem, ImmArg<ArgIndex<1>>]>;
26
  def int_bpf_btf_type_id : ClangBuiltin<"__builtin_bpf_btf_type_id">,
27
              Intrinsic<[llvm_i64_ty], [llvm_i32_ty, llvm_i64_ty],
28
              [IntrNoMem]>;
29
  def int_bpf_preserve_type_info : ClangBuiltin<"__builtin_bpf_preserve_type_info">,
30
              Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i64_ty],
31
              [IntrNoMem]>;
32
  def int_bpf_preserve_enum_value : ClangBuiltin<"__builtin_bpf_preserve_enum_value">,
33
              Intrinsic<[llvm_i64_ty], [llvm_i32_ty, llvm_ptr_ty, llvm_i64_ty],
34
              [IntrNoMem]>;
35
  def int_bpf_passthrough : ClangBuiltin<"__builtin_bpf_passthrough">,
36
              Intrinsic<[llvm_any_ty], [llvm_i32_ty, llvm_any_ty], [IntrNoMem]>;
37
  def int_bpf_compare : ClangBuiltin<"__builtin_bpf_compare">,
38
              Intrinsic<[llvm_i1_ty], [llvm_i32_ty, llvm_anyint_ty, llvm_anyint_ty],
39
              [IntrNoMem]>;
40
}