Commit 50cfa95cbd6d0ab896530f7af07a4d5e7539ddc0

Authored by edgar_igl
1 parent 5d1d98ec

CRIS: Eliminate a few unneeded moves to/from T0/T1.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4306 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 10 additions and 9 deletions
target-cris/translate.c
@@ -449,11 +449,10 @@ static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest) @@ -449,11 +449,10 @@ static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest)
449 tb = dc->tb; 449 tb = dc->tb;
450 if ((tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK)) { 450 if ((tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK)) {
451 tcg_gen_goto_tb(n); 451 tcg_gen_goto_tb(n);
452 - tcg_gen_movi_tl(cpu_T[0], dest);  
453 - t_gen_mov_env_TN(pc, cpu_T[0]); 452 + tcg_gen_movi_tl(env_pc, dest);
454 tcg_gen_exit_tb((long)tb + n); 453 tcg_gen_exit_tb((long)tb + n);
455 } else { 454 } else {
456 - t_gen_mov_env_TN(pc, cpu_T[0]); 455 + tcg_gen_mov_tl(env_pc, cpu_T[0]);
457 tcg_gen_exit_tb(0); 456 tcg_gen_exit_tb(0);
458 } 457 }
459 } 458 }
@@ -916,6 +915,8 @@ static inline void t_gen_sext(TCGv d, TCGv s, int size) @@ -916,6 +915,8 @@ static inline void t_gen_sext(TCGv d, TCGv s, int size)
916 tcg_gen_ext8s_i32(d, s); 915 tcg_gen_ext8s_i32(d, s);
917 else if (size == 2) 916 else if (size == 2)
918 tcg_gen_ext16s_i32(d, s); 917 tcg_gen_ext16s_i32(d, s);
  918 + else
  919 + tcg_gen_mov_tl(d, s);
919 } 920 }
920 921
921 static inline void t_gen_zext(TCGv d, TCGv s, int size) 922 static inline void t_gen_zext(TCGv d, TCGv s, int size)
@@ -925,6 +926,8 @@ static inline void t_gen_zext(TCGv d, TCGv s, int size) @@ -925,6 +926,8 @@ static inline void t_gen_zext(TCGv d, TCGv s, int size)
925 tcg_gen_andi_i32(d, s, 0xff); 926 tcg_gen_andi_i32(d, s, 0xff);
926 else if (size == 2) 927 else if (size == 2)
927 tcg_gen_andi_i32(d, s, 0xffff); 928 tcg_gen_andi_i32(d, s, 0xffff);
  929 + else
  930 + tcg_gen_mov_tl(d, s);
928 } 931 }
929 932
930 #if DISAS_CRIS 933 #if DISAS_CRIS
@@ -968,11 +971,10 @@ static inline void do_postinc (DisasContext *dc, int size) @@ -968,11 +971,10 @@ static inline void do_postinc (DisasContext *dc, int size)
968 static void dec_prep_move_r(DisasContext *dc, int rs, int rd, 971 static void dec_prep_move_r(DisasContext *dc, int rs, int rd,
969 int size, int s_ext) 972 int size, int s_ext)
970 { 973 {
971 - t_gen_mov_TN_reg(cpu_T[1], rs);  
972 if (s_ext) 974 if (s_ext)
973 - t_gen_sext(cpu_T[1], cpu_T[1], size); 975 + t_gen_sext(cpu_T[1], cpu_R[rs], size);
974 else 976 else
975 - t_gen_zext(cpu_T[1], cpu_T[1], size); 977 + t_gen_zext(cpu_T[1], cpu_R[rs], size);
976 } 978 }
977 979
978 /* Prepare T0 and T1 for a register alu operation. 980 /* Prepare T0 and T1 for a register alu operation.
@@ -983,11 +985,10 @@ static void dec_prep_alu_r(DisasContext *dc, int rs, int rd, @@ -983,11 +985,10 @@ static void dec_prep_alu_r(DisasContext *dc, int rs, int rd,
983 { 985 {
984 dec_prep_move_r(dc, rs, rd, size, s_ext); 986 dec_prep_move_r(dc, rs, rd, size, s_ext);
985 987
986 - t_gen_mov_TN_reg(cpu_T[0], rd);  
987 if (s_ext) 988 if (s_ext)
988 - t_gen_sext(cpu_T[0], cpu_T[0], size); 989 + t_gen_sext(cpu_T[0], cpu_R[rd], size);
989 else 990 else
990 - t_gen_zext(cpu_T[0], cpu_T[0], size); 991 + t_gen_zext(cpu_T[0], cpu_R[rd], size);
991 } 992 }
992 993
993 /* Prepare T0 and T1 for a memory + alu operation. 994 /* Prepare T0 and T1 for a memory + alu operation.