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

Function LDEORH

arch/arm64/disassembler/decode2.c:13918–13968  ·  view source on GitHub ↗

ldeorh.xml */

Source from the content-addressed store, hash-verified

13916
13917/* ldeorh.xml */
13918int LDEORH(context *ctx, Instruction *instr)
13919{
13920 int rc = DECODE_STATUS_UNMATCHED;
13921 /* class iclass_general */
13922 /* size=01|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=010|00|Rn=xxxxx|Rt=xxxxx */
13923 if((INSWORD & 0xFF20FC00)==0x78202000) {
13924 decode_fields32(ENC_LDEORAH_32_MEMOP, ctx, instr);
13925 if(!HaveAtomicExt()) {
13926 UNDEFINED;
13927 }
13928 ctx->t = UINT(ctx->Rt);
13929 ctx->n = UINT(ctx->Rn);
13930 ctx->s = UINT(ctx->Rs);
13931 ctx->datasize = (8) << (UINT(ctx->size));
13932 ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20;
13933 ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW;
13934 ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW;
13935 if(!ctx->opc) {
13936 ctx->op = MemAtomicOp_ADD;
13937 }
13938 else if(ctx->opc==1) {
13939 ctx->op = MemAtomicOp_BIC;
13940 }
13941 else if(ctx->opc==2) {
13942 ctx->op = MemAtomicOp_EOR;
13943 }
13944 else if(ctx->opc==3) {
13945 ctx->op = MemAtomicOp_ORR;
13946 }
13947 else if(ctx->opc==4) {
13948 ctx->op = MemAtomicOp_SMAX;
13949 }
13950 else if(ctx->opc==5) {
13951 ctx->op = MemAtomicOp_SMIN;
13952 }
13953 else if(ctx->opc==6) {
13954 ctx->op = MemAtomicOp_UMAX;
13955 }
13956 else if(ctx->opc==7) {
13957 ctx->op = MemAtomicOp_UMIN;
13958 }
13959 ctx->tag_checked = ctx->n!=0x1f;
13960 /* regular aliases */
13961 if(ctx->A==0 && ctx->Rt==0x1f) return STEORH_LDEORH(ctx, instr);
13962 if(ctx->A==1 && ctx->R==0) OK(ENC_LDEORAH_32_MEMOP);
13963 if(ctx->A==1 && ctx->R==1) OK(ENC_LDEORALH_32_MEMOP);
13964 if(ctx->A==0 && ctx->R==0) OK(ENC_LDEORH_32_MEMOP);
13965 if(ctx->A==0 && ctx->R==1) OK(ENC_LDEORLH_32_MEMOP);
13966 }
13967 return rc;
13968}
13969
13970/* ldg.xml */
13971int LDG(context *ctx, Instruction *instr)

Callers 1

decode_iclass_memopFunction · 0.85

Calls 2

decode_fields32Function · 0.85
STEORH_LDEORHFunction · 0.85

Tested by

no test coverage detected