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

Function LDSMAXH

arch/arm64/disassembler/decode2.c:15696–15746  ·  view source on GitHub ↗

ldsmaxh.xml */

Source from the content-addressed store, hash-verified

15694
15695/* ldsmaxh.xml */
15696int LDSMAXH(context *ctx, Instruction *instr)
15697{
15698 int rc = DECODE_STATUS_UNMATCHED;
15699 /* class iclass_general */
15700 /* size=01|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=100|00|Rn=xxxxx|Rt=xxxxx */
15701 if((INSWORD & 0xFF20FC00)==0x78204000) {
15702 decode_fields32(ENC_LDSMAXAH_32_MEMOP, ctx, instr);
15703 if(!HaveAtomicExt()) {
15704 UNDEFINED;
15705 }
15706 ctx->t = UINT(ctx->Rt);
15707 ctx->n = UINT(ctx->Rn);
15708 ctx->s = UINT(ctx->Rs);
15709 ctx->datasize = (8) << (UINT(ctx->size));
15710 ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20;
15711 ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW;
15712 ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW;
15713 if(!ctx->opc) {
15714 ctx->op = MemAtomicOp_ADD;
15715 }
15716 else if(ctx->opc==1) {
15717 ctx->op = MemAtomicOp_BIC;
15718 }
15719 else if(ctx->opc==2) {
15720 ctx->op = MemAtomicOp_EOR;
15721 }
15722 else if(ctx->opc==3) {
15723 ctx->op = MemAtomicOp_ORR;
15724 }
15725 else if(ctx->opc==4) {
15726 ctx->op = MemAtomicOp_SMAX;
15727 }
15728 else if(ctx->opc==5) {
15729 ctx->op = MemAtomicOp_SMIN;
15730 }
15731 else if(ctx->opc==6) {
15732 ctx->op = MemAtomicOp_UMAX;
15733 }
15734 else if(ctx->opc==7) {
15735 ctx->op = MemAtomicOp_UMIN;
15736 }
15737 ctx->tag_checked = ctx->n!=0x1f;
15738 /* regular aliases */
15739 if(ctx->A==0 && ctx->Rt==0x1f) return STSMAXH_LDSMAXH(ctx, instr);
15740 if(ctx->A==1 && ctx->R==0) OK(ENC_LDSMAXAH_32_MEMOP);
15741 if(ctx->A==1 && ctx->R==1) OK(ENC_LDSMAXALH_32_MEMOP);
15742 if(ctx->A==0 && ctx->R==0) OK(ENC_LDSMAXH_32_MEMOP);
15743 if(ctx->A==0 && ctx->R==1) OK(ENC_LDSMAXLH_32_MEMOP);
15744 }
15745 return rc;
15746}
15747
15748/* ldsmin.xml */
15749int LDSMIN(context *ctx, Instruction *instr)

Callers 1

decode_iclass_memopFunction · 0.85

Calls 2

decode_fields32Function · 0.85
STSMAXH_LDSMAXHFunction · 0.85

Tested by

no test coverage detected