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

Function DecodeVCVTQ

arch/ARM/ARMDisassembler.c:5537–5606  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5535}
5536
5537static DecodeStatus DecodeVCVTQ(MCInst *Inst, unsigned Insn,
5538 uint64_t Address, const void *Decoder)
5539{
5540 DecodeStatus S = MCDisassembler_Success;
5541 bool hasFullFP16 = ARM_getFeatureBits(Inst->csh->mode, ARM_FeatureFullFP16);
5542 unsigned Vm, imm, cmode, op;
5543 unsigned Vd = (fieldFromInstruction_4(Insn, 12, 4) << 0);
5544
5545 Vd |= (fieldFromInstruction_4(Insn, 22, 1) << 4);
5546 Vm = (fieldFromInstruction_4(Insn, 0, 4) << 0);
5547 Vm |= (fieldFromInstruction_4(Insn, 5, 1) << 4);
5548 imm = fieldFromInstruction_4(Insn, 16, 6);
5549 cmode = fieldFromInstruction_4(Insn, 8, 4);
5550 op = fieldFromInstruction_4(Insn, 5, 1);
5551
5552 // VMOVv4f32 is ambiguous with these decodings.
5553 if (!(imm & 0x38) && cmode == 0xF) {
5554 if (op == 1) return MCDisassembler_Fail;
5555 MCInst_setOpcode(Inst, ARM_VMOVv4f32);
5556 return DecodeNEONModImmInstruction(Inst, Insn, Address, Decoder);
5557 }
5558
5559 // If the top 3 bits of imm are clear, this is a VMOV (immediate)
5560 if (!(imm & 0x38)) {
5561 if (cmode == 0xF) {
5562 if (op == 1) return MCDisassembler_Fail;
5563 MCInst_setOpcode(Inst, ARM_VMOVv4f32);
5564 }
5565
5566 if (hasFullFP16) {
5567 if (cmode == 0xE) {
5568 if (op == 1) {
5569 MCInst_setOpcode(Inst, ARM_VMOVv2i64);
5570 } else {
5571 MCInst_setOpcode(Inst, ARM_VMOVv16i8);
5572 }
5573 }
5574
5575 if (cmode == 0xD) {
5576 if (op == 1) {
5577 MCInst_setOpcode(Inst, ARM_VMVNv4i32);
5578 } else {
5579 MCInst_setOpcode(Inst, ARM_VMOVv4i32);
5580 }
5581 }
5582
5583 if (cmode == 0xC) {
5584 if (op == 1) {
5585 MCInst_setOpcode(Inst, ARM_VMVNv4i32);
5586 } else {
5587 MCInst_setOpcode(Inst, ARM_VMOVv4i32);
5588 }
5589 }
5590 }
5591
5592 return DecodeNEONModImmInstruction(Inst, Insn, Address, Decoder);
5593 }
5594

Callers

nothing calls this directly

Calls 6

ARM_getFeatureBitsFunction · 0.85
MCInst_setOpcodeFunction · 0.85
DecodeQPRRegisterClassFunction · 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…