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

Function FMOV_float_gen

arch/arm64/disassembler/decode2.c:9470–9557  ·  view source on GitHub ↗

fmov_float_gen.xml */

Source from the content-addressed store, hash-verified

9468
9469/* fmov_float_gen.xml */
9470int FMOV_float_gen(context *ctx, Instruction *instr)
9471{
9472 int rc = DECODE_STATUS_UNMATCHED;
9473 /* class iclass_float */
9474 /* sf=x|0|S=0|11110|ftype=xx|1|rmode=0x|opcode=11x|000000|Rn=xxxxx|Rd=xxxxx */
9475 if((INSWORD & 0x7F36FC00)==0x1E260000) {
9476 decode_fields32(ENC_FMOV_32H_FLOAT2INT, ctx, instr);
9477 ctx->d = UINT(ctx->Rd);
9478 ctx->n = UINT(ctx->Rn);
9479 ctx->intsize = (ctx->sf==1) ? 0x40 : 0x20;
9480 if(!ctx->ftype) {
9481 ctx->fltsize = 0x20;
9482 }
9483 else if(ctx->ftype==1) {
9484 ctx->fltsize = 0x40;
9485 }
9486 else if(ctx->ftype==2) {
9487 if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)!=13) {
9488 UNDEFINED;
9489 }
9490 ctx->fltsize = 0x80;
9491 }
9492 else if(ctx->ftype==3) {
9493 if(HaveFP16Ext()) {
9494 ctx->fltsize = 0x10;
9495 }
9496 else {
9497 UNDEFINED;
9498 }
9499 }
9500 if(!(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)&12)) {
9501 ctx->rounding = FPDecodeRounding(ctx->rmode);
9502 ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1);
9503 ctx->op = FPConvOp_CVT_FtoI;
9504 }
9505 else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==4) {
9506 ctx->rounding = FPRoundingMode(ctx->FPCR);
9507 ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1);
9508 ctx->op = FPConvOp_CVT_ItoF;
9509 }
9510 else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==8) {
9511 ctx->rounding = FPRounding_TIEAWAY;
9512 ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1);
9513 ctx->op = FPConvOp_CVT_FtoI;
9514 }
9515 else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==12) {
9516 if(ctx->fltsize!=0x10 && ctx->fltsize!=ctx->intsize) {
9517 UNDEFINED;
9518 }
9519 if(SLICE(ctx->opcode,0,0)==1) {
9520 ctx->op = FPConvOp_MOV_ItoF;
9521 };
9522 ctx->part = 0;
9523 }
9524 else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==13) {
9525 if(ctx->intsize!=0x40 || ctx->fltsize!=0x80) {
9526 UNDEFINED;
9527 }

Callers 1

decode_iclass_float2intFunction · 0.85

Calls 3

decode_fields32Function · 0.85
FPDecodeRoundingFunction · 0.85
FPRoundingModeFunction · 0.85

Tested by

no test coverage detected