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

Function SUBS_addsub_shift

arch/arm64/disassembler/decode2.c:27135–27164  ·  view source on GitHub ↗

subs_addsub_shift.xml */

Source from the content-addressed store, hash-verified

27133
27134/* subs_addsub_shift.xml */
27135int SUBS_addsub_shift(context *ctx, Instruction *instr)
27136{
27137 int rc = DECODE_STATUS_UNMATCHED;
27138 /* class iclass_s */
27139 /* sf=x|op=1|S=1|01011|shift=xx|0|Rm=xxxxx|imm6=xxxxxx|Rn=xxxxx|Rd=xxxxx */
27140 if((INSWORD & 0x7F200000)==0x6B000000) {
27141 decode_fields32(ENC_SUBS_32_ADDSUB_SHIFT, ctx, instr);
27142 ctx->d = UINT(ctx->Rd);
27143 ctx->n = UINT(ctx->Rn);
27144 ctx->m = UINT(ctx->Rm);
27145 ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20;
27146 ctx->sub_op = (ctx->op==1);
27147 ctx->setflags = (ctx->S==1);
27148 instr->setflags = (ctx->S==1) ? FLAGEFFECT_SETS : FLAGEFFECT_NONE;
27149 if(ctx->shift==3) {
27150 UNDEFINED;
27151 }
27152 if(ctx->sf==0 && SLICE(ctx->imm6,5,5)==1) {
27153 UNDEFINED;
27154 }
27155 ctx->shift_type = DecodeShift(ctx->shift);
27156 ctx->shift_amount = UINT(ctx->imm6);
27157 /* regular aliases */
27158 if(ctx->Rd==0x1f) return CMP_SUBS_addsub_shift(ctx, instr);
27159 if(ctx->Rn==0x1f && ctx->Rd!=0x1f) return NEGS_SUBS_addsub_shift(ctx, instr);
27160 if(ctx->sf==0) OK(ENC_SUBS_32_ADDSUB_SHIFT);
27161 if(ctx->sf==1) OK(ENC_SUBS_64_ADDSUB_SHIFT);
27162 }
27163 return rc;
27164}
27165
27166/* sub_addsub_ext.xml */
27167int SUB_addsub_ext(context *ctx, Instruction *instr)

Callers 1

Calls 4

decode_fields32Function · 0.85
DecodeShiftFunction · 0.85
CMP_SUBS_addsub_shiftFunction · 0.85
NEGS_SUBS_addsub_shiftFunction · 0.85

Tested by

no test coverage detected