Coverage Report

Created: 2025-10-10 06:20

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/capstonev5/MCInstrDesc.c
Line
Count
Source
1
/* Capstone Disassembly Engine */
2
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2019 */
3
4
#include "MCInstrDesc.h"
5
6
/// isPredicate - Set if this is one of the operands that made up of
7
/// the predicate operand that controls an isPredicable() instruction.
8
bool MCOperandInfo_isPredicate(const MCOperandInfo *m)
9
3.34M
{
10
3.34M
  return m->Flags & (1 << MCOI_Predicate);
11
3.34M
}
12
13
/// isOptionalDef - Set if this operand is a optional def.
14
///
15
bool MCOperandInfo_isOptionalDef(const MCOperandInfo *m)
16
253k
{
17
253k
  return m->Flags & (1 << MCOI_OptionalDef);
18
253k
}
19
20
/// Checks if operand is tied to another one.
21
bool MCOperandInfo_isTiedToOp(const MCOperandInfo *m)
22
2.41M
{
23
2.41M
  if (m->Constraints & (1 << MCOI_TIED_TO))
24
124k
    return true;
25
2.28M
  return false;
26
2.41M
}
27
28
/// Returns the value of the specified operand constraint if
29
/// it is present. Returns -1 if it is not present.
30
int MCOperandInfo_getOperandConstraint(const MCInstrDesc *InstrDesc,
31
               unsigned OpNum,
32
               MCOI_OperandConstraint Constraint)
33
128k
{
34
128k
  const MCOperandInfo OpInfo = InstrDesc->OpInfo[OpNum];
35
128k
  if (OpNum < InstrDesc->NumOperands &&
36
128k
      (OpInfo.Constraints & (1 << Constraint))) {
37
128k
    unsigned ValuePos = 4 + Constraint * 4;
38
128k
    return (OpInfo.Constraints >> ValuePos) & 0xf;
39
128k
  }
40
0
  return -1;
41
128k
}