• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/**
2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16// Autogenerated file -- DO NOT EDIT!
17% Compiler::intrinsics.each do |intrinsic|
18  {
19    constexpr auto clear_flags = <%= intrinsic.clear_flags.empty? ? "0U" : intrinsic.clear_flags.collect { |f| "compiler::inst_flags::" + f.upcase }.join("|") %>;
20    constexpr auto set_flags = <%= intrinsic.set_flags.empty? ? "0U" : intrinsic.set_flags.collect { |f| "compiler::inst_flags::" + f.upcase }.join("|") %>;
21    auto inst= Inst::New<IntrinsicInst>(&allocator, Opcode::Intrinsic);
22    inst->ClearFlag(static_cast<inst_flags::Flags>(set_flags));
23    inst->SetFlag(static_cast<inst_flags::Flags>(clear_flags));
24    // expected flags after inverse flags adjustment
25    auto expected_flags = inst_flags::NO_DCE | inst_flags::NO_CSE | inst_flags::NO_HOIST | inst_flags::BARRIER | inst_flags::REQUIRE_STATE | inst_flags::RUNTIME_CALL;
26    ASSERT_EQ(expected_flags, inst->GetFlagsMask()) << "Fix <%= intrinsic.enum_name %> intrinsic flags";
27  }
28% end
29