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

Function FCVTPU_float

arch/arm64/disassembler/decode2.c:7155–7238  ·  view source on GitHub ↗

fcvtpu_float.xml */

Source from the content-addressed store, hash-verified

7153
7154/* fcvtpu_float.xml */
7155int FCVTPU_float(context *ctx, Instruction *instr)
7156{
7157 int rc = DECODE_STATUS_UNMATCHED;
7158 /* class iclass_float */
7159 /* sf=x|0|S=0|11110|ftype=xx|1|rmode=01|opcode=001|000000|Rn=xxxxx|Rd=xxxxx */
7160 if((INSWORD & 0x7F3FFC00)==0x1E290000) {
7161 decode_fields32(ENC_FCVTPU_32H_FLOAT2INT, ctx, instr);
7162 ctx->d = UINT(ctx->Rd);
7163 ctx->n = UINT(ctx->Rn);
7164 ctx->intsize = (ctx->sf==1) ? 0x40 : 0x20;
7165 if(!ctx->ftype) {
7166 ctx->fltsize = 0x20;
7167 }
7168 else if(ctx->ftype==1) {
7169 ctx->fltsize = 0x40;
7170 }
7171 else if(ctx->ftype==2) {
7172 if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)!=13) {
7173 UNDEFINED;
7174 }
7175 ctx->fltsize = 0x80;
7176 }
7177 else if(ctx->ftype==3) {
7178 if(HaveFP16Ext()) {
7179 ctx->fltsize = 0x10;
7180 }
7181 else {
7182 UNDEFINED;
7183 }
7184 }
7185 if(!(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)&12)) {
7186 ctx->rounding = FPDecodeRounding(ctx->rmode);
7187 ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1);
7188 ctx->op = FPConvOp_CVT_FtoI;
7189 }
7190 else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==4) {
7191 ctx->rounding = FPRoundingMode(ctx->FPCR);
7192 ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1);
7193 ctx->op = FPConvOp_CVT_ItoF;
7194 }
7195 else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==8) {
7196 ctx->rounding = FPRounding_TIEAWAY;
7197 ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1);
7198 ctx->op = FPConvOp_CVT_FtoI;
7199 }
7200 else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==12) {
7201 if(ctx->fltsize!=0x10 && ctx->fltsize!=ctx->intsize) {
7202 UNDEFINED;
7203 }
7204 if(SLICE(ctx->opcode,0,0)==1) {
7205 ctx->op = FPConvOp_MOV_ItoF;
7206 };
7207 ctx->part = 0;
7208 }
7209 else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==13) {
7210 if(ctx->intsize!=0x40 || ctx->fltsize!=0x80) {
7211 UNDEFINED;
7212 }

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