scvtf_float_int.xml */
| 20552 | |
| 20553 | /* scvtf_float_int.xml */ |
| 20554 | int SCVTF_float_int(context *ctx, Instruction *instr) |
| 20555 | { |
| 20556 | int rc = DECODE_STATUS_UNMATCHED; |
| 20557 | /* class iclass_float */ |
| 20558 | /* sf=x|0|S=0|11110|ftype=xx|1|rmode=00|opcode=010|000000|Rn=xxxxx|Rd=xxxxx */ |
| 20559 | if((INSWORD & 0x7F3FFC00)==0x1E220000) { |
| 20560 | decode_fields32(ENC_SCVTF_H32_FLOAT2INT, ctx, instr); |
| 20561 | ctx->d = UINT(ctx->Rd); |
| 20562 | ctx->n = UINT(ctx->Rn); |
| 20563 | ctx->intsize = (ctx->sf==1) ? 0x40 : 0x20; |
| 20564 | if(!ctx->ftype) { |
| 20565 | ctx->fltsize = 0x20; |
| 20566 | } |
| 20567 | else if(ctx->ftype==1) { |
| 20568 | ctx->fltsize = 0x40; |
| 20569 | } |
| 20570 | else if(ctx->ftype==2) { |
| 20571 | if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)!=13) { |
| 20572 | UNDEFINED; |
| 20573 | } |
| 20574 | ctx->fltsize = 0x80; |
| 20575 | } |
| 20576 | else if(ctx->ftype==3) { |
| 20577 | if(HaveFP16Ext()) { |
| 20578 | ctx->fltsize = 0x10; |
| 20579 | } |
| 20580 | else { |
| 20581 | UNDEFINED; |
| 20582 | } |
| 20583 | } |
| 20584 | if(!(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)&12)) { |
| 20585 | ctx->rounding = FPDecodeRounding(ctx->rmode); |
| 20586 | ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); |
| 20587 | ctx->op = FPConvOp_CVT_FtoI; |
| 20588 | } |
| 20589 | else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==4) { |
| 20590 | ctx->rounding = FPRoundingMode(ctx->FPCR); |
| 20591 | ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); |
| 20592 | ctx->op = FPConvOp_CVT_ItoF; |
| 20593 | } |
| 20594 | else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==8) { |
| 20595 | ctx->rounding = FPRounding_TIEAWAY; |
| 20596 | ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); |
| 20597 | ctx->op = FPConvOp_CVT_FtoI; |
| 20598 | } |
| 20599 | else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==12) { |
| 20600 | if(ctx->fltsize!=0x10 && ctx->fltsize!=ctx->intsize) { |
| 20601 | UNDEFINED; |
| 20602 | } |
| 20603 | if(SLICE(ctx->opcode,0,0)==1) { |
| 20604 | ctx->op = FPConvOp_MOV_ItoF; |
| 20605 | }; |
| 20606 | ctx->part = 0; |
| 20607 | } |
| 20608 | else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==13) { |
| 20609 | if(ctx->intsize!=0x40 || ctx->fltsize!=0x80) { |
| 20610 | UNDEFINED; |
| 20611 | } |
no test coverage detected