• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2024 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
18void RegEncoderDynamic::VisitIf([[maybe_unused]] GraphVisitor* v, Inst* instBase) {
19    [[maybe_unused]] auto re = static_cast<RegEncoderDynamic*>(v);
20    [[maybe_unused]] auto inst = instBase->CastToIf();
21    switch (inst->GetCc()) {
22    case ark::compiler::CC_EQ:
23    case ark::compiler::CC_NE:
24    case ark::compiler::CC_LT:
25    case ark::compiler::CC_LE:
26    case ark::compiler::CC_GT:
27    case ark::compiler::CC_GE: {
28        re->Check8Width(inst);
29        break;
30    }
31    default:
32        std::cerr << "CheckWidth for " << ark::compiler::GetOpcodeString(inst->GetOpcode()) << " failed";
33        re->success_ = false;
34    }
35}
36void RegEncoderDynamic::VisitIfImm([[maybe_unused]] GraphVisitor* v, Inst* instBase) {
37    [[maybe_unused]] auto re = static_cast<RegEncoderDynamic*>(v);
38    [[maybe_unused]] auto inst = instBase->CastToIfImm();
39    switch (inst->GetCc()) {
40    case ark::compiler::CC_EQ:
41    case ark::compiler::CC_NE:
42    case ark::compiler::CC_LT:
43    case ark::compiler::CC_LE:
44    case ark::compiler::CC_GT:
45    case ark::compiler::CC_GE: {
46        break;
47    }
48    default:
49        std::cerr << "CheckWidth for " << ark::compiler::GetOpcodeString(inst->GetOpcode()) << " failed";
50        re->success_ = false;
51    }
52}
53void RegEncoderDynamic::VisitCast([[maybe_unused]] GraphVisitor* v, Inst* instBase) {
54    [[maybe_unused]] auto re = static_cast<RegEncoderDynamic*>(v);
55    [[maybe_unused]] auto inst = instBase->CastToCast();
56}
57% call_me_from_template
58
59% visitors.each do |visitor|
60void RegEncoderDynamic::Visit<%= visitor.ir_op %>([[maybe_unused]] GraphVisitor* v, Inst* instBase) {
61    [[maybe_unused]] auto re = static_cast<RegEncoderDynamic*>(v);
62    [[maybe_unused]] auto inst = instBase->CastTo<%= visitor.ir_op %>();
63<%= visitor.switch.check_width %>
64}
65% end
66