Deleted Added
sdiff udiff text old ( 7419:10e7f0f18461 ) new ( 7602:cd1930acae4e )
full compact
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

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

45// Control transfer instructions
46//
47
48def format ArmBBlxImm() {{
49 decode_block = '''
50 if (machInst.condCode == 0xF) {
51 int32_t imm = (sext<26>(bits(machInst, 23, 0) << 2)) |
52 (bits(machInst, 24) << 1);
53 return new BlxImm(machInst, imm);
54 } else {
55 return new B(machInst, sext<26>(bits(machInst, 23, 0) << 2),
56 (ConditionCode)(uint32_t)machInst.condCode);
57 }
58 '''
59}};
60
61def format ArmBlBlxImm() {{
62 decode_block = '''
63 if (machInst.condCode == 0xF) {
64 int32_t imm = (sext<26>(bits(machInst, 23, 0) << 2)) |
65 (bits(machInst, 24) << 1);
66 return new BlxImm(machInst, imm);
67 } else {
68 return new Bl(machInst, sext<26>(bits(machInst, 23, 0) << 2),
69 (ConditionCode)(uint32_t)machInst.condCode);
70 }
71 '''
72}};
73
74def format ArmBxClz() {{

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

231 (IntRegIndex)(uint32_t)bits(machInst, 11, 8);
232 return new MrsSpsr(machInst, rd);
233 }
234 }
235 break;
236 }
237 case 0x1:
238 {
239 const uint32_t s = bits(machInst, 26);
240 const uint32_t i1 = !(bits(machInst, 13) ^ s);
241 const uint32_t i2 = !(bits(machInst, 11) ^ s);
242 const uint32_t imm10 = bits(machInst, 25, 16);
243 const uint32_t imm11 = bits(machInst, 10, 0);
244 const int32_t imm = sext<25>((s << 24) |
245 (i1 << 23) | (i2 << 22) |
246 (imm10 << 12) | (imm11 << 1));
247 return new B(machInst, imm, COND_UC);
248 }
249 case 0x4:
250 {
251 if (bits(machInst, 0) == 1) {
252 return new Unknown(machInst);
253 }
254 const uint32_t s = bits(machInst, 26);
255 const uint32_t i1 = !(bits(machInst, 13) ^ s);
256 const uint32_t i2 = !(bits(machInst, 11) ^ s);
257 const uint32_t imm10h = bits(machInst, 25, 16);
258 const uint32_t imm10l = bits(machInst, 10, 1);
259 const int32_t imm = sext<25>((s << 24) |
260 (i1 << 23) | (i2 << 22) |
261 (imm10h << 12) | (imm10l << 2));
262 return new BlxImm(machInst, imm);
263 }
264 case 0x5:
265 {
266 const uint32_t s = bits(machInst, 26);
267 const uint32_t i1 = !(bits(machInst, 13) ^ s);
268 const uint32_t i2 = !(bits(machInst, 11) ^ s);
269 const uint32_t imm10 = bits(machInst, 25, 16);
270 const uint32_t imm11 = bits(machInst, 10, 0);
271 const int32_t imm = sext<25>((s << 24) |
272 (i1 << 23) | (i2 << 22) |
273 (imm10 << 12) | (imm11 << 1));
274 return new Bl(machInst, imm, COND_UC);
275 }
276 default:
277 break;
278 }
279 return new Unknown(machInst);
280 }
281 '''
282}};