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

Function LDSETH

arch/arm64/disassembler/decode2.c:15533–15583  ·  view source on GitHub ↗

ldseth.xml */

Source from the content-addressed store, hash-verified

15531
15532/* ldseth.xml */
15533int LDSETH(context *ctx, Instruction *instr)
15534{
15535 int rc = DECODE_STATUS_UNMATCHED;
15536 /* class iclass_general */
15537 /* size=01|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=011|00|Rn=xxxxx|Rt=xxxxx */
15538 if((INSWORD & 0xFF20FC00)==0x78203000) {
15539 decode_fields32(ENC_LDSETAH_32_MEMOP, ctx, instr);
15540 if(!HaveAtomicExt()) {
15541 UNDEFINED;
15542 }
15543 ctx->t = UINT(ctx->Rt);
15544 ctx->n = UINT(ctx->Rn);
15545 ctx->s = UINT(ctx->Rs);
15546 ctx->datasize = (8) << (UINT(ctx->size));
15547 ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20;
15548 ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW;
15549 ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW;
15550 if(!ctx->opc) {
15551 ctx->op = MemAtomicOp_ADD;
15552 }
15553 else if(ctx->opc==1) {
15554 ctx->op = MemAtomicOp_BIC;
15555 }
15556 else if(ctx->opc==2) {
15557 ctx->op = MemAtomicOp_EOR;
15558 }
15559 else if(ctx->opc==3) {
15560 ctx->op = MemAtomicOp_ORR;
15561 }
15562 else if(ctx->opc==4) {
15563 ctx->op = MemAtomicOp_SMAX;
15564 }
15565 else if(ctx->opc==5) {
15566 ctx->op = MemAtomicOp_SMIN;
15567 }
15568 else if(ctx->opc==6) {
15569 ctx->op = MemAtomicOp_UMAX;
15570 }
15571 else if(ctx->opc==7) {
15572 ctx->op = MemAtomicOp_UMIN;
15573 }
15574 ctx->tag_checked = ctx->n!=0x1f;
15575 /* regular aliases */
15576 if(ctx->A==0 && ctx->Rt==0x1f) return STSETH_LDSETH(ctx, instr);
15577 if(ctx->A==1 && ctx->R==0) OK(ENC_LDSETAH_32_MEMOP);
15578 if(ctx->A==1 && ctx->R==1) OK(ENC_LDSETALH_32_MEMOP);
15579 if(ctx->A==0 && ctx->R==0) OK(ENC_LDSETH_32_MEMOP);
15580 if(ctx->A==0 && ctx->R==1) OK(ENC_LDSETLH_32_MEMOP);
15581 }
15582 return rc;
15583}
15584
15585/* ldsmax.xml */
15586int LDSMAX(context *ctx, Instruction *instr)

Callers 1

decode_iclass_memopFunction · 0.85

Calls 2

decode_fields32Function · 0.85
STSETH_LDSETHFunction · 0.85

Tested by

no test coverage detected