Commit cb2c9921f851b5cb54c188106800331ab172ba78

Authored by ths
1 parent 28de16da

Use concet TCG instructions in the MIPS target.

Signed-off-by: Thiemo Seufer <ths@networkno.de>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5303 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 4 additions and 24 deletions
target-mips/translate.c
@@ -2129,7 +2129,6 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc, @@ -2129,7 +2129,6 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc,
2129 { 2129 {
2130 TCGv r_tmp1 = tcg_temp_new(TCG_TYPE_I64); 2130 TCGv r_tmp1 = tcg_temp_new(TCG_TYPE_I64);
2131 TCGv r_tmp2 = tcg_temp_new(TCG_TYPE_I64); 2131 TCGv r_tmp2 = tcg_temp_new(TCG_TYPE_I64);
2132 - TCGv r_tmp3 = tcg_temp_new(TCG_TYPE_I64);  
2133 2132
2134 tcg_gen_ext32s_tl(t0, t0); 2133 tcg_gen_ext32s_tl(t0, t0);
2135 tcg_gen_ext32s_tl(t1, t1); 2134 tcg_gen_ext32s_tl(t1, t1);
@@ -2138,11 +2137,7 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc, @@ -2138,11 +2137,7 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc,
2138 tcg_gen_mul_i64(r_tmp1, r_tmp1, r_tmp2); 2137 tcg_gen_mul_i64(r_tmp1, r_tmp1, r_tmp2);
2139 gen_load_LO(t0, 0); 2138 gen_load_LO(t0, 0);
2140 gen_load_HI(t1, 0); 2139 gen_load_HI(t1, 0);
2141 - tcg_gen_extu_tl_i64(r_tmp2, t0);  
2142 - tcg_gen_extu_tl_i64(r_tmp3, t1);  
2143 - tcg_gen_shli_i64(r_tmp3, r_tmp3, 32);  
2144 - tcg_gen_or_i64(r_tmp2, r_tmp2, r_tmp3);  
2145 - tcg_temp_free(r_tmp3); 2140 + tcg_gen_concat_tl_i64(r_tmp2, t0, t1);
2146 tcg_gen_add_i64(r_tmp1, r_tmp1, r_tmp2); 2141 tcg_gen_add_i64(r_tmp1, r_tmp1, r_tmp2);
2147 tcg_temp_free(r_tmp2); 2142 tcg_temp_free(r_tmp2);
2148 tcg_gen_trunc_i64_tl(t0, r_tmp1); 2143 tcg_gen_trunc_i64_tl(t0, r_tmp1);
@@ -2160,7 +2155,6 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc, @@ -2160,7 +2155,6 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc,
2160 { 2155 {
2161 TCGv r_tmp1 = tcg_temp_new(TCG_TYPE_I64); 2156 TCGv r_tmp1 = tcg_temp_new(TCG_TYPE_I64);
2162 TCGv r_tmp2 = tcg_temp_new(TCG_TYPE_I64); 2157 TCGv r_tmp2 = tcg_temp_new(TCG_TYPE_I64);
2163 - TCGv r_tmp3 = tcg_temp_new(TCG_TYPE_I64);  
2164 2158
2165 tcg_gen_ext32u_tl(t0, t0); 2159 tcg_gen_ext32u_tl(t0, t0);
2166 tcg_gen_ext32u_tl(t1, t1); 2160 tcg_gen_ext32u_tl(t1, t1);
@@ -2169,11 +2163,7 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc, @@ -2169,11 +2163,7 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc,
2169 tcg_gen_mul_i64(r_tmp1, r_tmp1, r_tmp2); 2163 tcg_gen_mul_i64(r_tmp1, r_tmp1, r_tmp2);
2170 gen_load_LO(t0, 0); 2164 gen_load_LO(t0, 0);
2171 gen_load_HI(t1, 0); 2165 gen_load_HI(t1, 0);
2172 - tcg_gen_extu_tl_i64(r_tmp2, t0);  
2173 - tcg_gen_extu_tl_i64(r_tmp3, t1);  
2174 - tcg_gen_shli_i64(r_tmp3, r_tmp3, 32);  
2175 - tcg_gen_or_i64(r_tmp2, r_tmp2, r_tmp3);  
2176 - tcg_temp_free(r_tmp3); 2166 + tcg_gen_concat_tl_i64(r_tmp2, t0, t1);
2177 tcg_gen_add_i64(r_tmp1, r_tmp1, r_tmp2); 2167 tcg_gen_add_i64(r_tmp1, r_tmp1, r_tmp2);
2178 tcg_temp_free(r_tmp2); 2168 tcg_temp_free(r_tmp2);
2179 tcg_gen_trunc_i64_tl(t0, r_tmp1); 2169 tcg_gen_trunc_i64_tl(t0, r_tmp1);
@@ -2191,7 +2181,6 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc, @@ -2191,7 +2181,6 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc,
2191 { 2181 {
2192 TCGv r_tmp1 = tcg_temp_new(TCG_TYPE_I64); 2182 TCGv r_tmp1 = tcg_temp_new(TCG_TYPE_I64);
2193 TCGv r_tmp2 = tcg_temp_new(TCG_TYPE_I64); 2183 TCGv r_tmp2 = tcg_temp_new(TCG_TYPE_I64);
2194 - TCGv r_tmp3 = tcg_temp_new(TCG_TYPE_I64);  
2195 2184
2196 tcg_gen_ext32s_tl(t0, t0); 2185 tcg_gen_ext32s_tl(t0, t0);
2197 tcg_gen_ext32s_tl(t1, t1); 2186 tcg_gen_ext32s_tl(t1, t1);
@@ -2200,11 +2189,7 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc, @@ -2200,11 +2189,7 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc,
2200 tcg_gen_mul_i64(r_tmp1, r_tmp1, r_tmp2); 2189 tcg_gen_mul_i64(r_tmp1, r_tmp1, r_tmp2);
2201 gen_load_LO(t0, 0); 2190 gen_load_LO(t0, 0);
2202 gen_load_HI(t1, 0); 2191 gen_load_HI(t1, 0);
2203 - tcg_gen_extu_tl_i64(r_tmp2, t0);  
2204 - tcg_gen_extu_tl_i64(r_tmp3, t1);  
2205 - tcg_gen_shli_i64(r_tmp3, r_tmp3, 32);  
2206 - tcg_gen_or_i64(r_tmp2, r_tmp2, r_tmp3);  
2207 - tcg_temp_free(r_tmp3); 2192 + tcg_gen_concat_tl_i64(r_tmp2, t0, t1);
2208 tcg_gen_sub_i64(r_tmp1, r_tmp1, r_tmp2); 2193 tcg_gen_sub_i64(r_tmp1, r_tmp1, r_tmp2);
2209 tcg_temp_free(r_tmp2); 2194 tcg_temp_free(r_tmp2);
2210 tcg_gen_trunc_i64_tl(t0, r_tmp1); 2195 tcg_gen_trunc_i64_tl(t0, r_tmp1);
@@ -2222,7 +2207,6 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc, @@ -2222,7 +2207,6 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc,
2222 { 2207 {
2223 TCGv r_tmp1 = tcg_temp_new(TCG_TYPE_I64); 2208 TCGv r_tmp1 = tcg_temp_new(TCG_TYPE_I64);
2224 TCGv r_tmp2 = tcg_temp_new(TCG_TYPE_I64); 2209 TCGv r_tmp2 = tcg_temp_new(TCG_TYPE_I64);
2225 - TCGv r_tmp3 = tcg_temp_new(TCG_TYPE_I64);  
2226 2210
2227 tcg_gen_ext32u_tl(t0, t0); 2211 tcg_gen_ext32u_tl(t0, t0);
2228 tcg_gen_ext32u_tl(t1, t1); 2212 tcg_gen_ext32u_tl(t1, t1);
@@ -2231,11 +2215,7 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc, @@ -2231,11 +2215,7 @@ static void gen_muldiv (DisasContext *ctx, uint32_t opc,
2231 tcg_gen_mul_i64(r_tmp1, r_tmp1, r_tmp2); 2215 tcg_gen_mul_i64(r_tmp1, r_tmp1, r_tmp2);
2232 gen_load_LO(t0, 0); 2216 gen_load_LO(t0, 0);
2233 gen_load_HI(t1, 0); 2217 gen_load_HI(t1, 0);
2234 - tcg_gen_extu_tl_i64(r_tmp2, t0);  
2235 - tcg_gen_extu_tl_i64(r_tmp3, t1);  
2236 - tcg_gen_shli_i64(r_tmp3, r_tmp3, 32);  
2237 - tcg_gen_or_i64(r_tmp2, r_tmp2, r_tmp3);  
2238 - tcg_temp_free(r_tmp3); 2218 + tcg_gen_concat_tl_i64(r_tmp2, t0, t1);
2239 tcg_gen_sub_i64(r_tmp1, r_tmp1, r_tmp2); 2219 tcg_gen_sub_i64(r_tmp1, r_tmp1, r_tmp2);
2240 tcg_temp_free(r_tmp2); 2220 tcg_temp_free(r_tmp2);
2241 tcg_gen_trunc_i64_tl(t0, r_tmp1); 2221 tcg_gen_trunc_i64_tl(t0, r_tmp1);