/* * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // Autogenerated file -- DO NOT EDIT! void RegEncoder::VisitIf([[maybe_unused]] GraphVisitor* v, Inst* inst_base) { [[maybe_unused]] auto re = static_cast(v); [[maybe_unused]] auto inst = inst_base->CastToIf(); switch (inst->GetCc()) { case compiler::CC_EQ: case compiler::CC_NE: case compiler::CC_LT: case compiler::CC_LE: case compiler::CC_GT: case compiler::CC_GE: { re->Check8Width(inst); break; } default: LOG(DEBUG, BYTECODE_OPTIMIZER) << "CheckWidth for " << compiler::GetOpcodeString(inst->GetOpcode()) << " failed"; re->success_ = false; } } void RegEncoder::VisitIfImm([[maybe_unused]] GraphVisitor* v, Inst* inst_base) { [[maybe_unused]] auto re = static_cast(v); [[maybe_unused]] auto inst = inst_base->CastToIfImm(); switch (inst->GetCc()) { case compiler::CC_EQ: case compiler::CC_NE: case compiler::CC_LT: case compiler::CC_LE: case compiler::CC_GT: case compiler::CC_GE: { break; } default: LOG(DEBUG, BYTECODE_OPTIMIZER) << "CheckWidth for " << compiler::GetOpcodeString(inst->GetOpcode()) << " failed"; re->success_ = false; } } % call_me_from_template % visitors.each do |visitor| void RegEncoder::Visit<%= visitor.ir_op %>([[maybe_unused]] GraphVisitor* v, Inst* inst_base) { [[maybe_unused]] auto re = static_cast(v); [[maybe_unused]] auto inst = inst_base->CastTo<%= visitor.ir_op %>(); <%= visitor.switch.check_width %> } % end