scvtf_float_fix.xml */
| 20497 | |
| 20498 | /* scvtf_float_fix.xml */ |
| 20499 | int SCVTF_float_fix(context *ctx, Instruction *instr) |
| 20500 | { |
| 20501 | int rc = DECODE_STATUS_UNMATCHED; |
| 20502 | /* class iclass_float */ |
| 20503 | /* sf=x|0|S=0|11110|ftype=xx|0|rmode=00|opcode=010|scale=xxxxxx|Rn=xxxxx|Rd=xxxxx */ |
| 20504 | if((INSWORD & 0x7F3F0000)==0x1E020000) { |
| 20505 | decode_fields32(ENC_SCVTF_H32_FLOAT2FIX, ctx, instr); |
| 20506 | ctx->d = UINT(ctx->Rd); |
| 20507 | ctx->n = UINT(ctx->Rn); |
| 20508 | ctx->intsize = (ctx->sf==1) ? 0x40 : 0x20; |
| 20509 | if(!ctx->ftype) { |
| 20510 | ctx->fltsize = 0x20; |
| 20511 | } |
| 20512 | else if(ctx->ftype==1) { |
| 20513 | ctx->fltsize = 0x40; |
| 20514 | } |
| 20515 | else if(ctx->ftype==2) { |
| 20516 | UNDEFINED; |
| 20517 | } |
| 20518 | else if(ctx->ftype==3) { |
| 20519 | if(HaveFP16Ext()) { |
| 20520 | ctx->fltsize = 0x10; |
| 20521 | } |
| 20522 | else { |
| 20523 | UNDEFINED; |
| 20524 | } |
| 20525 | } |
| 20526 | if(ctx->sf==0 && SLICE(ctx->scale,5,5)==0) { |
| 20527 | UNDEFINED; |
| 20528 | } |
| 20529 | ctx->fracbits = 0x40-UINT(ctx->scale); |
| 20530 | if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==3) { |
| 20531 | ctx->rounding = FPRounding_ZERO; |
| 20532 | ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); |
| 20533 | ctx->op = FPConvOp_CVT_FtoI; |
| 20534 | } |
| 20535 | else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==4) { |
| 20536 | ctx->rounding = FPRoundingMode(ctx->FPCR); |
| 20537 | ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); |
| 20538 | ctx->op = FPConvOp_CVT_ItoF; |
| 20539 | } |
| 20540 | else { |
| 20541 | UNDEFINED; |
| 20542 | } |
| 20543 | if(ctx->sf==0 && ctx->ftype==3) OK(ENC_SCVTF_H32_FLOAT2FIX); |
| 20544 | if(ctx->sf==0 && ctx->ftype==0) OK(ENC_SCVTF_S32_FLOAT2FIX); |
| 20545 | if(ctx->sf==0 && ctx->ftype==1) OK(ENC_SCVTF_D32_FLOAT2FIX); |
| 20546 | if(ctx->sf==1 && ctx->ftype==3) OK(ENC_SCVTF_H64_FLOAT2FIX); |
| 20547 | if(ctx->sf==1 && ctx->ftype==0) OK(ENC_SCVTF_S64_FLOAT2FIX); |
| 20548 | if(ctx->sf==1 && ctx->ftype==1) OK(ENC_SCVTF_D64_FLOAT2FIX); |
| 20549 | } |
| 20550 | return rc; |
| 20551 | } |
| 20552 | |
| 20553 | /* scvtf_float_int.xml */ |
| 20554 | int SCVTF_float_int(context *ctx, Instruction *instr) |
no test coverage detected