1# Copyright (c) 2021-2024 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14% Runtime::intrinsics.each do |intrinsic| 15- name: <%= intrinsic.name %> 16 space: <%= intrinsic.space %> 17 class_name: <%= intrinsic.class_name if intrinsic.respond_to?(:class_name)%> 18 method_name: <%= intrinsic.method_name if intrinsic.respond_to?(:method_name)%> 19 safepoint_after_call: <%= intrinsic.respond_to?(:safepoint_after_call) && intrinsic.safepoint_after_call %> 20 private: <%= intrinsic.respond_to?(:private) && intrinsic.private %> 21% compiler_only = intrinsic.respond_to?(:compiler_only) && intrinsic.compiler_only 22% raise "incorrect naming of compiler_only intrinsic" if compiler_only and not intrinsic.name.start_with?("Compiler") 23% raise "incorrect naming of not compiler_only intrinsic" if not compiler_only and intrinsic.name.start_with?("Compiler") 24 compiler_only: <%= compiler_only %> 25 signature: 26% stackrange = intrinsic.signature.respond_to?(:stackrange) && intrinsic.signature.stackrange 27% full_args = intrinsic.signature.args + (stackrange ? ['ptr'] : []) 28 ret: "<%= intrinsic.signature.ret %>" 29 stackrange: <%= stackrange %> 30 args: <%= full_args %> 31% static = intrinsic.respond_to?(:static) && intrinsic.static 32 static: <%= static %> 33% if intrinsic.has_impl? 34 impl: <%= intrinsic.wrapper_impl %> 35 impl_signature: 36 ret: "<%= get_ret_effective_type(intrinsic.signature.ret) %>" 37 args: <%= ((!static && !compiler_only)? [get_effective_type(intrinsic.class_name)] : []) + full_args.map { |t| get_effective_type(t) }.flatten %> 38% if intrinsic.need_abi_wrapper? 39 orig_impl: <%= intrinsic.impl %> 40 orig_impl_signature: 41 ret: "<%= get_ret_type(intrinsic.signature.ret) %>" 42 args: <%= ((!static && !compiler_only)? [get_type(intrinsic.class_name)] : []) + full_args.map { |t| get_type(t) }.flatten %> 43% end 44 need_decl: <%= intrinsic.impl.start_with?(Runtime::intrinsics_namespace) %> 45% end 46% if intrinsic.respond_to?(:peephole_func) 47 peephole_func: <%= intrinsic.peephole_func %> 48% end 49% if intrinsic.respond_to?(:fast_path) 50 fast_path: <%= intrinsic.fast_path %> 51% end 52 safe_intrinsic: <%= intrinsic.respond_to?(:safe_intrinsic) ? intrinsic.safe_intrinsic : false %> 53 clear_flags: <%= intrinsic.respond_to?(:clear_flags) ? intrinsic.clear_flags : [] %> 54 set_flags: <%= intrinsic.respond_to?(:set_flags) ? intrinsic.set_flags : [] %> 55 additional_temps: <%= intrinsic.respond_to?(:additional_temps) ? intrinsic.additional_temps : 0 %> 56% if intrinsic.respond_to?(:llvm_impl) 57 llvm_impl: <%= intrinsic.llvm_impl %> 58% end 59% if intrinsic.respond_to?(:llvm_codegen_func) 60 llvm_codegen_func: <%= intrinsic.llvm_codegen_func %> 61% end 62% if intrinsic.respond_to?(:codegen_func) 63 codegen_func: <%= intrinsic.codegen_func %> 64 codegen_virt: <%= intrinsic.respond_to?(:codegen_virt) ? intrinsic.codegen_virt : false %> 65 codegen_arch: <%= intrinsic.respond_to?(:codegen_arch) ? intrinsic.codegen_arch : ['amd64', 'arm32', 'arm64'] %> 66% if intrinsic.respond_to?(:can_encode_func) 67 can_encode_func: <%= intrinsic.can_encode_func %> 68% end 69% else 70 codegen_arch: <%= intrinsic.respond_to?(:codegen_arch) ? intrinsic.codegen_arch : [] %> 71% end 72 need_nullcheck: <%= intrinsic.respond_to?(:need_nullcheck) ? intrinsic.need_nullcheck : [] %> 73 is_fastpath: <%= intrinsic.respond_to?(:is_fastpath) ? intrinsic.is_fastpath : false %> 74 need_param_locations: <%= intrinsic.respond_to?(:need_param_locations) && intrinsic.need_param_locations %> 75 is_stub: <%= intrinsic.respond_to?(:is_stub) ? intrinsic.is_stub : false %> 76% if intrinsic.respond_to?(:inline_func) 77 inline_func: <%= intrinsic.inline_func %> 78 inline_need_types: <%= intrinsic.respond_to?(:inline_need_types) && intrinsic.inline_need_types %> 79% end 80% if intrinsic.respond_to?(:interop_intrinsic_kind) 81 interop_intrinsic_kind: <%= intrinsic.interop_intrinsic_kind %> 82% end 83 skip_codegen_decl: <%= intrinsic.respond_to?(:skip_codegen_decl) ? intrinsic.skip_codegen_decl : false %> 84% end 85