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

Function LDSMIN

arch/arm64/disassembler/decode2.c:15749–15803  ·  view source on GitHub ↗

ldsmin.xml */

Source from the content-addressed store, hash-verified

15747
15748/* ldsmin.xml */
15749int LDSMIN(context *ctx, Instruction *instr)
15750{
15751 int rc = DECODE_STATUS_UNMATCHED;
15752 /* class iclass_general */
15753 /* size=1x|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=101|00|Rn=xxxxx|Rt=xxxxx */
15754 if((INSWORD & 0xBF20FC00)==0xB8205000) {
15755 decode_fields32(ENC_LDSMIN_32_MEMOP, ctx, instr);
15756 if(!HaveAtomicExt()) {
15757 UNDEFINED;
15758 }
15759 ctx->t = UINT(ctx->Rt);
15760 ctx->n = UINT(ctx->Rn);
15761 ctx->s = UINT(ctx->Rs);
15762 ctx->datasize = (8) << (UINT(ctx->size));
15763 ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20;
15764 ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW;
15765 ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW;
15766 if(!ctx->opc) {
15767 ctx->op = MemAtomicOp_ADD;
15768 }
15769 else if(ctx->opc==1) {
15770 ctx->op = MemAtomicOp_BIC;
15771 }
15772 else if(ctx->opc==2) {
15773 ctx->op = MemAtomicOp_EOR;
15774 }
15775 else if(ctx->opc==3) {
15776 ctx->op = MemAtomicOp_ORR;
15777 }
15778 else if(ctx->opc==4) {
15779 ctx->op = MemAtomicOp_SMAX;
15780 }
15781 else if(ctx->opc==5) {
15782 ctx->op = MemAtomicOp_SMIN;
15783 }
15784 else if(ctx->opc==6) {
15785 ctx->op = MemAtomicOp_UMAX;
15786 }
15787 else if(ctx->opc==7) {
15788 ctx->op = MemAtomicOp_UMIN;
15789 }
15790 ctx->tag_checked = ctx->n!=0x1f;
15791 /* regular aliases */
15792 if(ctx->A==0 && ctx->Rt==0x1f) return STSMIN_LDSMIN(ctx, instr);
15793 if(ctx->size==2 && ctx->A==0 && ctx->R==0) OK(ENC_LDSMIN_32_MEMOP);
15794 if(ctx->size==2 && ctx->A==1 && ctx->R==0) OK(ENC_LDSMINA_32_MEMOP);
15795 if(ctx->size==2 && ctx->A==1 && ctx->R==1) OK(ENC_LDSMINAL_32_MEMOP);
15796 if(ctx->size==2 && ctx->A==0 && ctx->R==1) OK(ENC_LDSMINL_32_MEMOP);
15797 if(ctx->size==3 && ctx->A==0 && ctx->R==0) OK(ENC_LDSMIN_64_MEMOP);
15798 if(ctx->size==3 && ctx->A==1 && ctx->R==0) OK(ENC_LDSMINA_64_MEMOP);
15799 if(ctx->size==3 && ctx->A==1 && ctx->R==1) OK(ENC_LDSMINAL_64_MEMOP);
15800 if(ctx->size==3 && ctx->A==0 && ctx->R==1) OK(ENC_LDSMINL_64_MEMOP);
15801 }
15802 return rc;
15803}
15804
15805/* ldsminb.xml */
15806int LDSMINB(context *ctx, Instruction *instr)

Callers 1

decode_iclass_memopFunction · 0.85

Calls 2

decode_fields32Function · 0.85
STSMIN_LDSMINFunction · 0.85

Tested by

no test coverage detected