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

Function LDRSW_imm

arch/arm64/disassembler/decode2.c:14932–15008  ·  view source on GitHub ↗

ldrsw_imm.xml */

Source from the content-addressed store, hash-verified

14930
14931/* ldrsw_imm.xml */
14932int LDRSW_imm(context *ctx, Instruction *instr)
14933{
14934 int rc = DECODE_STATUS_UNMATCHED;
14935 /* class iclass_post_indexed */
14936 /* size=10|111|V=0|00|opc=10|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */
14937 if((INSWORD & 0xFFE00C00)==0xB8800400) {
14938 decode_fields32(ENC_LDRSW_64_LDST_IMMPOST, ctx, instr);
14939 ctx->wback = TRUE;
14940 ctx->postindex = TRUE;
14941 ctx->scale = UINT(ctx->size);
14942 ctx->offset = SignExtend(ctx->imm9,9);
14943 OK(ENC_LDRSW_64_LDST_IMMPOST);
14944 }
14945 /* class iclass_pre_indexed */
14946 /* size=10|111|V=0|00|opc=10|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */
14947 if((INSWORD & 0xFFE00C00)==0xB8800C00) {
14948 decode_fields32(ENC_LDRSW_64_LDST_IMMPRE, ctx, instr);
14949 ctx->wback = TRUE;
14950 ctx->postindex = FALSE;
14951 ctx->scale = UINT(ctx->size);
14952 ctx->offset = SignExtend(ctx->imm9,9);
14953 OK(ENC_LDRSW_64_LDST_IMMPRE);
14954 }
14955 /* class iclass_unsigned_scaled_offset */
14956 /* size=10|111|V=0|01|opc=10|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */
14957 if((INSWORD & 0xFFC00000)==0xB9800000) {
14958 decode_fields32(ENC_LDRSW_64_LDST_POS, ctx, instr);
14959 ctx->wback = FALSE;
14960 ctx->postindex = FALSE;
14961 ctx->scale = UINT(ctx->size);
14962 ctx->offset = LSL(ZeroExtend(ctx->imm12,0x40),ctx->scale);
14963 OK(ENC_LDRSW_64_LDST_POS);
14964 }
14965 /* post-decode pcode */
14966 ctx->n = UINT(ctx->Rn);
14967 ctx->t = UINT(ctx->Rt);
14968 ctx->acctype = ctx->AccType_NORMAL;
14969 if(SLICE(ctx->opc,1,1)==0) {
14970 if(SLICE(ctx->opc,0,0)==1) {
14971 ctx->memop = MemOp_LOAD;
14972 };
14973 if(ctx->size==3) {
14974 ctx->regsize = 0x40;
14975 };
14976 ctx->signed_ = FALSE;
14977 }
14978 else {
14979 if(ctx->size==3) {
14980 UNDEFINED;
14981 }
14982 else {
14983 ctx->memop = MemOp_LOAD;
14984 if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) {
14985 UNDEFINED;
14986 }
14987 if(SLICE(ctx->opc,0,0)==1) {
14988 ctx->regsize = 0x20;
14989 };

Callers 3

decode_iclass_ldst_posFunction · 0.85

Calls 2

decode_fields32Function · 0.85
SignExtendFunction · 0.85

Tested by

no test coverage detected