Line data Source code
1 : /**
2 : * Copyright (c) 2026 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 : #ifndef HCCL_CCU_REPRESENTATION_SHL_H
12 : #define HCCL_CCU_REPRESENTATION_SHL_H
13 :
14 : #include "ccu_rep_base_v1.h"
15 : #include "ccu_datatype_v1.h"
16 :
17 : namespace hcomm {
18 : namespace CcuRep {
19 :
20 : class CcuRepShL : public CcuRepBase {
21 : public:
22 : explicit CcuRepShL(
23 : CcuInsGeneratorBase* insGenPtr, const Variable& varD, const Variable& varN, const Variable& varM);
24 : explicit CcuRepShL(CcuInsGeneratorBase* insGenPtr, const Variable& varD, const Variable& varM);
25 : explicit CcuRepShL(
26 : CcuInsGeneratorBase* insGenPtr, const Address& addrD, const Variable& varN, const Variable& varM);
27 : explicit CcuRepShL(CcuInsGeneratorBase* insGenPtr, const Address& addrD, const Variable& varM);
28 : bool Translate(CcuKernel* ccuKernel, CcuInstr*& instr, uint16_t& curInstrId, const TransDep& dep) override;
29 :
30 : std::string Describe() override;
31 :
32 : private:
33 : ShiftSubType subType{ShiftSubType::INVALID};
34 : ShiftType shiftType{ShiftType::INVALID};
35 : Variable varN;
36 : Variable varM;
37 : Variable varD;
38 : Address addrD;
39 :
40 : CcuInsGeneratorBase* insGenPtr{nullptr};
41 :
42 : public:
43 10 : ShiftSubType GetShiftSubType() { return subType; }
44 10 : ShiftType GetShiftType() { return shiftType; }
45 6 : Variable GetVarN() { return varN; }
46 10 : Variable GetVarM() { return varM; }
47 7 : Variable GetVarD() { return varD; }
48 5 : Address GetAddressD() { return addrD; }
49 : };
50 :
51 : }; // namespace CcuRep
52 : }; // namespace hcomm
53 : #endif // HCCL_CCU_REPRESENTATION_SHL_H
|