pred_inst.hh (7142:c63c06703d0f) pred_inst.hh (7143:c81f34f9e075)
1/*
2 * Copyright (c) 2010 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 84 unchanged lines hidden (view full) ---

93 condCode((ConditionCode)(unsigned)machInst.condCode)
94 {
95 }
96};
97
98/**
99 * Base class for predicated immediate operations.
100 */
1/*
2 * Copyright (c) 2010 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 84 unchanged lines hidden (view full) ---

93 condCode((ConditionCode)(unsigned)machInst.condCode)
94 {
95 }
96};
97
98/**
99 * Base class for predicated immediate operations.
100 */
101class PredImmOpBase : public PredOp
101class PredImmOp : public PredOp
102{
103 protected:
104
105 uint32_t imm;
106 uint32_t rotated_imm;
107 uint32_t rotated_carry;
102{
103 protected:
104
105 uint32_t imm;
106 uint32_t rotated_imm;
107 uint32_t rotated_carry;
108
109 /// Constructor
110 PredImmOpBase(const char *mnem, ExtMachInst _machInst, OpClass __opClass) :
111 PredOp(mnem, _machInst, __opClass),
112 imm(machInst.imm), rotated_imm(0), rotated_carry(0)
113 {
114 }
115
116 std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
117};
118
119/**
120 * Base class for regular predicated immediate operations.
121 */
122class PredImmOp : public PredImmOpBase
123{
124 protected:
125
126 uint32_t rotate;
127
128 /// Constructor
129 PredImmOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass) :
108 uint32_t rotate;
109
110 /// Constructor
111 PredImmOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass) :
130 PredImmOpBase(mnem, _machInst, __opClass),
112 PredOp(mnem, _machInst, __opClass),
113 imm(machInst.imm), rotated_imm(0), rotated_carry(0),
131 rotate(machInst.rotate << 1)
132 {
133 rotated_imm = rotate_imm(imm, rotate);
134 if (rotate != 0)
135 rotated_carry = bits(rotated_imm, 31);
136 }
114 rotate(machInst.rotate << 1)
115 {
116 rotated_imm = rotate_imm(imm, rotate);
117 if (rotate != 0)
118 rotated_carry = bits(rotated_imm, 31);
119 }
137};
138
120
139/**
140 * Base class for modified predicated immediate operations.
141 */
142class PredModImmOp : public PredImmOpBase
143{
144 protected:
145
146 uint8_t ctrlImm;
147 uint8_t dataImm;
148
149
150 /// Constructor
151 PredModImmOp(const char *mnem, ExtMachInst _machInst, OpClass __opClass) :
152 PredImmOpBase(mnem, _machInst, __opClass),
153 ctrlImm(bits(machInst.instBits, 26) << 3 |
154 bits(machInst.instBits, 14, 12)),
155 dataImm(bits(machInst.instBits, 7, 0))
156 {
157 rotated_imm = modified_imm(ctrlImm, dataImm);
158 rotated_carry = bits(rotated_imm, 31);
159 }
121 std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
160};
161
162/**
163 * Base class for predicated integer operations.
164 */
165class PredIntOp : public PredOp
166{
167 protected:

--- 119 unchanged lines hidden ---
122};
123
124/**
125 * Base class for predicated integer operations.
126 */
127class PredIntOp : public PredOp
128{
129 protected:

--- 119 unchanged lines hidden ---