MCPcopy Create free account
hub / github.com/capstone-engine/capstone / DecodeVCVTD

Function DecodeVCVTD

arch/ARM/ARMDisassembler.c:5473–5535  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5471}
5472
5473static DecodeStatus DecodeVCVTD(MCInst *Inst, unsigned Insn,
5474 uint64_t Address, const void *Decoder)
5475{
5476 DecodeStatus S = MCDisassembler_Success;
5477 bool hasFullFP16 = ARM_getFeatureBits(Inst->csh->mode, ARM_FeatureFullFP16);
5478 unsigned Vm, imm, cmode, op;
5479 unsigned Vd = (fieldFromInstruction_4(Insn, 12, 4) << 0);
5480
5481 Vd |= (fieldFromInstruction_4(Insn, 22, 1) << 4);
5482 Vm = (fieldFromInstruction_4(Insn, 0, 4) << 0);
5483 Vm |= (fieldFromInstruction_4(Insn, 5, 1) << 4);
5484 imm = fieldFromInstruction_4(Insn, 16, 6);
5485 cmode = fieldFromInstruction_4(Insn, 8, 4);
5486 op = fieldFromInstruction_4(Insn, 5, 1);
5487
5488 // If the top 3 bits of imm are clear, this is a VMOV (immediate)
5489 if (!(imm & 0x38)) {
5490 if (cmode == 0xF) {
5491 if (op == 1) return MCDisassembler_Fail;
5492 MCInst_setOpcode(Inst, ARM_VMOVv2f32);
5493 }
5494
5495 if (hasFullFP16) {
5496 if (cmode == 0xE) {
5497 if (op == 1) {
5498 MCInst_setOpcode(Inst, ARM_VMOVv1i64);
5499 } else {
5500 MCInst_setOpcode(Inst, ARM_VMOVv8i8);
5501 }
5502 }
5503
5504 if (cmode == 0xD) {
5505 if (op == 1) {
5506 MCInst_setOpcode(Inst, ARM_VMVNv2i32);
5507 } else {
5508 MCInst_setOpcode(Inst, ARM_VMOVv2i32);
5509 }
5510 }
5511
5512 if (cmode == 0xC) {
5513 if (op == 1) {
5514 MCInst_setOpcode(Inst, ARM_VMVNv2i32);
5515 } else {
5516 MCInst_setOpcode(Inst, ARM_VMOVv2i32);
5517 }
5518 }
5519 }
5520
5521 return DecodeNEONModImmInstruction(Inst, Insn, Address, Decoder);
5522 }
5523
5524 if (!(imm & 0x20)) return MCDisassembler_Fail;
5525
5526 if (!Check(&S, DecodeDPRRegisterClass(Inst, Vd, Address, Decoder)))
5527 return MCDisassembler_Fail;
5528
5529 if (!Check(&S, DecodeDPRRegisterClass(Inst, Vm, Address, Decoder)))
5530 return MCDisassembler_Fail;

Callers

nothing calls this directly

Calls 6

ARM_getFeatureBitsFunction · 0.85
MCInst_setOpcodeFunction · 0.85
DecodeDPRRegisterClassFunction · 0.85
MCOperand_CreateImm0Function · 0.85
CheckFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…