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

Function SCVTF_advsimd_fix

arch/arm64/disassembler/decode2.c:20388–20432  ·  view source on GitHub ↗

scvtf_advsimd_fix.xml */

Source from the content-addressed store, hash-verified

20386
20387/* scvtf_advsimd_fix.xml */
20388int SCVTF_advsimd_fix(context *ctx, Instruction *instr)
20389{
20390 int rc = DECODE_STATUS_UNMATCHED;
20391 /* class iclass_sisd */
20392 /* 01|U=0|111110|immh!=0000|immb=xxx|opcode=11100|1|Rn=xxxxx|Rd=xxxxx */
20393 if((INSWORD & 0xFF80FC00)==0x5F00E400 && (INSWORD & 0x780000)!=0x0) {
20394 decode_fields32(ENC_SCVTF_ASISDSHF_C, ctx, instr);
20395 ctx->d = UINT(ctx->Rd);
20396 ctx->n = UINT(ctx->Rn);
20397 if(!(ctx->immh&14) || ((ctx->immh&14)==2 && !HaveFP16Ext())) {
20398 UNDEFINED;
20399 }
20400 ctx->esize = ((ctx->immh&8)==8) ? 0x40 : (((ctx->immh&12)==4) ? 0x20 : 0x10);
20401 ctx->datasize = ctx->esize;
20402 ctx->elements = 1;
20403 ctx->fracbits = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb));
20404 ctx->unsigned_ = (ctx->U==1);
20405 ctx->rounding = FPRoundingMode(ctx->FPCR);
20406 OK(ENC_SCVTF_ASISDSHF_C);
20407 }
20408 /* class iclass_simd */
20409 /* 0|Q=x|U=0|011110|immh!=0000|immb=xxx|opcode=11100|1|Rn=xxxxx|Rd=xxxxx */
20410 if((INSWORD & 0xBF80FC00)==0xF00E400 && (INSWORD & 0x780000)!=0x0) {
20411 decode_fields32(ENC_SCVTF_ASIMDSHF_C, ctx, instr);
20412 ctx->d = UINT(ctx->Rd);
20413 ctx->n = UINT(ctx->Rn);
20414 if(ctx->immh==0) {
20415 SEE /* asimdimm */;
20416 }
20417 if(!(ctx->immh&14) || ((ctx->immh&14)==2 && !HaveFP16Ext())) {
20418 UNDEFINED;
20419 }
20420 if(((SLICE(ctx->immh,3,3)<<1)|ctx->Q)==2) {
20421 UNDEFINED;
20422 }
20423 ctx->esize = ((ctx->immh&8)==8) ? 0x40 : (((ctx->immh&12)==4) ? 0x20 : 0x10);
20424 ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40;
20425 ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0);
20426 ctx->fracbits = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb));
20427 ctx->unsigned_ = (ctx->U==1);
20428 ctx->rounding = FPRoundingMode(ctx->FPCR);
20429 OK(ENC_SCVTF_ASIMDSHF_C);
20430 }
20431 return rc;
20432}
20433
20434/* scvtf_advsimd_int.xml */
20435int SCVTF_advsimd_int(context *ctx, Instruction *instr)

Callers 2

decode_iclass_asisdshfFunction · 0.85
decode_iclass_asimdshfFunction · 0.85

Calls 2

decode_fields32Function · 0.85
FPRoundingModeFunction · 0.85

Tested by

no test coverage detected