1// Copyright (c) 2010 ARM Limited 2// All rights reserved 3// 4// The license below extends only to copyright in the software and shall 5// not be construed as granting a license to any other intellectual 6// property including but not limited to intellectual property relating 7// to a hardware implementation of the functionality of the software 8// licensed hereunder. You may use the software subject to the license --- 242 unchanged lines hidden (view full) --- 251 switch (bits(machInst, 9, 8)) { 252 case 0x0: 253 return new AddReg(machInst, rdn, rdn, rm, 0, LSL); 254 case 0x1: 255 return new CmpReg(machInst, INTREG_ZERO, rdn, rm, 0, LSL); 256 case 0x2: 257 return new MovReg(machInst, rdn, INTREG_ZERO, rm, 0, LSL); 258 case 0x3: |
259 if (bits(machInst, 7) == 0) { 260 return new BxReg(machInst, 261 (IntRegIndex)(uint32_t)bits(machInst, 6, 3), 262 COND_UC); 263 } else { 264 return new BlxReg(machInst, 265 (IntRegIndex)(uint32_t)bits(machInst, 6, 3), 266 COND_UC); 267 } |
268 } 269 } 270 ''' 271}}; 272 273def format Thumb16Adr() {{ 274 decode_block = ''' 275 { --- 22 unchanged lines hidden (view full) --- 298 if (bits(machInst, 7)) { 299 return new SubImm(machInst, INTREG_SP, INTREG_SP, 300 bits(machInst, 6, 0) << 2, true); 301 } else { 302 return new AddImm(machInst, INTREG_SP, INTREG_SP, 303 bits(machInst, 6, 0) << 2, true); 304 } 305 case 0x1: |
306 return new Cbz(machInst, 307 (bits(machInst, 9) << 6) | 308 (bits(machInst, 7, 3) << 1), 309 (IntRegIndex)(uint32_t)bits(machInst, 2, 0)); |
310 case 0x2: 311 switch (bits(machInst, 7, 6)) { 312 case 0x0: 313 return new WarnUnimplemented("sxth", machInst); 314 case 0x1: 315 return new WarnUnimplemented("sxtb", machInst); 316 case 0x2: 317 return new WarnUnimplemented("uxth", machInst); 318 case 0x3: 319 return new WarnUnimplemented("uxtb", machInst); 320 } 321 case 0x3: |
322 return new Cbz(machInst, 323 (bits(machInst, 9) << 6) | 324 (bits(machInst, 7, 3) << 1), 325 (IntRegIndex)(uint32_t)bits(machInst, 2, 0)); |
326 case 0x4: 327 case 0x5: 328 return new WarnUnimplemented("push", machInst); 329 case 0x6: 330 { 331 const uint32_t opBits = bits(machInst, 7, 5); 332 if (opBits == 2) { 333 return new WarnUnimplemented("setend", machInst); 334 } else if (opBits == 3) { 335 return new WarnUnimplemented("cps", machInst); 336 } 337 } 338 case 0x9: |
339 return new Cbnz(machInst, 340 (bits(machInst, 9) << 6) | 341 (bits(machInst, 7, 3) << 1), 342 (IntRegIndex)(uint32_t)bits(machInst, 2, 0)); |
343 case 0xa: 344 switch (bits(machInst, 7, 5)) { 345 case 0x0: 346 return new WarnUnimplemented("rev", machInst); 347 case 0x1: 348 return new WarnUnimplemented("rev16", machInst); 349 case 0x3: 350 return new WarnUnimplemented("revsh", machInst); 351 default: 352 break; 353 } 354 break; 355 case 0xb: |
356 return new Cbnz(machInst, 357 (bits(machInst, 9) << 6) | 358 (bits(machInst, 7, 3) << 1), 359 (IntRegIndex)(uint32_t)bits(machInst, 2, 0)); |
360 case 0xc: 361 case 0xd: 362 return new WarnUnimplemented("pop", machInst); 363 case 0xe: 364 return new WarnUnimplemented("bkpt", machInst); 365 case 0xf: 366 if (bits(machInst, 3, 0) != 0) 367 return new WarnUnimplemented("it", machInst); --- 207 unchanged lines hidden --- |