fcvtps_float.xml */
| 6999 | |
| 7000 | /* fcvtps_float.xml */ |
| 7001 | int FCVTPS_float(context *ctx, Instruction *instr) |
| 7002 | { |
| 7003 | int rc = DECODE_STATUS_UNMATCHED; |
| 7004 | /* class iclass_float */ |
| 7005 | /* sf=x|0|S=0|11110|ftype=xx|1|rmode=01|opcode=000|000000|Rn=xxxxx|Rd=xxxxx */ |
| 7006 | if((INSWORD & 0x7F3FFC00)==0x1E280000) { |
| 7007 | decode_fields32(ENC_FCVTPS_32H_FLOAT2INT, ctx, instr); |
| 7008 | ctx->d = UINT(ctx->Rd); |
| 7009 | ctx->n = UINT(ctx->Rn); |
| 7010 | ctx->intsize = (ctx->sf==1) ? 0x40 : 0x20; |
| 7011 | if(!ctx->ftype) { |
| 7012 | ctx->fltsize = 0x20; |
| 7013 | } |
| 7014 | else if(ctx->ftype==1) { |
| 7015 | ctx->fltsize = 0x40; |
| 7016 | } |
| 7017 | else if(ctx->ftype==2) { |
| 7018 | if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)!=13) { |
| 7019 | UNDEFINED; |
| 7020 | } |
| 7021 | ctx->fltsize = 0x80; |
| 7022 | } |
| 7023 | else if(ctx->ftype==3) { |
| 7024 | if(HaveFP16Ext()) { |
| 7025 | ctx->fltsize = 0x10; |
| 7026 | } |
| 7027 | else { |
| 7028 | UNDEFINED; |
| 7029 | } |
| 7030 | } |
| 7031 | if(!(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)&12)) { |
| 7032 | ctx->rounding = FPDecodeRounding(ctx->rmode); |
| 7033 | ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); |
| 7034 | ctx->op = FPConvOp_CVT_FtoI; |
| 7035 | } |
| 7036 | else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==4) { |
| 7037 | ctx->rounding = FPRoundingMode(ctx->FPCR); |
| 7038 | ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); |
| 7039 | ctx->op = FPConvOp_CVT_ItoF; |
| 7040 | } |
| 7041 | else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==8) { |
| 7042 | ctx->rounding = FPRounding_TIEAWAY; |
| 7043 | ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); |
| 7044 | ctx->op = FPConvOp_CVT_FtoI; |
| 7045 | } |
| 7046 | else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==12) { |
| 7047 | if(ctx->fltsize!=0x10 && ctx->fltsize!=ctx->intsize) { |
| 7048 | UNDEFINED; |
| 7049 | } |
| 7050 | if(SLICE(ctx->opcode,0,0)==1) { |
| 7051 | ctx->op = FPConvOp_MOV_ItoF; |
| 7052 | }; |
| 7053 | ctx->part = 0; |
| 7054 | } |
| 7055 | else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==13) { |
| 7056 | if(ctx->intsize!=0x40 || ctx->fltsize!=0x80) { |
| 7057 | UNDEFINED; |
| 7058 | } |
no test coverage detected