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

Function CASP

arch/arm64/disassembler/decode2.c:1929–1963  ·  view source on GitHub ↗

casp.xml */

Source from the content-addressed store, hash-verified

1927
1928/* casp.xml */
1929int CASP(context *ctx, Instruction *instr)
1930{
1931 int rc = DECODE_STATUS_UNMATCHED;
1932 /* class iclass_base_register */
1933 /* 0|sz=x|001000|o2=0|L=x|o1=1|Rs=xxxxx|o0=x|Rt2=11111|Rn=xxxxx|Rt=xxxxx */
1934 if((INSWORD & 0xBFA07C00)==0x8207C00) {
1935 decode_fields32(ENC_CASP_CP32_COMSWAPPR, ctx, instr);
1936 if(!HaveAtomicExt()) {
1937 UNDEFINED;
1938 }
1939 if(SLICE(ctx->Rs,0,0)==1) {
1940 UNDEFINED;
1941 }
1942 if(SLICE(ctx->Rt,0,0)==1) {
1943 UNDEFINED;
1944 }
1945 ctx->n = UINT(ctx->Rn);
1946 ctx->t = UINT(ctx->Rt);
1947 ctx->s = UINT(ctx->Rs);
1948 ctx->datasize = (0x20) << (UINT(ctx->sz));
1949 ctx->regsize = ctx->datasize;
1950 ctx->ldacctype = (ctx->L==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW;
1951 ctx->stacctype = (ctx->o0==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW;
1952 ctx->tag_checked = ctx->n!=0x1f;
1953 if(ctx->sz==0 && ctx->L==0 && ctx->o0==0) OK(ENC_CASP_CP32_COMSWAPPR);
1954 if(ctx->sz==0 && ctx->L==1 && ctx->o0==0) OK(ENC_CASPA_CP32_COMSWAPPR);
1955 if(ctx->sz==0 && ctx->L==1 && ctx->o0==1) OK(ENC_CASPAL_CP32_COMSWAPPR);
1956 if(ctx->sz==0 && ctx->L==0 && ctx->o0==1) OK(ENC_CASPL_CP32_COMSWAPPR);
1957 if(ctx->sz==1 && ctx->L==0 && ctx->o0==0) OK(ENC_CASP_CP64_COMSWAPPR);
1958 if(ctx->sz==1 && ctx->L==1 && ctx->o0==0) OK(ENC_CASPA_CP64_COMSWAPPR);
1959 if(ctx->sz==1 && ctx->L==1 && ctx->o0==1) OK(ENC_CASPAL_CP64_COMSWAPPR);
1960 if(ctx->sz==1 && ctx->L==0 && ctx->o0==1) OK(ENC_CASPL_CP64_COMSWAPPR);
1961 }
1962 return rc;
1963}
1964
1965/* cbnz.xml */
1966int CBNZ(context *ctx, Instruction *instr)

Callers 1

decode_iclass_comswapprFunction · 0.85

Calls 1

decode_fields32Function · 0.85

Tested by

no test coverage detected