MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / decode_fields32

Function decode_fields32

arch/arm64/disassembler/decode_fields32.c:8–6345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6#include "decode.h"
7
8void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr)
9{
10 uint32_t insword = instr->insword;
11 instr->encoding = enc; /* record current path of decoding */
12 switch(enc) {
13 case ENC_FMADD_H_FLOATDP3:
14 case ENC_FMADD_S_FLOATDP3:
15 case ENC_FMADD_D_FLOATDP3:
16 case ENC_FMSUB_H_FLOATDP3:
17 case ENC_FMSUB_S_FLOATDP3:
18 case ENC_FMSUB_D_FLOATDP3:
19 case ENC_FNMADD_H_FLOATDP3:
20 case ENC_FNMADD_S_FLOATDP3:
21 case ENC_FNMADD_D_FLOATDP3:
22 case ENC_FNMSUB_H_FLOATDP3:
23 case ENC_FNMSUB_S_FLOATDP3:
24 case ENC_FNMSUB_D_FLOATDP3:
25 // M=x|x|S=x|xxxxx|ftype=xx|o1=x|Rm=xxxxx|o0=x|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx
26 ctx->M = insword>>31;
27 ctx->S = (insword>>29)&1;
28 ctx->ftype = (insword>>22)&3;
29 ctx->o1 = (insword>>21)&1;
30 ctx->Rm = (insword>>16)&0x1f;
31 ctx->o0 = (insword>>15)&1;
32 ctx->Ra = (insword>>10)&0x1f;
33 ctx->Rn = (insword>>5)&0x1f;
34 ctx->Rd = insword&0x1f;
35 break;
36 case ENC_FCSEL_H_FLOATSEL:
37 case ENC_FCSEL_S_FLOATSEL:
38 case ENC_FCSEL_D_FLOATSEL:
39 // M=x|x|S=x|xxxxx|ftype=xx|x|Rm=xxxxx|cond=xxxx|xx|Rn=xxxxx|Rd=xxxxx
40 ctx->M = insword>>31;
41 ctx->S = (insword>>29)&1;
42 ctx->ftype = (insword>>22)&3;
43 ctx->Rm = (insword>>16)&0x1f;
44 ctx->cond = (insword>>12)&15;
45 ctx->Rn = (insword>>5)&0x1f;
46 ctx->Rd = insword&0x1f;
47 break;
48 case ENC_FCCMPE_H_FLOATCCMP:
49 case ENC_FCCMPE_S_FLOATCCMP:
50 case ENC_FCCMPE_D_FLOATCCMP:
51 case ENC_FCCMP_H_FLOATCCMP:
52 case ENC_FCCMP_S_FLOATCCMP:
53 case ENC_FCCMP_D_FLOATCCMP:
54 // M=x|x|S=x|xxxxx|ftype=xx|x|Rm=xxxxx|cond=xxxx|xx|Rn=xxxxx|op=x|nzcv=xxxx
55 ctx->M = insword>>31;
56 ctx->S = (insword>>29)&1;
57 ctx->ftype = (insword>>22)&3;
58 ctx->Rm = (insword>>16)&0x1f;
59 ctx->cond = (insword>>12)&15;
60 ctx->Rn = (insword>>5)&0x1f;
61 ctx->op = (insword>>4)&1;
62 ctx->nzcv = insword&15;
63 break;
64 case ENC_FCMPE_H_FLOATCMP:
65 case ENC_FCMPE_HZ_FLOATCMP:

Callers 15

ABS_advsimdFunction · 0.85
ADCFunction · 0.85
ADCSFunction · 0.85
ADDGFunction · 0.85
ADDHN_advsimdFunction · 0.85
ADDP_advsimd_pairFunction · 0.85
ADDP_advsimd_vecFunction · 0.85
ADDS_addsub_extFunction · 0.85
ADDS_addsub_immFunction · 0.85
ADDS_addsub_shiftFunction · 0.85
ADDV_advsimdFunction · 0.85
ADD_addsub_extFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected