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

Function LDCLR

arch/arm64/disassembler/decode2.c:13645–13699  ·  view source on GitHub ↗

ldclr.xml */

Source from the content-addressed store, hash-verified

13643
13644/* ldclr.xml */
13645int LDCLR(context *ctx, Instruction *instr)
13646{
13647 int rc = DECODE_STATUS_UNMATCHED;
13648 /* class iclass_general */
13649 /* size=1x|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=001|00|Rn=xxxxx|Rt=xxxxx */
13650 if((INSWORD & 0xBF20FC00)==0xB8201000) {
13651 decode_fields32(ENC_LDCLR_32_MEMOP, ctx, instr);
13652 if(!HaveAtomicExt()) {
13653 UNDEFINED;
13654 }
13655 ctx->t = UINT(ctx->Rt);
13656 ctx->n = UINT(ctx->Rn);
13657 ctx->s = UINT(ctx->Rs);
13658 ctx->datasize = (8) << (UINT(ctx->size));
13659 ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20;
13660 ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW;
13661 ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW;
13662 if(!ctx->opc) {
13663 ctx->op = MemAtomicOp_ADD;
13664 }
13665 else if(ctx->opc==1) {
13666 ctx->op = MemAtomicOp_BIC;
13667 }
13668 else if(ctx->opc==2) {
13669 ctx->op = MemAtomicOp_EOR;
13670 }
13671 else if(ctx->opc==3) {
13672 ctx->op = MemAtomicOp_ORR;
13673 }
13674 else if(ctx->opc==4) {
13675 ctx->op = MemAtomicOp_SMAX;
13676 }
13677 else if(ctx->opc==5) {
13678 ctx->op = MemAtomicOp_SMIN;
13679 }
13680 else if(ctx->opc==6) {
13681 ctx->op = MemAtomicOp_UMAX;
13682 }
13683 else if(ctx->opc==7) {
13684 ctx->op = MemAtomicOp_UMIN;
13685 }
13686 ctx->tag_checked = ctx->n!=0x1f;
13687 /* regular aliases */
13688 if(ctx->A==0 && ctx->Rt==0x1f) return STCLR_LDCLR(ctx, instr);
13689 if(ctx->size==2 && ctx->A==0 && ctx->R==0) OK(ENC_LDCLR_32_MEMOP);
13690 if(ctx->size==2 && ctx->A==1 && ctx->R==0) OK(ENC_LDCLRA_32_MEMOP);
13691 if(ctx->size==2 && ctx->A==1 && ctx->R==1) OK(ENC_LDCLRAL_32_MEMOP);
13692 if(ctx->size==2 && ctx->A==0 && ctx->R==1) OK(ENC_LDCLRL_32_MEMOP);
13693 if(ctx->size==3 && ctx->A==0 && ctx->R==0) OK(ENC_LDCLR_64_MEMOP);
13694 if(ctx->size==3 && ctx->A==1 && ctx->R==0) OK(ENC_LDCLRA_64_MEMOP);
13695 if(ctx->size==3 && ctx->A==1 && ctx->R==1) OK(ENC_LDCLRAL_64_MEMOP);
13696 if(ctx->size==3 && ctx->A==0 && ctx->R==1) OK(ENC_LDCLRL_64_MEMOP);
13697 }
13698 return rc;
13699}
13700
13701/* ldclrb.xml */
13702int LDCLRB(context *ctx, Instruction *instr)

Callers 1

decode_iclass_memopFunction · 0.85

Calls 2

decode_fields32Function · 0.85
STCLR_LDCLRFunction · 0.85

Tested by

no test coverage detected