Commit 200ae688b21e84f13dcfb4349cf8aaa63dcbe692

Authored by ths
1 parent 08ba7963

TCGify the simplest FP instructions.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4737 c046a42c-6fe2-441c-8c8c-71466251a162
target-mips/op.c
... ... @@ -377,14 +377,6 @@ void op_dmultu (void)
377 377  
378 378 #define FLOAT_OP(name, p) void OPPROTO op_float_##name##_##p(void)
379 379  
380   -FLOAT_OP(cvtps, s)
381   -{
382   - WT2 = WT0;
383   - WTH2 = WT1;
384   - DEBUG_FPU_STATE();
385   - FORCE_RET();
386   -}
387   -
388 380 FLOAT_OP(pll, ps)
389 381 {
390 382 DT2 = ((uint64_t)WT0 << 32) | WT1;
... ... @@ -609,25 +601,6 @@ FLOAT_UNOP(abs)
609 601 FLOAT_UNOP(chs)
610 602 #undef FLOAT_UNOP
611 603  
612   -FLOAT_OP(mov, d)
613   -{
614   - FDT2 = FDT0;
615   - DEBUG_FPU_STATE();
616   - FORCE_RET();
617   -}
618   -FLOAT_OP(mov, s)
619   -{
620   - FST2 = FST0;
621   - DEBUG_FPU_STATE();
622   - FORCE_RET();
623   -}
624   -FLOAT_OP(mov, ps)
625   -{
626   - FST2 = FST0;
627   - FSTH2 = FSTH0;
628   - DEBUG_FPU_STATE();
629   - FORCE_RET();
630   -}
631 604 FLOAT_OP(alnv, ps)
632 605 {
633 606 switch (T0 & 0x7) {
... ...
target-mips/op_mem.c
... ... @@ -267,14 +267,3 @@ void glue(op_sdr, MEMSUFFIX) (void)
267 267 FORCE_RET();
268 268 }
269 269 #endif /* TARGET_MIPS64 */
270   -
271   -void glue(op_luxc1, MEMSUFFIX) (void)
272   -{
273   - DT0 = glue(ldq, MEMSUFFIX)(T0 & ~0x7);
274   - FORCE_RET();
275   -}
276   -void glue(op_suxc1, MEMSUFFIX) (void)
277   -{
278   - glue(stq, MEMSUFFIX)(T0 & ~0x7, DT0);
279   - FORCE_RET();
280   -}
... ...
target-mips/translate.c
... ... @@ -960,8 +960,6 @@ OP_LD_TABLE(wl);
960 960 OP_LD_TABLE(wr);
961 961 OP_ST_TABLE(wl);
962 962 OP_ST_TABLE(wr);
963   -OP_LD_TABLE(uxc1);
964   -OP_ST_TABLE(uxc1);
965 963  
966 964 #define OP_LD(insn,fname) \
967 965 void inline op_ldst_##insn(DisasContext *ctx) \
... ... @@ -5651,8 +5649,7 @@ static void gen_farith (DisasContext *ctx, uint32_t op1,
5651 5649 break;
5652 5650 case FOP(6, 16):
5653 5651 gen_load_fpr32(fpu32_T[0], fs);
5654   - gen_op_float_mov_s();
5655   - gen_store_fpr32(fpu32_T[2], fd);
  5652 + gen_store_fpr32(fpu32_T[0], fd);
5656 5653 opn = "mov.s";
5657 5654 break;
5658 5655 case FOP(7, 16):
... ... @@ -5803,9 +5800,12 @@ static void gen_farith (DisasContext *ctx, uint32_t op1,
5803 5800 break;
5804 5801 case FOP(38, 16):
5805 5802 check_cp1_64bitmode(ctx);
5806   - gen_load_fpr32(fpu32_T[1], fs);
5807   - gen_load_fpr32(fpu32_T[0], ft);
5808   - gen_op_float_cvtps_s();
  5803 + gen_load_fpr32(fpu32_T[0], fs);
  5804 + gen_load_fpr32(fpu32_T[1], ft);
  5805 + tcg_gen_extu_i32_i64(fpu64_T[0], fpu32_T[0]);
  5806 + tcg_gen_extu_i32_i64(fpu64_T[1], fpu32_T[1]);
  5807 + tcg_gen_shli_i64(fpu64_T[1], fpu64_T[1], 32);
  5808 + tcg_gen_or_i64(fpu64_T[2], fpu64_T[0], fpu64_T[1]);
5809 5809 gen_store_fpr64(ctx, fpu64_T[2], fd);
5810 5810 opn = "cvt.ps.s";
5811 5811 break;
... ... @@ -5889,8 +5889,7 @@ static void gen_farith (DisasContext *ctx, uint32_t op1,
5889 5889 case FOP(6, 17):
5890 5890 check_cp1_registers(ctx, fs | fd);
5891 5891 gen_load_fpr64(ctx, fpu64_T[0], fs);
5892   - gen_op_float_mov_d();
5893   - gen_store_fpr64(ctx, fpu64_T[2], fd);
  5892 + gen_store_fpr64(ctx, fpu64_T[0], fd);
5894 5893 opn = "mov.d";
5895 5894 break;
5896 5895 case FOP(7, 17):
... ... @@ -6156,9 +6155,8 @@ static void gen_farith (DisasContext *ctx, uint32_t op1,
6156 6155 check_cp1_64bitmode(ctx);
6157 6156 gen_load_fpr32(fpu32_T[0], fs);
6158 6157 gen_load_fpr32h(fpu32h_T[0], fs);
6159   - gen_op_float_mov_ps();
6160   - gen_store_fpr32(fpu32_T[2], fd);
6161   - gen_store_fpr32h(fpu32h_T[2], fd);
  6158 + gen_store_fpr32(fpu32_T[0], fd);
  6159 + gen_store_fpr32h(fpu32h_T[0], fd);
6162 6160 opn = "mov.ps";
6163 6161 break;
6164 6162 case FOP(7, 22):
... ... @@ -6407,7 +6405,8 @@ static void gen_flt3_ldst (DisasContext *ctx, uint32_t opc,
6407 6405 break;
6408 6406 case OPC_LUXC1:
6409 6407 check_cp1_64bitmode(ctx);
6410   - op_ldst(luxc1);
  6408 + tcg_gen_andi_tl(cpu_T[0], cpu_T[0], ~0x7);
  6409 + tcg_gen_qemu_ld64(fpu64_T[0], cpu_T[0], ctx->mem_idx);
6411 6410 gen_store_fpr64(ctx, fpu64_T[0], fd);
6412 6411 opn = "luxc1";
6413 6412 break;
... ... @@ -6429,7 +6428,8 @@ static void gen_flt3_ldst (DisasContext *ctx, uint32_t opc,
6429 6428 case OPC_SUXC1:
6430 6429 check_cp1_64bitmode(ctx);
6431 6430 gen_load_fpr64(ctx, fpu64_T[0], fs);
6432   - op_ldst(suxc1);
  6431 + tcg_gen_andi_tl(cpu_T[0], cpu_T[0], ~0x7);
  6432 + tcg_gen_qemu_st64(fpu64_T[0], cpu_T[0], ctx->mem_idx);
6433 6433 opn = "suxc1";
6434 6434 store = 1;
6435 6435 break;
... ...