ldrb_imm.xml */
| 14335 | |
| 14336 | /* ldrb_imm.xml */ |
| 14337 | int LDRB_imm(context *ctx, Instruction *instr) |
| 14338 | { |
| 14339 | int rc = DECODE_STATUS_UNMATCHED; |
| 14340 | /* class iclass_post_indexed */ |
| 14341 | /* size=00|111|V=0|00|opc=01|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */ |
| 14342 | if((INSWORD & 0xFFE00C00)==0x38400400) { |
| 14343 | decode_fields32(ENC_LDRB_32_LDST_IMMPOST, ctx, instr); |
| 14344 | ctx->wback = TRUE; |
| 14345 | ctx->postindex = TRUE; |
| 14346 | ctx->scale = UINT(ctx->size); |
| 14347 | ctx->offset = SignExtend(ctx->imm9,9); |
| 14348 | OK(ENC_LDRB_32_LDST_IMMPOST); |
| 14349 | } |
| 14350 | /* class iclass_pre_indexed */ |
| 14351 | /* size=00|111|V=0|00|opc=01|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */ |
| 14352 | if((INSWORD & 0xFFE00C00)==0x38400C00) { |
| 14353 | decode_fields32(ENC_LDRB_32_LDST_IMMPRE, ctx, instr); |
| 14354 | ctx->wback = TRUE; |
| 14355 | ctx->postindex = FALSE; |
| 14356 | ctx->scale = UINT(ctx->size); |
| 14357 | ctx->offset = SignExtend(ctx->imm9,9); |
| 14358 | OK(ENC_LDRB_32_LDST_IMMPRE); |
| 14359 | } |
| 14360 | /* class iclass_unsigned_scaled_offset */ |
| 14361 | /* size=00|111|V=0|01|opc=01|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */ |
| 14362 | if((INSWORD & 0xFFC00000)==0x39400000) { |
| 14363 | decode_fields32(ENC_LDRB_32_LDST_POS, ctx, instr); |
| 14364 | ctx->wback = FALSE; |
| 14365 | ctx->postindex = FALSE; |
| 14366 | ctx->scale = UINT(ctx->size); |
| 14367 | ctx->offset = LSL(ZeroExtend(ctx->imm12,0x40),ctx->scale); |
| 14368 | OK(ENC_LDRB_32_LDST_POS); |
| 14369 | } |
| 14370 | /* post-decode pcode */ |
| 14371 | ctx->n = UINT(ctx->Rn); |
| 14372 | ctx->t = UINT(ctx->Rt); |
| 14373 | ctx->acctype = ctx->AccType_NORMAL; |
| 14374 | if(SLICE(ctx->opc,1,1)==0) { |
| 14375 | if(SLICE(ctx->opc,0,0)==1) { |
| 14376 | ctx->memop = MemOp_LOAD; |
| 14377 | }; |
| 14378 | if(ctx->size==3) { |
| 14379 | ctx->regsize = 0x40; |
| 14380 | }; |
| 14381 | ctx->signed_ = FALSE; |
| 14382 | } |
| 14383 | else { |
| 14384 | if(ctx->size==3) { |
| 14385 | UNDEFINED; |
| 14386 | } |
| 14387 | else { |
| 14388 | ctx->memop = MemOp_LOAD; |
| 14389 | if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { |
| 14390 | UNDEFINED; |
| 14391 | } |
| 14392 | if(SLICE(ctx->opc,0,0)==1) { |
| 14393 | ctx->regsize = 0x20; |
| 14394 | }; |
no test coverage detected