Line data Source code
1 : /**
2 : * Copyright (c) 2025 Huawei Technologies Co., Ltd.
3 : * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4 : * CANN Open Software License Agreement Version 2.0 (the "License").
5 : * Please refer to the License for details. You may not use this file except in compliance with the License.
6 : * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
7 : * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8 : * See LICENSE in the root of the software repository for the full text of the License.
9 : */
10 :
11 : #include "ccu_operator.h"
12 : #include "ccu_datatype.h"
13 :
14 : namespace Hccl {
15 : namespace CcuRep {
16 :
17 : template <>
18 1 : void CcuArithmeticOperator<Variable, Variable>::Check() const
19 : {
20 : // nothing
21 1 : }
22 : template <>
23 8 : void CcuArithmeticOperator<Variable, Address>::Check() const
24 : {
25 : // nothing
26 8 : }
27 : template <>
28 1 : void CcuArithmeticOperator<Address, Address>::Check() const
29 : {
30 : // nothing
31 1 : }
32 :
33 : template <>
34 58 : void CcuRelationalOperator<Variable, uint64_t>::Check() const
35 : {
36 : // nothing
37 58 : }
38 :
39 1 : CcuArithmeticOperator<Variable, Variable> Variable::operator+(const Variable& varB) const
40 : {
41 1 : return CcuArithmeticOperator<Variable, Variable>(*this, varB, CcuArithmeticOperatorType::ADDITION);
42 : }
43 1 : CcuArithmeticOperator<Variable, Address> Variable::operator+(const Address& addrB) const
44 : {
45 1 : return CcuArithmeticOperator<Variable, Address>(*this, addrB, CcuArithmeticOperatorType::ADDITION);
46 : }
47 7 : CcuArithmeticOperator<Variable, Address> Address::operator+(const Variable& varB) const
48 : {
49 7 : return CcuArithmeticOperator<Variable, Address>(varB, *this, CcuArithmeticOperatorType::ADDITION);
50 : }
51 1 : CcuArithmeticOperator<Address, Address> Address::operator+(const Address& addrB) const
52 : {
53 1 : return CcuArithmeticOperator<Address, Address>(*this, addrB, CcuArithmeticOperatorType::ADDITION);
54 : }
55 :
56 44 : CcuRelationalOperator<Variable, uint64_t> Variable::operator!=(uint64_t immediate) const
57 : {
58 44 : return CcuRelationalOperator<Variable, uint64_t>(*this, immediate, CcuRelationalOperatorType::NOT_EQUAL);
59 : }
60 :
61 14 : CcuRelationalOperator<Variable, uint64_t> Variable::operator==(uint64_t immediate) const
62 : {
63 14 : return CcuRelationalOperator<Variable, uint64_t>(*this, immediate, CcuRelationalOperatorType::EQUAL);
64 : }
65 :
66 : }; // namespace CcuRep
67 : }; // namespace Hccl
|