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

Function FCVTNS_float

arch/arm64/disassembler/decode2.c:6674–6757  ·  view source on GitHub ↗

fcvtns_float.xml */

Source from the content-addressed store, hash-verified

6672
6673/* fcvtns_float.xml */
6674int FCVTNS_float(context *ctx, Instruction *instr)
6675{
6676 int rc = DECODE_STATUS_UNMATCHED;
6677 /* class iclass_float */
6678 /* sf=x|0|S=0|11110|ftype=xx|1|rmode=00|opcode=000|000000|Rn=xxxxx|Rd=xxxxx */
6679 if((INSWORD & 0x7F3FFC00)==0x1E200000) {
6680 decode_fields32(ENC_FCVTNS_32H_FLOAT2INT, ctx, instr);
6681 ctx->d = UINT(ctx->Rd);
6682 ctx->n = UINT(ctx->Rn);
6683 ctx->intsize = (ctx->sf==1) ? 0x40 : 0x20;
6684 if(!ctx->ftype) {
6685 ctx->fltsize = 0x20;
6686 }
6687 else if(ctx->ftype==1) {
6688 ctx->fltsize = 0x40;
6689 }
6690 else if(ctx->ftype==2) {
6691 if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)!=13) {
6692 UNDEFINED;
6693 }
6694 ctx->fltsize = 0x80;
6695 }
6696 else if(ctx->ftype==3) {
6697 if(HaveFP16Ext()) {
6698 ctx->fltsize = 0x10;
6699 }
6700 else {
6701 UNDEFINED;
6702 }
6703 }
6704 if(!(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)&12)) {
6705 ctx->rounding = FPDecodeRounding(ctx->rmode);
6706 ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1);
6707 ctx->op = FPConvOp_CVT_FtoI;
6708 }
6709 else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==4) {
6710 ctx->rounding = FPRoundingMode(ctx->FPCR);
6711 ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1);
6712 ctx->op = FPConvOp_CVT_ItoF;
6713 }
6714 else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==8) {
6715 ctx->rounding = FPRounding_TIEAWAY;
6716 ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1);
6717 ctx->op = FPConvOp_CVT_FtoI;
6718 }
6719 else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==12) {
6720 if(ctx->fltsize!=0x10 && ctx->fltsize!=ctx->intsize) {
6721 UNDEFINED;
6722 }
6723 if(SLICE(ctx->opcode,0,0)==1) {
6724 ctx->op = FPConvOp_MOV_ItoF;
6725 };
6726 ctx->part = 0;
6727 }
6728 else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==13) {
6729 if(ctx->intsize!=0x40 || ctx->fltsize!=0x80) {
6730 UNDEFINED;
6731 }

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