pred.isa (8303:5a95f1d2494e) pred.isa (8304:16911ff780d3)
1// -*- mode:c++ -*-
2
3// Copyright (c) 2010 ARM Limited
4// All rights reserved
5//
6// The license below extends only to copyright in the software and shall
7// not be construed as granting a license to any other intellectual
8// property including but not limited to intellectual property relating

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

43let {{
44
45 calcCcCode = '''
46 if (%(canOverflow)s){
47 cprintf("canOverflow: %%d\\n", Rd < resTemp);
48 CpsrQ = (Rd < resTemp) ? 1 << 27 : 0;
49 } else {
50 uint16_t _ic, _iv, _iz, _in;
1// -*- mode:c++ -*-
2
3// Copyright (c) 2010 ARM Limited
4// All rights reserved
5//
6// The license below extends only to copyright in the software and shall
7// not be construed as granting a license to any other intellectual
8// property including but not limited to intellectual property relating

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

43let {{
44
45 calcCcCode = '''
46 if (%(canOverflow)s){
47 cprintf("canOverflow: %%d\\n", Rd < resTemp);
48 CpsrQ = (Rd < resTemp) ? 1 << 27 : 0;
49 } else {
50 uint16_t _ic, _iv, _iz, _in;
51 _in = (resTemp >> %(negBit)d) & 1;
51 _in = (resTemp >> %(negBit)d);
52 _iz = (resTemp == 0);
52 _iz = (resTemp == 0);
53 _iv = %(ivValue)s & 1;
54 _ic = %(icValue)s & 1;
53 _iv = %(ivValue)s;
54 _ic = %(icValue)s;
55
56 CondCodesNZ = (_in << 1) | (_iz);
57 CondCodesC = _ic;
58 CondCodesV = _iv;
59
60 DPRINTF(Arm, "in = %%d\\n", _in);
61 DPRINTF(Arm, "iz = %%d\\n", _iz);
62 DPRINTF(Arm, "ic = %%d\\n", _ic);

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

133 icValue = '(rotate ? rotated_carry:CondCodesC)'
134 ivValue = 'CondCodesV'
135 return calcCcCode % vars()
136}};
137
138def format DataOp(code, flagtype = logic) {{
139 (regCcCode, immCcCode) = getCcCode(flagtype)
140 regCode = '''uint32_t op2 = shift_rm_rs(Rm, Rs<7:0>,
55
56 CondCodesNZ = (_in << 1) | (_iz);
57 CondCodesC = _ic;
58 CondCodesV = _iv;
59
60 DPRINTF(Arm, "in = %%d\\n", _in);
61 DPRINTF(Arm, "iz = %%d\\n", _iz);
62 DPRINTF(Arm, "ic = %%d\\n", _ic);

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

133 icValue = '(rotate ? rotated_carry:CondCodesC)'
134 ivValue = 'CondCodesV'
135 return calcCcCode % vars()
136}};
137
138def format DataOp(code, flagtype = logic) {{
139 (regCcCode, immCcCode) = getCcCode(flagtype)
140 regCode = '''uint32_t op2 = shift_rm_rs(Rm, Rs<7:0>,
141 shift, CondCodesC);
141 shift, 0);
142 op2 = op2;''' + code
143 immCode = '''uint32_t op2 = shift_rm_imm(Rm, shift_size,
142 op2 = op2;''' + code
143 immCode = '''uint32_t op2 = shift_rm_imm(Rm, shift_size,
144 shift, CondCodesC);
144 shift, OptShiftRmCondCodesC);
145 op2 = op2;''' + code
146 regIop = InstObjParams(name, Name, 'PredIntOp',
147 {"code": regCode,
145 op2 = op2;''' + code
146 regIop = InstObjParams(name, Name, 'PredIntOp',
147 {"code": regCode,
148 "predicate_test": predicateTest})
148 "predicate_test": pickPredicate(regCode)})
149 immIop = InstObjParams(name, Name + "Imm", 'PredIntOp',
150 {"code": immCode,
149 immIop = InstObjParams(name, Name + "Imm", 'PredIntOp',
150 {"code": immCode,
151 "predicate_test": predicateTest})
151 "predicate_test": pickPredicate(imm)})
152 regCcIop = InstObjParams(name, Name + "Cc", 'PredIntOp',
152 regCcIop = InstObjParams(name, Name + "Cc", 'PredIntOp',
153 {"code": regCode + regCcCode,
154 "predicate_test": condPredicateTest})
153 {"code": regCode + regCcCode,
154 "predicate_test": pickPredicate(regCode + regCcCode)})
155 immCcIop = InstObjParams(name, Name + "ImmCc", 'PredIntOp',
155 immCcIop = InstObjParams(name, Name + "ImmCc", 'PredIntOp',
156 {"code": immCode + immCcCode,
157 "predicate_test": condPredicateTest})
156 {"code": immCode + immCcCode,
157 "predicate_test": pickPredicate(immCode + immCcCode)})
158 header_output = BasicDeclare.subst(regIop) + \
159 BasicDeclare.subst(immIop) + \
160 BasicDeclare.subst(regCcIop) + \
161 BasicDeclare.subst(immCcIop)
162 decoder_output = BasicConstructor.subst(regIop) + \
163 BasicConstructor.subst(immIop) + \
164 BasicConstructor.subst(regCcIop) + \
165 BasicConstructor.subst(immCcIop)
166 exec_output = PredOpExecute.subst(regIop) + \
167 PredOpExecute.subst(immIop) + \
168 PredOpExecute.subst(regCcIop) + \
169 PredOpExecute.subst(immCcIop)
170 decode_block = DataDecode.subst(regIop)
171}};
172
173def format DataImmOp(code, flagtype = logic) {{
174 code += "resTemp = resTemp;"
175 iop = InstObjParams(name, Name, 'PredImmOp',
176 {"code": code,
158 header_output = BasicDeclare.subst(regIop) + \
159 BasicDeclare.subst(immIop) + \
160 BasicDeclare.subst(regCcIop) + \
161 BasicDeclare.subst(immCcIop)
162 decoder_output = BasicConstructor.subst(regIop) + \
163 BasicConstructor.subst(immIop) + \
164 BasicConstructor.subst(regCcIop) + \
165 BasicConstructor.subst(immCcIop)
166 exec_output = PredOpExecute.subst(regIop) + \
167 PredOpExecute.subst(immIop) + \
168 PredOpExecute.subst(regCcIop) + \
169 PredOpExecute.subst(immCcIop)
170 decode_block = DataDecode.subst(regIop)
171}};
172
173def format DataImmOp(code, flagtype = logic) {{
174 code += "resTemp = resTemp;"
175 iop = InstObjParams(name, Name, 'PredImmOp',
176 {"code": code,
177 "predicate_test": predicateTest})
177 "predicate_test": pickPredicate(code)})
178 ccIop = InstObjParams(name, Name + "Cc", 'PredImmOp',
178 ccIop = InstObjParams(name, Name + "Cc", 'PredImmOp',
179 {"code": code + getImmCcCode(flagtype),
180 "predicate_test": condPredicateTest})
179 {"code": code + getImmCcCode(flagtype),
180 "predicate_test": pickPredicate(code + getImmCcCode(flagtype))})
181 header_output = BasicDeclare.subst(iop) + \
182 BasicDeclare.subst(ccIop)
183 decoder_output = BasicConstructor.subst(iop) + \
184 BasicConstructor.subst(ccIop)
185 exec_output = PredOpExecute.subst(iop) + \
186 PredOpExecute.subst(ccIop)
187 decode_block = DataImmDecode.subst(iop)
188}};
189
190def format PredOp(code, *opt_flags) {{
191 iop = InstObjParams(name, Name, 'PredOp',
192 {"code": code,
181 header_output = BasicDeclare.subst(iop) + \
182 BasicDeclare.subst(ccIop)
183 decoder_output = BasicConstructor.subst(iop) + \
184 BasicConstructor.subst(ccIop)
185 exec_output = PredOpExecute.subst(iop) + \
186 PredOpExecute.subst(ccIop)
187 decode_block = DataImmDecode.subst(iop)
188}};
189
190def format PredOp(code, *opt_flags) {{
191 iop = InstObjParams(name, Name, 'PredOp',
192 {"code": code,
193 "predicate_test": predicateTest},
193 "predicate_test": pickPredicate(code)},
194 opt_flags)
195 header_output = BasicDeclare.subst(iop)
196 decoder_output = BasicConstructor.subst(iop)
197 decode_block = BasicDecode.subst(iop)
198 exec_output = PredOpExecute.subst(iop)
199}};
200
201def format PredImmOp(code, *opt_flags) {{
202 iop = InstObjParams(name, Name, 'PredImmOp',
203 {"code": code,
194 opt_flags)
195 header_output = BasicDeclare.subst(iop)
196 decoder_output = BasicConstructor.subst(iop)
197 decode_block = BasicDecode.subst(iop)
198 exec_output = PredOpExecute.subst(iop)
199}};
200
201def format PredImmOp(code, *opt_flags) {{
202 iop = InstObjParams(name, Name, 'PredImmOp',
203 {"code": code,
204 "predicate_test": predicateTest},
204 "predicate_test": pickPredicate(code)},
205 opt_flags)
206 header_output = BasicDeclare.subst(iop)
207 decoder_output = BasicConstructor.subst(iop)
208 decode_block = BasicDecode.subst(iop)
209 exec_output = PredOpExecute.subst(iop)
210}};
211
205 opt_flags)
206 header_output = BasicDeclare.subst(iop)
207 decoder_output = BasicConstructor.subst(iop)
208 decode_block = BasicDecode.subst(iop)
209 exec_output = PredOpExecute.subst(iop)
210}};
211