Commit 022a22c7e1c8bc5521c521ab9cbecfa893b610c4

Authored by ths
1 parent e67888a7

Ignore PR flag in FPSCR when performing fmov, by Magnus Damm.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3005 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 7 additions and 38 deletions
target-sh4/translate.c
@@ -648,10 +648,7 @@ void decode_opc(DisasContext * ctx) @@ -648,10 +648,7 @@ void decode_opc(DisasContext * ctx)
648 gen_op_xor_T0_rN(REG(B11_8)); 648 gen_op_xor_T0_rN(REG(B11_8));
649 return; 649 return;
650 case 0xf00c: /* fmov {F,D,X}Rm,{F,D,X}Rn - FPSCR: Nothing */ 650 case 0xf00c: /* fmov {F,D,X}Rm,{F,D,X}Rn - FPSCR: Nothing */
651 - if (ctx->fpscr & FPSCR_PR) {  
652 - gen_op_fmov_drN_DT0(XREG(B7_4));  
653 - gen_op_fmov_DT0_drN(XREG(B11_8));  
654 - } else if (ctx->fpscr & FPSCR_SZ) { 651 + if (ctx->fpscr & FPSCR_SZ) {
655 if (ctx->opcode & 0x0110) 652 if (ctx->opcode & 0x0110)
656 break; /* illegal instruction */ 653 break; /* illegal instruction */
657 gen_op_fmov_drN_DT0(DREG(B7_4)); 654 gen_op_fmov_drN_DT0(DREG(B7_4));
@@ -662,11 +659,7 @@ void decode_opc(DisasContext * ctx) @@ -662,11 +659,7 @@ void decode_opc(DisasContext * ctx)
662 } 659 }
663 return; 660 return;
664 case 0xf00a: /* fmov {F,D,X}Rm,@Rn - FPSCR: Nothing */ 661 case 0xf00a: /* fmov {F,D,X}Rm,@Rn - FPSCR: Nothing */
665 - if (ctx->fpscr & FPSCR_PR) {  
666 - gen_op_fmov_drN_DT0(XREG(B7_4));  
667 - gen_op_movl_rN_T1(REG(B11_8));  
668 - gen_op_stfq_DT0_T1(ctx);  
669 - } else if (ctx->fpscr & FPSCR_SZ) { 662 + if (ctx->fpscr & FPSCR_SZ) {
670 if (ctx->opcode & 0x0010) 663 if (ctx->opcode & 0x0010)
671 break; /* illegal instruction */ 664 break; /* illegal instruction */
672 gen_op_fmov_drN_DT0(DREG(B7_4)); 665 gen_op_fmov_drN_DT0(DREG(B7_4));
@@ -679,11 +672,7 @@ void decode_opc(DisasContext * ctx) @@ -679,11 +672,7 @@ void decode_opc(DisasContext * ctx)
679 } 672 }
680 return; 673 return;
681 case 0xf008: /* fmov @Rm,{F,D,X}Rn - FPSCR: Nothing */ 674 case 0xf008: /* fmov @Rm,{F,D,X}Rn - FPSCR: Nothing */
682 - if (ctx->fpscr & FPSCR_PR) {  
683 - gen_op_movl_rN_T0(REG(B7_4));  
684 - gen_op_ldfq_T0_DT0(ctx);  
685 - gen_op_fmov_DT0_drN(XREG(B11_8));  
686 - } else if (ctx->fpscr & FPSCR_SZ) { 675 + if (ctx->fpscr & FPSCR_SZ) {
687 if (ctx->opcode & 0x0100) 676 if (ctx->opcode & 0x0100)
688 break; /* illegal instruction */ 677 break; /* illegal instruction */
689 gen_op_movl_rN_T0(REG(B7_4)); 678 gen_op_movl_rN_T0(REG(B7_4));
@@ -696,12 +685,7 @@ void decode_opc(DisasContext * ctx) @@ -696,12 +685,7 @@ void decode_opc(DisasContext * ctx)
696 } 685 }
697 return; 686 return;
698 case 0xf009: /* fmov @Rm+,{F,D,X}Rn - FPSCR: Nothing */ 687 case 0xf009: /* fmov @Rm+,{F,D,X}Rn - FPSCR: Nothing */
699 - if (ctx->fpscr & FPSCR_PR) {  
700 - gen_op_movl_rN_T0(REG(B7_4));  
701 - gen_op_ldfq_T0_DT0(ctx);  
702 - gen_op_fmov_DT0_drN(XREG(B11_8));  
703 - gen_op_inc8_rN(REG(B7_4));  
704 - } else if (ctx->fpscr & FPSCR_SZ) { 688 + if (ctx->fpscr & FPSCR_SZ) {
705 if (ctx->opcode & 0x0100) 689 if (ctx->opcode & 0x0100)
706 break; /* illegal instruction */ 690 break; /* illegal instruction */
707 gen_op_movl_rN_T0(REG(B7_4)); 691 gen_op_movl_rN_T0(REG(B7_4));
@@ -716,12 +700,7 @@ void decode_opc(DisasContext * ctx) @@ -716,12 +700,7 @@ void decode_opc(DisasContext * ctx)
716 } 700 }
717 return; 701 return;
718 case 0xf00b: /* fmov {F,D,X}Rm,@-Rn - FPSCR: Nothing */ 702 case 0xf00b: /* fmov {F,D,X}Rm,@-Rn - FPSCR: Nothing */
719 - if (ctx->fpscr & FPSCR_PR) {  
720 - gen_op_dec8_rN(REG(B11_8));  
721 - gen_op_fmov_drN_DT0(XREG(B7_4));  
722 - gen_op_movl_rN_T1(REG(B11_8));  
723 - gen_op_stfq_DT0_T1(ctx);  
724 - } else if (ctx->fpscr & FPSCR_SZ) { 703 + if (ctx->fpscr & FPSCR_SZ) {
725 if (ctx->opcode & 0x0100) 704 if (ctx->opcode & 0x0100)
726 break; /* illegal instruction */ 705 break; /* illegal instruction */
727 gen_op_dec8_rN(REG(B11_8)); 706 gen_op_dec8_rN(REG(B11_8));
@@ -736,12 +715,7 @@ void decode_opc(DisasContext * ctx) @@ -736,12 +715,7 @@ void decode_opc(DisasContext * ctx)
736 } 715 }
737 return; 716 return;
738 case 0xf006: /* fmov @(R0,Rm),{F,D,X}Rm - FPSCR: Nothing */ 717 case 0xf006: /* fmov @(R0,Rm),{F,D,X}Rm - FPSCR: Nothing */
739 - if (ctx->fpscr & FPSCR_PR) {  
740 - gen_op_movl_rN_T0(REG(B7_4));  
741 - gen_op_add_rN_T0(REG(0));  
742 - gen_op_ldfq_T0_DT0(ctx);  
743 - gen_op_fmov_DT0_drN(XREG(B11_8));  
744 - } else if (ctx->fpscr & FPSCR_SZ) { 718 + if (ctx->fpscr & FPSCR_SZ) {
745 if (ctx->opcode & 0x0100) 719 if (ctx->opcode & 0x0100)
746 break; /* illegal instruction */ 720 break; /* illegal instruction */
747 gen_op_movl_rN_T0(REG(B7_4)); 721 gen_op_movl_rN_T0(REG(B7_4));
@@ -756,12 +730,7 @@ void decode_opc(DisasContext * ctx) @@ -756,12 +730,7 @@ void decode_opc(DisasContext * ctx)
756 } 730 }
757 return; 731 return;
758 case 0xf007: /* fmov {F,D,X}Rn,@(R0,Rn) - FPSCR: Nothing */ 732 case 0xf007: /* fmov {F,D,X}Rn,@(R0,Rn) - FPSCR: Nothing */
759 - if (ctx->fpscr & FPSCR_PR) {  
760 - gen_op_fmov_drN_DT0(XREG(B7_4));  
761 - gen_op_movl_rN_T1(REG(B11_8));  
762 - gen_op_add_rN_T1(REG(0));  
763 - gen_op_stfq_DT0_T1(ctx);  
764 - } else if (ctx->fpscr & FPSCR_SZ) { 733 + if (ctx->fpscr & FPSCR_SZ) {
765 if (ctx->opcode & 0x0010) 734 if (ctx->opcode & 0x0010)
766 break; /* illegal instruction */ 735 break; /* illegal instruction */
767 gen_op_fmov_drN_DT0(DREG(B7_4)); 736 gen_op_fmov_drN_DT0(DREG(B7_4));