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

Function LDSETB

arch/arm64/disassembler/decode2.c:15480–15530  ·  view source on GitHub ↗

ldsetb.xml */

Source from the content-addressed store, hash-verified

15478
15479/* ldsetb.xml */
15480int LDSETB(context *ctx, Instruction *instr)
15481{
15482 int rc = DECODE_STATUS_UNMATCHED;
15483 /* class iclass_general */
15484 /* size=00|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=011|00|Rn=xxxxx|Rt=xxxxx */
15485 if((INSWORD & 0xFF20FC00)==0x38203000) {
15486 decode_fields32(ENC_LDSETAB_32_MEMOP, ctx, instr);
15487 if(!HaveAtomicExt()) {
15488 UNDEFINED;
15489 }
15490 ctx->t = UINT(ctx->Rt);
15491 ctx->n = UINT(ctx->Rn);
15492 ctx->s = UINT(ctx->Rs);
15493 ctx->datasize = (8) << (UINT(ctx->size));
15494 ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20;
15495 ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW;
15496 ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW;
15497 if(!ctx->opc) {
15498 ctx->op = MemAtomicOp_ADD;
15499 }
15500 else if(ctx->opc==1) {
15501 ctx->op = MemAtomicOp_BIC;
15502 }
15503 else if(ctx->opc==2) {
15504 ctx->op = MemAtomicOp_EOR;
15505 }
15506 else if(ctx->opc==3) {
15507 ctx->op = MemAtomicOp_ORR;
15508 }
15509 else if(ctx->opc==4) {
15510 ctx->op = MemAtomicOp_SMAX;
15511 }
15512 else if(ctx->opc==5) {
15513 ctx->op = MemAtomicOp_SMIN;
15514 }
15515 else if(ctx->opc==6) {
15516 ctx->op = MemAtomicOp_UMAX;
15517 }
15518 else if(ctx->opc==7) {
15519 ctx->op = MemAtomicOp_UMIN;
15520 }
15521 ctx->tag_checked = ctx->n!=0x1f;
15522 /* regular aliases */
15523 if(ctx->A==0 && ctx->Rt==0x1f) return STSETB_LDSETB(ctx, instr);
15524 if(ctx->A==1 && ctx->R==0) OK(ENC_LDSETAB_32_MEMOP);
15525 if(ctx->A==1 && ctx->R==1) OK(ENC_LDSETALB_32_MEMOP);
15526 if(ctx->A==0 && ctx->R==0) OK(ENC_LDSETB_32_MEMOP);
15527 if(ctx->A==0 && ctx->R==1) OK(ENC_LDSETLB_32_MEMOP);
15528 }
15529 return rc;
15530}
15531
15532/* ldseth.xml */
15533int LDSETH(context *ctx, Instruction *instr)

Callers 1

decode_iclass_memopFunction · 0.85

Calls 2

decode_fields32Function · 0.85
STSETB_LDSETBFunction · 0.85

Tested by

no test coverage detected