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

Function SUB_addsub_shift

arch/arm64/disassembler/decode2.c:27219–27247  ·  view source on GitHub ↗

sub_addsub_shift.xml */

Source from the content-addressed store, hash-verified

27217
27218/* sub_addsub_shift.xml */
27219int SUB_addsub_shift(context *ctx, Instruction *instr)
27220{
27221 int rc = DECODE_STATUS_UNMATCHED;
27222 /* class iclass_no_s */
27223 /* sf=x|op=1|S=0|01011|shift=xx|0|Rm=xxxxx|imm6=xxxxxx|Rn=xxxxx|Rd=xxxxx */
27224 if((INSWORD & 0x7F200000)==0x4B000000) {
27225 decode_fields32(ENC_SUB_32_ADDSUB_SHIFT, ctx, instr);
27226 ctx->d = UINT(ctx->Rd);
27227 ctx->n = UINT(ctx->Rn);
27228 ctx->m = UINT(ctx->Rm);
27229 ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20;
27230 ctx->sub_op = (ctx->op==1);
27231 ctx->setflags = (ctx->S==1);
27232 instr->setflags = (ctx->S==1) ? FLAGEFFECT_SETS : FLAGEFFECT_NONE;
27233 if(ctx->shift==3) {
27234 UNDEFINED;
27235 }
27236 if(ctx->sf==0 && SLICE(ctx->imm6,5,5)==1) {
27237 UNDEFINED;
27238 }
27239 ctx->shift_type = DecodeShift(ctx->shift);
27240 ctx->shift_amount = UINT(ctx->imm6);
27241 /* regular aliases */
27242 if(ctx->Rn==0x1f) return NEG_SUB_addsub_shift(ctx, instr);
27243 if(ctx->sf==0) OK(ENC_SUB_32_ADDSUB_SHIFT);
27244 if(ctx->sf==1) OK(ENC_SUB_64_ADDSUB_SHIFT);
27245 }
27246 return rc;
27247}
27248
27249/* sub_advsimd.xml */
27250int SUB_advsimd(context *ctx, Instruction *instr)

Callers 1

Calls 3

decode_fields32Function · 0.85
DecodeShiftFunction · 0.85
NEG_SUB_addsub_shiftFunction · 0.85

Tested by

no test coverage detected