misc.isa (7209:1721e83dc2b6) misc.isa (7226:dd34f566bbca)
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

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

148 Dest = sext<16>(swap_byte(val));
149 '''
150 revshIop = InstObjParams("revsh", "Revsh", "RevOp",
151 { "code": revshCode,
152 "predicate_test": predicateTest }, [])
153 header_output += RevOpDeclare.subst(revshIop)
154 decoder_output += RevOpConstructor.subst(revshIop)
155 exec_output += PredOpExecute.subst(revshIop)
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

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

148 Dest = sext<16>(swap_byte(val));
149 '''
150 revshIop = InstObjParams("revsh", "Revsh", "RevOp",
151 { "code": revshCode,
152 "predicate_test": predicateTest }, [])
153 header_output += RevOpDeclare.subst(revshIop)
154 decoder_output += RevOpConstructor.subst(revshIop)
155 exec_output += PredOpExecute.subst(revshIop)
156
157 ssatCode = '''
158 int32_t operand = shift_rm_imm(Op1, shiftAmt, shiftType, 0);
159 int32_t res;
160 if (satInt(res, operand, satImm))
161 CondCodes = CondCodes | (1 << 27);
162 else
163 CondCodes = CondCodes;
164 Dest = res;
165 '''
166 ssatIop = InstObjParams("ssat", "Ssat", "SatShiftOp",
167 { "code": ssatCode,
168 "predicate_test": predicateTest }, [])
169 header_output += SatShiftOpDeclare.subst(ssatIop)
170 decoder_output += SatShiftOpConstructor.subst(ssatIop)
171 exec_output += PredOpExecute.subst(ssatIop)
172
173 usatCode = '''
174 int32_t operand = shift_rm_imm(Op1, shiftAmt, shiftType, 0);
175 int32_t res;
176 if (uSatInt(res, operand, satImm))
177 CondCodes = CondCodes | (1 << 27);
178 else
179 CondCodes = CondCodes;
180 Dest = res;
181 '''
182 usatIop = InstObjParams("usat", "Usat", "SatShiftOp",
183 { "code": usatCode,
184 "predicate_test": predicateTest }, [])
185 header_output += SatShiftOpDeclare.subst(usatIop)
186 decoder_output += SatShiftOpConstructor.subst(usatIop)
187 exec_output += PredOpExecute.subst(usatIop)
188
189 ssat16Code = '''
190 int32_t res;
191 uint32_t resTemp = 0;
192 CondCodes = CondCodes;
193 int32_t argLow = sext<16>(bits(Op1, 15, 0));
194 int32_t argHigh = sext<16>(bits(Op1, 31, 16));
195 if (satInt(res, argLow, satImm))
196 CondCodes = CondCodes | (1 << 27);
197 replaceBits(resTemp, 15, 0, res);
198 if (satInt(res, argHigh, satImm))
199 CondCodes = CondCodes | (1 << 27);
200 replaceBits(resTemp, 31, 16, res);
201 Dest = resTemp;
202 '''
203 ssat16Iop = InstObjParams("ssat16", "Ssat16", "SatOp",
204 { "code": ssat16Code,
205 "predicate_test": predicateTest }, [])
206 header_output += SatOpDeclare.subst(ssat16Iop)
207 decoder_output += SatOpConstructor.subst(ssat16Iop)
208 exec_output += PredOpExecute.subst(ssat16Iop)
209
210 usat16Code = '''
211 int32_t res;
212 uint32_t resTemp = 0;
213 CondCodes = CondCodes;
214 int32_t argLow = sext<16>(bits(Op1, 15, 0));
215 int32_t argHigh = sext<16>(bits(Op1, 31, 16));
216 if (uSatInt(res, argLow, satImm))
217 CondCodes = CondCodes | (1 << 27);
218 replaceBits(resTemp, 15, 0, res);
219 if (uSatInt(res, argHigh, satImm))
220 CondCodes = CondCodes | (1 << 27);
221 replaceBits(resTemp, 31, 16, res);
222 Dest = resTemp;
223 '''
224 usat16Iop = InstObjParams("usat16", "Usat16", "SatOp",
225 { "code": usat16Code,
226 "predicate_test": predicateTest }, [])
227 header_output += SatOpDeclare.subst(usat16Iop)
228 decoder_output += SatOpConstructor.subst(usat16Iop)
229 exec_output += PredOpExecute.subst(usat16Iop)
156}};
230}};