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

Function CAS

arch/arm64/disassembler/decode2.c:1844–1872  ·  view source on GitHub ↗

cas.xml */

Source from the content-addressed store, hash-verified

1842
1843/* cas.xml */
1844int CAS(context *ctx, Instruction *instr)
1845{
1846 int rc = DECODE_STATUS_UNMATCHED;
1847 /* class iclass_base_register */
1848 /* size=1x|0010001|L=x|1|Rs=xxxxx|o0=x|Rt2=11111|Rn=xxxxx|Rt=xxxxx */
1849 if((INSWORD & 0xBFA07C00)==0x88A07C00) {
1850 decode_fields32(ENC_CAS_C32_COMSWAP, ctx, instr);
1851 if(!HaveAtomicExt()) {
1852 UNDEFINED;
1853 }
1854 ctx->n = UINT(ctx->Rn);
1855 ctx->t = UINT(ctx->Rt);
1856 ctx->s = UINT(ctx->Rs);
1857 ctx->datasize = (8) << (UINT(ctx->size));
1858 ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20;
1859 ctx->ldacctype = (ctx->L==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW;
1860 ctx->stacctype = (ctx->o0==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW;
1861 ctx->tag_checked = ctx->n!=0x1f;
1862 if(ctx->size==2 && ctx->L==0 && ctx->o0==0) OK(ENC_CAS_C32_COMSWAP);
1863 if(ctx->size==2 && ctx->L==1 && ctx->o0==0) OK(ENC_CASA_C32_COMSWAP);
1864 if(ctx->size==2 && ctx->L==1 && ctx->o0==1) OK(ENC_CASAL_C32_COMSWAP);
1865 if(ctx->size==2 && ctx->L==0 && ctx->o0==1) OK(ENC_CASL_C32_COMSWAP);
1866 if(ctx->size==3 && ctx->L==0 && ctx->o0==0) OK(ENC_CAS_C64_COMSWAP);
1867 if(ctx->size==3 && ctx->L==1 && ctx->o0==0) OK(ENC_CASA_C64_COMSWAP);
1868 if(ctx->size==3 && ctx->L==1 && ctx->o0==1) OK(ENC_CASAL_C64_COMSWAP);
1869 if(ctx->size==3 && ctx->L==0 && ctx->o0==1) OK(ENC_CASL_C64_COMSWAP);
1870 }
1871 return rc;
1872}
1873
1874/* casb.xml */
1875int CASB(context *ctx, Instruction *instr)

Callers 1

decode_iclass_comswapFunction · 0.85

Calls 1

decode_fields32Function · 0.85

Tested by

no test coverage detected