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

Function decode_iclass_barriers

arch/arm64/disassembler/decode1.c:11–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include "pcode.h"
10
11int decode_iclass_barriers(context *ctx, Instruction *dec)
12{
13 uint32_t CRm=(INSWORD>>8)&15, op2=(INSWORD>>5)&7, Rt=INSWORD&0x1f;
14 if(!CRm && op2==3 && Rt==0x1f && HasTME()) return TCOMMIT(ctx, dec); // -> TCOMMIT_only_barriers
15 if((CRm&3)==2 && op2==1 && Rt==0x1f && HasXS()) return DSB(ctx, dec); // -> DSB_BOn_barriers
16 if((CRm&3)==3 && op2==1 && Rt==0x1f) UNALLOCATED(ENC_UNALLOCATED_14_BARRIERS);
17 if(!(CRm&2) && op2==1 && Rt==0x1f) UNALLOCATED(ENC_UNALLOCATED_12_BARRIERS);
18 if(op2==1 && Rt!=0x1f) UNALLOCATED(ENC_UNALLOCATED_11_BARRIERS);
19 if(op2==2 && Rt==0x1f) return CLREX(ctx, dec); // -> CLREX_BN_barriers
20 if(op2==4 && Rt==0x1f) return DSB(ctx, dec); // -> DSB_BO_barriers
21 if(op2==5 && Rt==0x1f) return DMB(ctx, dec); // -> DMB_BO_barriers
22 if(op2==6 && Rt==0x1f) return ISB(ctx, dec); // -> ISB_BI_barriers
23 if(op2==7 && Rt!=0x1f) UNALLOCATED(ENC_UNALLOCATED_25_BARRIERS);
24 if(op2==7 && Rt==0x1f) return SB(ctx, dec); // -> SB_only_barriers
25 if(CRm==1 && op2==3) UNALLOCATED(ENC_UNALLOCATED_17_BARRIERS);
26 if((CRm&14)==2 && op2==3) UNALLOCATED(ENC_UNALLOCATED_18_BARRIERS);
27 if((CRm&12)==4 && op2==3) UNALLOCATED(ENC_UNALLOCATED_19_BARRIERS);
28 if((CRm&8)==8 && op2==3) UNALLOCATED(ENC_UNALLOCATED_20_BARRIERS);
29 if(!op2) UNALLOCATED(ENC_UNALLOCATED_10_BARRIERS);
30 UNMATCHED;
31}
32
33int decode_iclass_compbranch(context *ctx, Instruction *dec)
34{

Callers 1

decode_specFunction · 0.85

Calls 6

TCOMMITFunction · 0.85
DSBFunction · 0.85
CLREXFunction · 0.85
DMBFunction · 0.85
ISBFunction · 0.85
SBFunction · 0.85

Tested by

no test coverage detected