pred.isa (6273:e46f6767b2c0) pred.isa (6276:11dab30a70e8)
1// -*- mode:c++ -*-
2
3// Copyright (c) 2007-2008 The Florida State University
4// All rights reserved.
5//
6// Redistribution and use in source and binary forms, with or without
7// modification, are permitted provided that the following conditions are
8// met: redistributions of source code must retain the above copyright

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

96 DPRINTF(Arm, "in = %%d\\n", _in);
97 DPRINTF(Arm, "iz = %%d\\n", _iz);
98 DPRINTF(Arm, "ic = %%d\\n", _ic);
99 DPRINTF(Arm, "iv = %%d\\n", _iv);
100 '''
101
102}};
103
1// -*- mode:c++ -*-
2
3// Copyright (c) 2007-2008 The Florida State University
4// All rights reserved.
5//
6// Redistribution and use in source and binary forms, with or without
7// modification, are permitted provided that the following conditions are
8// met: redistributions of source code must retain the above copyright

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

96 DPRINTF(Arm, "in = %%d\\n", _in);
97 DPRINTF(Arm, "iz = %%d\\n", _iz);
98 DPRINTF(Arm, "ic = %%d\\n", _ic);
99 DPRINTF(Arm, "iv = %%d\\n", _iv);
100 '''
101
102}};
103
104def format DataOp(code, icValue = {{ }},
105 ivValue = {{ Cpsr<28:> }}) {{
104let {{
105 def getCcCode(flagtype):
106 icReg = icImm = iv = ''
107 if flagtype == "none":
108 icReg = icImm = iv = '1'
109 elif flagtype == "add":
110 icReg = icImm = 'findCarry(32, resTemp, Rn, op2)'
111 iv = 'findOverflow(32, resTemp, Rn, op2)'
112 elif flagtype == "sub":
113 icReg = icImm ='findCarry(32, resTemp, Rn, ~op2)'
114 iv = 'findOverflow(32, resTemp, Rn, ~op2)'
115 elif flagtype == "rsb":
116 icReg = icImm = 'findCarry(32, resTemp, op2, ~Rn)'
117 iv = 'findOverflow(32, resTemp, op2, ~Rn)'
118 else:
119 icReg = 'shift_carry_rs(Rm, Rs, shift, Cpsr<29:>)'
120 icImm = 'shift_carry_imm(Rm, shift_size, shift, Cpsr<29:>)'
121 iv = 'Cpsr<28:>'
122 return (calcCcCode % {"icValue" : icReg, "ivValue" : iv},
123 calcCcCode % {"icValue" : icImm, "ivValue" : iv})
124
125 def getImmCcCode(flagtype):
126 ivValue = icValue = ''
127 if flagtype == "none":
128 icValue = ivValue = '1'
129 elif flagtype == "add":
130 icValue = 'findCarry(32, resTemp, Rn, rotated_imm)'
131 ivValue = 'findOverflow(32, resTemp, Rn, rotated_imm)'
132 elif flagtype == "sub":
133 icValue = 'findCarry(32, resTemp, Rn, ~rotated_imm)'
134 ivValue = 'findOverflow(32, resTemp, Rn, ~rotated_imm)'
135 elif flagtype == "rsb":
136 icValue = 'findCarry(32, resTemp, rotated_imm, ~Rn)'
137 ivValue = 'findOverflow(32, resTemp, rotated_imm, ~Rn)'
138 else:
139 icValue = '(rotate ? rotated_carry:Cpsr<29:>)'
140 ivValue = 'Cpsr<28:>'
141 return calcCcCode % vars()
142}};
143
144def format DataOp(code, flagtype = logic) {{
145 (regCcCode, immCcCode) = getCcCode(flagtype)
106 regCode = '''uint32_t op2 = shift_rm_rs(Rm, Rs,
107 shift, Cpsr<29:0>);
108 op2 = op2;''' + code
109 immCode = '''uint32_t op2 = shift_rm_imm(Rm, shift_size,
110 shift, Cpsr<29:0>);
111 op2 = op2;''' + code
146 regCode = '''uint32_t op2 = shift_rm_rs(Rm, Rs,
147 shift, Cpsr<29:0>);
148 op2 = op2;''' + code
149 immCode = '''uint32_t op2 = shift_rm_imm(Rm, shift_size,
150 shift, Cpsr<29:0>);
151 op2 = op2;''' + code
112 if icValue == " ":
113 icValueReg = 'shift_carry_rs(Rm, Rs, shift, Cpsr<29:>)'
114 icValueImm = 'shift_carry_imm(Rm, shift_size, shift, Cpsr<29:>)'
115 else:
116 icValueReg = icValue
117 icValueImm = icValue
118 regCcCode = calcCcCode % {"icValue" : icValueReg,
119 "ivValue" : ivValue}
120 immCcCode = calcCcCode % {"icValue" : icValueImm,
121 "ivValue" : ivValue}
122 regIop = InstObjParams(name, Name, 'PredIntOp',
123 {"code": regCode,
124 "predicate_test": predicateTest})
125 immIop = InstObjParams(name, Name + "Imm", 'PredIntOp',
126 {"code": immCode,
127 "predicate_test": predicateTest})
128 regCcIop = InstObjParams(name, Name + "Cc", 'PredIntOp',
129 {"code": regCode + regCcCode,

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

141 BasicConstructor.subst(immCcIop)
142 exec_output = PredOpExecute.subst(regIop) + \
143 PredOpExecute.subst(immIop) + \
144 PredOpExecute.subst(regCcIop) + \
145 PredOpExecute.subst(immCcIop)
146 decode_block = DataDecode.subst(regIop)
147}};
148
152 regIop = InstObjParams(name, Name, 'PredIntOp',
153 {"code": regCode,
154 "predicate_test": predicateTest})
155 immIop = InstObjParams(name, Name + "Imm", 'PredIntOp',
156 {"code": immCode,
157 "predicate_test": predicateTest})
158 regCcIop = InstObjParams(name, Name + "Cc", 'PredIntOp',
159 {"code": regCode + regCcCode,

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

171 BasicConstructor.subst(immCcIop)
172 exec_output = PredOpExecute.subst(regIop) + \
173 PredOpExecute.subst(immIop) + \
174 PredOpExecute.subst(regCcIop) + \
175 PredOpExecute.subst(immCcIop)
176 decode_block = DataDecode.subst(regIop)
177}};
178
149def format DataImmOp(code,
150 icValue = {{ (rotate ? rotated_carry:Cpsr<29:>) }},
151 ivValue = {{ Cpsr<28:> }}) {{
179def format DataImmOp(code, flagtype = logic) {{
152 code += "resTemp = resTemp;"
153 iop = InstObjParams(name, Name, 'PredImmOp',
154 {"code": code,
155 "predicate_test": predicateTest})
156 ccIop = InstObjParams(name, Name + "Cc", 'PredImmOp',
180 code += "resTemp = resTemp;"
181 iop = InstObjParams(name, Name, 'PredImmOp',
182 {"code": code,
183 "predicate_test": predicateTest})
184 ccIop = InstObjParams(name, Name + "Cc", 'PredImmOp',
157 {"code": code + calcCcCode % vars(),
185 {"code": code + getImmCcCode(flagtype),
158 "predicate_test": predicateTest})
159 header_output = BasicDeclare.subst(iop) + \
160 BasicDeclare.subst(ccIop)
161 decoder_output = BasicConstructor.subst(iop) + \
162 BasicConstructor.subst(ccIop)
163 exec_output = PredOpExecute.subst(iop) + \
164 PredOpExecute.subst(ccIop)
165 decode_block = DataImmDecode.subst(iop)

--- 65 unchanged lines hidden ---
186 "predicate_test": predicateTest})
187 header_output = BasicDeclare.subst(iop) + \
188 BasicDeclare.subst(ccIop)
189 decoder_output = BasicConstructor.subst(iop) + \
190 BasicConstructor.subst(ccIop)
191 exec_output = PredOpExecute.subst(iop) + \
192 PredOpExecute.subst(ccIop)
193 decode_block = DataImmDecode.subst(iop)

--- 65 unchanged lines hidden ---