Deleted Added
sdiff udiff text old ( 6273:e46f6767b2c0 ) new ( 6276:11dab30a70e8 )
full compact
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
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)
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
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
179def format DataImmOp(code, flagtype = logic) {{
180 code += "resTemp = resTemp;"
181 iop = InstObjParams(name, Name, 'PredImmOp',
182 {"code": code,
183 "predicate_test": predicateTest})
184 ccIop = InstObjParams(name, Name + "Cc", 'PredImmOp',
185 {"code": code + getImmCcCode(flagtype),
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 ---