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

Function CRC32

arch/arm64/disassembler/decode2.c:2952–2979  ·  view source on GitHub ↗

crc32.xml */

Source from the content-addressed store, hash-verified

2950
2951/* crc32.xml */
2952int CRC32(context *ctx, Instruction *instr)
2953{
2954 int rc = DECODE_STATUS_UNMATCHED;
2955 /* class iclass_crc */
2956 /* sf=x|op=0|S=0|11010110|Rm=xxxxx|opcode2[5:3]=010|C=0|sz=xx|Rn=xxxxx|Rd=xxxxx */
2957 if((INSWORD & 0x7FE0F000)==0x1AC04000) {
2958 decode_fields32(ENC_CRC32B_32C_DP_2SRC, ctx, instr);
2959 if(!HaveCRCExt()) {
2960 UNDEFINED;
2961 }
2962 ctx->d = UINT(ctx->Rd);
2963 ctx->n = UINT(ctx->Rn);
2964 ctx->m = UINT(ctx->Rm);
2965 if(ctx->sf==1 && ctx->sz!=3) {
2966 UNDEFINED;
2967 }
2968 if(ctx->sf==0 && ctx->sz==3) {
2969 UNDEFINED;
2970 }
2971 ctx->size = (8) << (UINT(ctx->sz));
2972 ctx->crc32c = (ctx->C==1);
2973 if(ctx->sf==0 && ctx->sz==0) OK(ENC_CRC32B_32C_DP_2SRC);
2974 if(ctx->sf==0 && ctx->sz==1) OK(ENC_CRC32H_32C_DP_2SRC);
2975 if(ctx->sf==0 && ctx->sz==2) OK(ENC_CRC32W_32C_DP_2SRC);
2976 if(ctx->sf==1 && ctx->sz==3) OK(ENC_CRC32X_64C_DP_2SRC);
2977 }
2978 return rc;
2979}
2980
2981/* crc32c.xml */
2982int CRC32C(context *ctx, Instruction *instr)

Callers 1

decode_iclass_dp_2srcFunction · 0.85

Calls 1

decode_fields32Function · 0.85

Tested by

no test coverage detected