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

Function AND_log_shift

arch/arm64/disassembler/decode2.c:688–729  ·  view source on GitHub ↗

and_log_shift.xml */

Source from the content-addressed store, hash-verified

686
687/* and_log_shift.xml */
688int AND_log_shift(context *ctx, Instruction *instr)
689{
690 int rc = DECODE_STATUS_UNMATCHED;
691 /* class iclass_no_s */
692 /* sf=x|opc=00|01010|shift=xx|N=0|Rm=xxxxx|imm6=xxxxxx|Rn=xxxxx|Rd=xxxxx */
693 if((INSWORD & 0x7F200000)==0xA000000) {
694 decode_fields32(ENC_AND_32_LOG_SHIFT, ctx, instr);
695 ctx->d = UINT(ctx->Rd);
696 ctx->n = UINT(ctx->Rn);
697 ctx->m = UINT(ctx->Rm);
698 ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20;
699 if(!ctx->opc) {
700 ctx->op = LogicalOp_AND;
701 ctx->setflags = FALSE;
702 instr->setflags = FLAGEFFECT_NONE;
703 }
704 else if(ctx->opc==1) {
705 ctx->op = LogicalOp_ORR;
706 ctx->setflags = FALSE;
707 instr->setflags = FLAGEFFECT_NONE;
708 }
709 else if(ctx->opc==2) {
710 ctx->op = LogicalOp_EOR;
711 ctx->setflags = FALSE;
712 instr->setflags = FLAGEFFECT_NONE;
713 }
714 else if(ctx->opc==3) {
715 ctx->op = LogicalOp_AND;
716 ctx->setflags = TRUE;
717 instr->setflags = FLAGEFFECT_SETS;
718 }
719 if(ctx->sf==0 && SLICE(ctx->imm6,5,5)==1) {
720 UNDEFINED;
721 }
722 ctx->shift_type = DecodeShift(ctx->shift);
723 ctx->shift_amount = UINT(ctx->imm6);
724 ctx->invert = (ctx->N==1);
725 if(ctx->sf==0) OK(ENC_AND_32_LOG_SHIFT);
726 if(ctx->sf==1) OK(ENC_AND_64_LOG_SHIFT);
727 }
728 return rc;
729}
730
731/* asrv.xml */
732int ASRV(context *ctx, Instruction *instr)

Callers 1

decode_iclass_log_shiftFunction · 0.85

Calls 2

decode_fields32Function · 0.85
DecodeShiftFunction · 0.85

Tested by

no test coverage detected