Commit b3249f630e95f3235da438ee1a6cd1b867084e9c

Authored by aurel32
1 parent 9c29504e

target-alpha: convert byte manipulation instructions to TCG

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5246 c046a42c-6fe2-441c-8c8c-71466251a162
target-alpha/helper.h
@@ -9,3 +9,21 @@ DEF_HELPER(uint64_t, helper_amask, (uint64_t)) @@ -9,3 +9,21 @@ DEF_HELPER(uint64_t, helper_amask, (uint64_t))
9 DEF_HELPER(uint64_t, helper_ctpop, (uint64_t)) 9 DEF_HELPER(uint64_t, helper_ctpop, (uint64_t))
10 DEF_HELPER(uint64_t, helper_ctlz, (uint64_t)) 10 DEF_HELPER(uint64_t, helper_ctlz, (uint64_t))
11 DEF_HELPER(uint64_t, helper_cttz, (uint64_t)) 11 DEF_HELPER(uint64_t, helper_cttz, (uint64_t))
  12 +
  13 +DEF_HELPER(uint64_t, helper_mskbl, (int64_t, uint64_t))
  14 +DEF_HELPER(uint64_t, helper_insbl, (int64_t, uint64_t))
  15 +DEF_HELPER(uint64_t, helper_mskwl, (int64_t, uint64_t))
  16 +DEF_HELPER(uint64_t, helper_inswl, (int64_t, uint64_t))
  17 +DEF_HELPER(uint64_t, helper_mskll, (int64_t, uint64_t))
  18 +DEF_HELPER(uint64_t, helper_insll, (int64_t, uint64_t))
  19 +DEF_HELPER(uint64_t, helper_zap, (int64_t, uint64_t))
  20 +DEF_HELPER(uint64_t, helper_zapnot, (int64_t, uint64_t))
  21 +DEF_HELPER(uint64_t, helper_mskql, (int64_t, uint64_t))
  22 +DEF_HELPER(uint64_t, helper_insql, (int64_t, uint64_t))
  23 +DEF_HELPER(uint64_t, helper_mskwh, (int64_t, uint64_t))
  24 +DEF_HELPER(uint64_t, helper_inswh, (int64_t, uint64_t))
  25 +DEF_HELPER(uint64_t, helper_msklh, (int64_t, uint64_t))
  26 +DEF_HELPER(uint64_t, helper_inslh, (int64_t, uint64_t))
  27 +DEF_HELPER(uint64_t, helper_mskqh, (int64_t, uint64_t))
  28 +DEF_HELPER(uint64_t, helper_insqh, (int64_t, uint64_t))
  29 +
target-alpha/op.c
@@ -243,145 +243,6 @@ void OPPROTO op_umulh (void) @@ -243,145 +243,6 @@ void OPPROTO op_umulh (void)
243 RETURN(); 243 RETURN();
244 } 244 }
245 245
246 -/* Logical */  
247 -void OPPROTO op_mskbl (void)  
248 -{  
249 - helper_mskbl();  
250 - RETURN();  
251 -}  
252 -  
253 -void OPPROTO op_extbl (void)  
254 -{  
255 - helper_extbl();  
256 - RETURN();  
257 -}  
258 -  
259 -void OPPROTO op_insbl (void)  
260 -{  
261 - helper_insbl();  
262 - RETURN();  
263 -}  
264 -  
265 -void OPPROTO op_mskwl (void)  
266 -{  
267 - helper_mskwl();  
268 - RETURN();  
269 -}  
270 -  
271 -void OPPROTO op_extwl (void)  
272 -{  
273 - helper_extwl();  
274 - RETURN();  
275 -}  
276 -  
277 -void OPPROTO op_inswl (void)  
278 -{  
279 - helper_inswl();  
280 - RETURN();  
281 -}  
282 -  
283 -void OPPROTO op_mskll (void)  
284 -{  
285 - helper_mskll();  
286 - RETURN();  
287 -}  
288 -  
289 -void OPPROTO op_extll (void)  
290 -{  
291 - helper_extll();  
292 - RETURN();  
293 -}  
294 -  
295 -void OPPROTO op_insll (void)  
296 -{  
297 - helper_insll();  
298 - RETURN();  
299 -}  
300 -  
301 -void OPPROTO op_zap (void)  
302 -{  
303 - helper_zap();  
304 - RETURN();  
305 -}  
306 -  
307 -void OPPROTO op_zapnot (void)  
308 -{  
309 - helper_zapnot();  
310 - RETURN();  
311 -}  
312 -  
313 -void OPPROTO op_mskql (void)  
314 -{  
315 - helper_mskql();  
316 - RETURN();  
317 -}  
318 -  
319 -void OPPROTO op_extql (void)  
320 -{  
321 - helper_extql();  
322 - RETURN();  
323 -}  
324 -  
325 -void OPPROTO op_insql (void)  
326 -{  
327 - helper_insql();  
328 - RETURN();  
329 -}  
330 -  
331 -void OPPROTO op_mskwh (void)  
332 -{  
333 - helper_mskwh();  
334 - RETURN();  
335 -}  
336 -  
337 -void OPPROTO op_inswh (void)  
338 -{  
339 - helper_inswh();  
340 - RETURN();  
341 -}  
342 -  
343 -void OPPROTO op_extwh (void)  
344 -{  
345 - helper_extwh();  
346 - RETURN();  
347 -}  
348 -  
349 -void OPPROTO op_msklh (void)  
350 -{  
351 - helper_msklh();  
352 - RETURN();  
353 -}  
354 -  
355 -void OPPROTO op_inslh (void)  
356 -{  
357 - helper_inslh();  
358 - RETURN();  
359 -}  
360 -  
361 -void OPPROTO op_extlh (void)  
362 -{  
363 - helper_extlh();  
364 - RETURN();  
365 -}  
366 -  
367 -void OPPROTO op_mskqh (void)  
368 -{  
369 - helper_mskqh();  
370 - RETURN();  
371 -}  
372 -  
373 -void OPPROTO op_insqh (void)  
374 -{  
375 - helper_insqh();  
376 - RETURN();  
377 -}  
378 -  
379 -void OPPROTO op_extqh (void)  
380 -{  
381 - helper_extqh();  
382 - RETURN();  
383 -}  
384 -  
385 /* Tests */ 246 /* Tests */
386 void OPPROTO op_cmpult (void) 247 void OPPROTO op_cmpult (void)
387 { 248 {
target-alpha/op_helper.c
@@ -243,133 +243,91 @@ static always_inline uint64_t byte_zap (uint64_t op, uint8_t mskb) @@ -243,133 +243,91 @@ static always_inline uint64_t byte_zap (uint64_t op, uint8_t mskb)
243 return op & ~mask; 243 return op & ~mask;
244 } 244 }
245 245
246 -void helper_mskbl (void) 246 +uint64_t helper_mskbl(uint64_t val, uint64_t mask)
247 { 247 {
248 - T0 = byte_zap(T0, 0x01 << (T1 & 7)); 248 + return byte_zap(val, 0x01 << (mask & 7));
249 } 249 }
250 250
251 -void helper_extbl (void) 251 +uint64_t helper_insbl(uint64_t val, uint64_t mask)
252 { 252 {
253 - T0 >>= (T1 & 7) * 8;  
254 - T0 = byte_zap(T0, 0xFE); 253 + val <<= (mask & 7) * 8;
  254 + return byte_zap(val, ~(0x01 << (mask & 7)));
255 } 255 }
256 256
257 -void helper_insbl (void) 257 +uint64_t helper_mskwl(uint64_t val, uint64_t mask)
258 { 258 {
259 - T0 <<= (T1 & 7) * 8;  
260 - T0 = byte_zap(T0, ~(0x01 << (T1 & 7))); 259 + return byte_zap(val, 0x03 << (mask & 7));
261 } 260 }
262 261
263 -void helper_mskwl (void) 262 +uint64_t helper_inswl(uint64_t val, uint64_t mask)
264 { 263 {
265 - T0 = byte_zap(T0, 0x03 << (T1 & 7)); 264 + val <<= (mask & 7) * 8;
  265 + return byte_zap(val, ~(0x03 << (mask & 7)));
266 } 266 }
267 267
268 -void helper_extwl (void) 268 +uint64_t helper_mskll(uint64_t val, uint64_t mask)
269 { 269 {
270 - T0 >>= (T1 & 7) * 8;  
271 - T0 = byte_zap(T0, 0xFC); 270 + return byte_zap(val, 0x0F << (mask & 7));
272 } 271 }
273 272
274 -void helper_inswl (void) 273 +uint64_t helper_insll(uint64_t val, uint64_t mask)
275 { 274 {
276 - T0 <<= (T1 & 7) * 8;  
277 - T0 = byte_zap(T0, ~(0x03 << (T1 & 7))); 275 + val <<= (mask & 7) * 8;
  276 + return byte_zap(val, ~(0x0F << (mask & 7)));
278 } 277 }
279 278
280 -void helper_mskll (void) 279 +uint64_t helper_zap(uint64_t val, uint64_t mask)
281 { 280 {
282 - T0 = byte_zap(T0, 0x0F << (T1 & 7)); 281 + return byte_zap(val, mask);
283 } 282 }
284 283
285 -void helper_extll (void) 284 +uint64_t helper_zapnot(uint64_t val, uint64_t mask)
286 { 285 {
287 - T0 >>= (T1 & 7) * 8;  
288 - T0 = byte_zap(T0, 0xF0); 286 + return byte_zap(val, ~mask);
289 } 287 }
290 288
291 -void helper_insll (void) 289 +uint64_t helper_mskql(uint64_t val, uint64_t mask)
292 { 290 {
293 - T0 <<= (T1 & 7) * 8;  
294 - T0 = byte_zap(T0, ~(0x0F << (T1 & 7))); 291 + return byte_zap(val, 0xFF << (mask & 7));
295 } 292 }
296 293
297 -void helper_zap (void) 294 +uint64_t helper_insql(uint64_t val, uint64_t mask)
298 { 295 {
299 - T0 = byte_zap(T0, T1); 296 + val <<= (mask & 7) * 8;
  297 + return byte_zap(val, ~(0xFF << (mask & 7)));
300 } 298 }
301 299
302 -void helper_zapnot (void) 300 +uint64_t helper_mskwh(uint64_t val, uint64_t mask)
303 { 301 {
304 - T0 = byte_zap(T0, ~T1); 302 + return byte_zap(val, (0x03 << (mask & 7)) >> 8);
305 } 303 }
306 304
307 -void helper_mskql (void) 305 +uint64_t helper_inswh(uint64_t val, uint64_t mask)
308 { 306 {
309 - T0 = byte_zap(T0, 0xFF << (T1 & 7)); 307 + val >>= 64 - ((mask & 7) * 8);
  308 + return byte_zap(val, ~((0x03 << (mask & 7)) >> 8));
310 } 309 }
311 310
312 -void helper_extql (void) 311 +uint64_t helper_msklh(uint64_t val, uint64_t mask)
313 { 312 {
314 - T0 >>= (T1 & 7) * 8;  
315 - T0 = byte_zap(T0, 0x00); 313 + return byte_zap(val, (0x0F << (mask & 7)) >> 8);
316 } 314 }
317 315
318 -void helper_insql (void) 316 +uint64_t helper_inslh(uint64_t val, uint64_t mask)
319 { 317 {
320 - T0 <<= (T1 & 7) * 8;  
321 - T0 = byte_zap(T0, ~(0xFF << (T1 & 7))); 318 + val >>= 64 - ((mask & 7) * 8);
  319 + return byte_zap(val, ~((0x0F << (mask & 7)) >> 8));
322 } 320 }
323 321
324 -void helper_mskwh (void) 322 +uint64_t helper_mskqh(uint64_t val, uint64_t mask)
325 { 323 {
326 - T0 = byte_zap(T0, (0x03 << (T1 & 7)) >> 8); 324 + return byte_zap(val, (0xFF << (mask & 7)) >> 8);
327 } 325 }
328 326
329 -void helper_inswh (void) 327 +uint64_t helper_insqh(uint64_t val, uint64_t mask)
330 { 328 {
331 - T0 >>= 64 - ((T1 & 7) * 8);  
332 - T0 = byte_zap(T0, ~((0x03 << (T1 & 7)) >> 8));  
333 -}  
334 -  
335 -void helper_extwh (void)  
336 -{  
337 - T0 <<= 64 - ((T1 & 7) * 8);  
338 - T0 = byte_zap(T0, ~0x07);  
339 -}  
340 -  
341 -void helper_msklh (void)  
342 -{  
343 - T0 = byte_zap(T0, (0x0F << (T1 & 7)) >> 8);  
344 -}  
345 -  
346 -void helper_inslh (void)  
347 -{  
348 - T0 >>= 64 - ((T1 & 7) * 8);  
349 - T0 = byte_zap(T0, ~((0x0F << (T1 & 7)) >> 8));  
350 -}  
351 -  
352 -void helper_extlh (void)  
353 -{  
354 - T0 <<= 64 - ((T1 & 7) * 8);  
355 - T0 = byte_zap(T0, ~0x0F);  
356 -}  
357 -  
358 -void helper_mskqh (void)  
359 -{  
360 - T0 = byte_zap(T0, (0xFF << (T1 & 7)) >> 8);  
361 -}  
362 -  
363 -void helper_insqh (void)  
364 -{  
365 - T0 >>= 64 - ((T1 & 7) * 8);  
366 - T0 = byte_zap(T0, ~((0xFF << (T1 & 7)) >> 8));  
367 -}  
368 -  
369 -void helper_extqh (void)  
370 -{  
371 - T0 <<= 64 - ((T1 & 7) * 8);  
372 - T0 = byte_zap(T0, 0x00); 329 + val >>= 64 - ((mask & 7) * 8);
  330 + return byte_zap(val, ~((0xFF << (mask & 7)) >> 8));
373 } 331 }
374 332
375 void helper_cmpbge (void) 333 void helper_cmpbge (void)
target-alpha/op_helper.h
@@ -33,29 +33,6 @@ void helper_subqv (void); @@ -33,29 +33,6 @@ void helper_subqv (void);
33 void helper_sublv (void); 33 void helper_sublv (void);
34 void helper_mullv (void); 34 void helper_mullv (void);
35 void helper_mulqv (void); 35 void helper_mulqv (void);
36 -void helper_mskbl (void);  
37 -void helper_extbl (void);  
38 -void helper_insbl (void);  
39 -void helper_mskwl (void);  
40 -void helper_extwl (void);  
41 -void helper_inswl (void);  
42 -void helper_mskll (void);  
43 -void helper_extll (void);  
44 -void helper_insll (void);  
45 -void helper_zap (void);  
46 -void helper_zapnot (void);  
47 -void helper_mskql (void);  
48 -void helper_extql (void);  
49 -void helper_insql (void);  
50 -void helper_mskwh (void);  
51 -void helper_inswh (void);  
52 -void helper_extwh (void);  
53 -void helper_msklh (void);  
54 -void helper_inslh (void);  
55 -void helper_extlh (void);  
56 -void helper_mskqh (void);  
57 -void helper_insqh (void);  
58 -void helper_extqh (void);  
59 void helper_cmpbge (void); 36 void helper_cmpbge (void);
60 void helper_cmov_fir (int freg); 37 void helper_cmov_fir (int freg);
61 38
target-alpha/translate.c
@@ -468,6 +468,93 @@ static always_inline void gen_itf (DisasContext *ctx, @@ -468,6 +468,93 @@ static always_inline void gen_itf (DisasContext *ctx,
468 gen_store_fir(ctx, rc, 0); 468 gen_store_fir(ctx, rc, 0);
469 } 469 }
470 470
  471 +/* EXTWH, EXTWH, EXTLH, EXTQH */
  472 +static always_inline void gen_ext_h(void (*tcg_gen_ext_i64)(TCGv t0, TCGv t1),
  473 + int ra, int rb, int rc,
  474 + int islit, int8_t lit)
  475 +{
  476 + if (unlikely(rc == 31))
  477 + return;
  478 +
  479 + if (ra != 31) {
  480 + if (islit)
  481 + tcg_gen_shli_i64(cpu_ir[rc], cpu_ir[ra], 64 - ((lit & 7) * 8));
  482 + else if (rb != 31) {
  483 + TCGv tmp1, tmp2;
  484 + tmp1 = tcg_temp_new(TCG_TYPE_I64);
  485 + tcg_gen_andi_i64(tmp1, cpu_ir[rb], 7);
  486 + tcg_gen_shli_i64(tmp1, tmp1, 3);
  487 + tmp2 = tcg_const_i64(64);
  488 + tcg_gen_sub_i64(tmp1, tmp2, tmp1);
  489 + tcg_temp_free(tmp2);
  490 + if (tcg_gen_ext_i64) {
  491 + tcg_gen_shl_i64(tmp1, cpu_ir[ra], tmp1);
  492 + tcg_gen_ext_i64(cpu_ir[rc], tmp1);
  493 + } else
  494 + tcg_gen_shl_i64(cpu_ir[rc], cpu_ir[ra], tmp1);
  495 + tcg_temp_free(tmp1);
  496 + } else
  497 + tcg_gen_mov_i64(cpu_ir[rc], cpu_ir[ra]);
  498 + } else
  499 + tcg_gen_movi_i64(cpu_ir[rc], 0);
  500 +}
  501 +
  502 +/* EXTBL, EXTWL, EXTWL, EXTLL, EXTQL */
  503 +static always_inline void gen_ext_l(void (*tcg_gen_ext_i64)(TCGv t0, TCGv t1),
  504 + int ra, int rb, int rc,
  505 + int islit, int8_t lit)
  506 +{
  507 + if (unlikely(rc == 31))
  508 + return;
  509 +
  510 + if (ra != 31) {
  511 + if (islit)
  512 + tcg_gen_shri_i64(cpu_ir[rc], cpu_ir[ra], (lit & 7) * 8);
  513 + else if (rb != 31) {
  514 + TCGv tmp = tcg_temp_new(TCG_TYPE_I64);
  515 + tcg_gen_andi_i64(tmp, cpu_ir[rb], 7);
  516 + tcg_gen_shli_i64(tmp, tmp, 3);
  517 + if (tcg_gen_ext_i64) {
  518 + tcg_gen_shr_i64(tmp, cpu_ir[ra], tmp);
  519 + tcg_gen_ext_i64(cpu_ir[rc], tmp);
  520 + } else
  521 + tcg_gen_shr_i64(cpu_ir[rc], cpu_ir[ra], tmp);
  522 + tcg_temp_free(tmp);
  523 + } else
  524 + tcg_gen_mov_i64(cpu_ir[rc], cpu_ir[ra]);
  525 + } else
  526 + tcg_gen_movi_i64(cpu_ir[rc], 0);
  527 +}
  528 +
  529 +/* Code to call byte manipulation helpers, used by:
  530 + INSWH, INSLH, INSQH, INSBL, INSWL, INSLL, INSQL,
  531 + MSKWH, MSKLH, MSKQH, MSKBL, MSKWL, MSKLL, MSKQL,
  532 + ZAP, ZAPNOT
  533 +
  534 + WARNING: it assumes that when ra31 is used, the result is 0.
  535 +*/
  536 +static always_inline void gen_byte_manipulation(void *helper,
  537 + int ra, int rb, int rc,
  538 + int islit, uint8_t lit)
  539 +{
  540 + if (unlikely(rc == 31))
  541 + return;
  542 +
  543 + if (ra != 31) {
  544 + if (islit || rb == 31) {
  545 + TCGv tmp = tcg_temp_new(TCG_TYPE_I64);
  546 + if (islit)
  547 + tcg_gen_movi_i64(tmp, lit);
  548 + else
  549 + tcg_gen_movi_i64(tmp, 0);
  550 + tcg_gen_helper_1_2(helper, cpu_ir[rc], cpu_ir[ra], tmp);
  551 + tcg_temp_free(tmp);
  552 + } else
  553 + tcg_gen_helper_1_2(helper, cpu_ir[rc], cpu_ir[ra], cpu_ir[rb]);
  554 + } else
  555 + tcg_gen_movi_i64(cpu_ir[rc], 0);
  556 +}
  557 +
471 static always_inline int translate_one (DisasContext *ctx, uint32_t insn) 558 static always_inline int translate_one (DisasContext *ctx, uint32_t insn)
472 { 559 {
473 uint32_t palcode; 560 uint32_t palcode;
@@ -1101,51 +1188,51 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn) @@ -1101,51 +1188,51 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn)
1101 switch (fn7) { 1188 switch (fn7) {
1102 case 0x02: 1189 case 0x02:
1103 /* MSKBL */ 1190 /* MSKBL */
1104 - gen_arith3(ctx, &gen_op_mskbl, ra, rb, rc, islit, lit); 1191 + gen_byte_manipulation(helper_mskbl, ra, rb, rc, islit, lit);
1105 break; 1192 break;
1106 case 0x06: 1193 case 0x06:
1107 /* EXTBL */ 1194 /* EXTBL */
1108 - gen_arith3(ctx, &gen_op_extbl, ra, rb, rc, islit, lit); 1195 + gen_ext_l(&tcg_gen_ext8u_i64, ra, rb, rc, islit, lit);
1109 break; 1196 break;
1110 case 0x0B: 1197 case 0x0B:
1111 /* INSBL */ 1198 /* INSBL */
1112 - gen_arith3(ctx, &gen_op_insbl, ra, rb, rc, islit, lit); 1199 + gen_byte_manipulation(helper_insbl, ra, rb, rc, islit, lit);
1113 break; 1200 break;
1114 case 0x12: 1201 case 0x12:
1115 /* MSKWL */ 1202 /* MSKWL */
1116 - gen_arith3(ctx, &gen_op_mskwl, ra, rb, rc, islit, lit); 1203 + gen_byte_manipulation(helper_mskwl, ra, rb, rc, islit, lit);
1117 break; 1204 break;
1118 case 0x16: 1205 case 0x16:
1119 /* EXTWL */ 1206 /* EXTWL */
1120 - gen_arith3(ctx, &gen_op_extwl, ra, rb, rc, islit, lit); 1207 + gen_ext_l(&tcg_gen_ext16u_i64, ra, rb, rc, islit, lit);
1121 break; 1208 break;
1122 case 0x1B: 1209 case 0x1B:
1123 /* INSWL */ 1210 /* INSWL */
1124 - gen_arith3(ctx, &gen_op_inswl, ra, rb, rc, islit, lit); 1211 + gen_byte_manipulation(helper_inswl, ra, rb, rc, islit, lit);
1125 break; 1212 break;
1126 case 0x22: 1213 case 0x22:
1127 /* MSKLL */ 1214 /* MSKLL */
1128 - gen_arith3(ctx, &gen_op_mskll, ra, rb, rc, islit, lit); 1215 + gen_byte_manipulation(helper_mskll, ra, rb, rc, islit, lit);
1129 break; 1216 break;
1130 case 0x26: 1217 case 0x26:
1131 /* EXTLL */ 1218 /* EXTLL */
1132 - gen_arith3(ctx, &gen_op_extll, ra, rb, rc, islit, lit); 1219 + gen_ext_l(&tcg_gen_ext32u_i64, ra, rb, rc, islit, lit);
1133 break; 1220 break;
1134 case 0x2B: 1221 case 0x2B:
1135 /* INSLL */ 1222 /* INSLL */
1136 - gen_arith3(ctx, &gen_op_insll, ra, rb, rc, islit, lit); 1223 + gen_byte_manipulation(helper_insll, ra, rb, rc, islit, lit);
1137 break; 1224 break;
1138 case 0x30: 1225 case 0x30:
1139 /* ZAP */ 1226 /* ZAP */
1140 - gen_arith3(ctx, &gen_op_zap, ra, rb, rc, islit, lit); 1227 + gen_byte_manipulation(helper_zap, ra, rb, rc, islit, lit);
1141 break; 1228 break;
1142 case 0x31: 1229 case 0x31:
1143 /* ZAPNOT */ 1230 /* ZAPNOT */
1144 - gen_arith3(ctx, &gen_op_zapnot, ra, rb, rc, islit, lit); 1231 + gen_byte_manipulation(helper_zapnot, ra, rb, rc, islit, lit);
1145 break; 1232 break;
1146 case 0x32: 1233 case 0x32:
1147 /* MSKQL */ 1234 /* MSKQL */
1148 - gen_arith3(ctx, &gen_op_mskql, ra, rb, rc, islit, lit); 1235 + gen_byte_manipulation(helper_mskql, ra, rb, rc, islit, lit);
1149 break; 1236 break;
1150 case 0x34: 1237 case 0x34:
1151 /* SRL */ 1238 /* SRL */
@@ -1166,7 +1253,7 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn) @@ -1166,7 +1253,7 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn)
1166 break; 1253 break;
1167 case 0x36: 1254 case 0x36:
1168 /* EXTQL */ 1255 /* EXTQL */
1169 - gen_arith3(ctx, &gen_op_extql, ra, rb, rc, islit, lit); 1256 + gen_ext_l(NULL, ra, rb, rc, islit, lit);
1170 break; 1257 break;
1171 case 0x39: 1258 case 0x39:
1172 /* SLL */ 1259 /* SLL */
@@ -1187,7 +1274,7 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn) @@ -1187,7 +1274,7 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn)
1187 break; 1274 break;
1188 case 0x3B: 1275 case 0x3B:
1189 /* INSQL */ 1276 /* INSQL */
1190 - gen_arith3(ctx, &gen_op_insql, ra, rb, rc, islit, lit); 1277 + gen_byte_manipulation(helper_insql, ra, rb, rc, islit, lit);
1191 break; 1278 break;
1192 case 0x3C: 1279 case 0x3C:
1193 /* SRA */ 1280 /* SRA */
@@ -1208,39 +1295,39 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn) @@ -1208,39 +1295,39 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn)
1208 break; 1295 break;
1209 case 0x52: 1296 case 0x52:
1210 /* MSKWH */ 1297 /* MSKWH */
1211 - gen_arith3(ctx, &gen_op_mskwh, ra, rb, rc, islit, lit); 1298 + gen_byte_manipulation(helper_mskwh, ra, rb, rc, islit, lit);
1212 break; 1299 break;
1213 case 0x57: 1300 case 0x57:
1214 /* INSWH */ 1301 /* INSWH */
1215 - gen_arith3(ctx, &gen_op_inswh, ra, rb, rc, islit, lit); 1302 + gen_byte_manipulation(helper_inswh, ra, rb, rc, islit, lit);
1216 break; 1303 break;
1217 case 0x5A: 1304 case 0x5A:
1218 /* EXTWH */ 1305 /* EXTWH */
1219 - gen_arith3(ctx, &gen_op_extwh, ra, rb, rc, islit, lit); 1306 + gen_ext_h(&tcg_gen_ext16u_i64, ra, rb, rc, islit, lit);
1220 break; 1307 break;
1221 case 0x62: 1308 case 0x62:
1222 /* MSKLH */ 1309 /* MSKLH */
1223 - gen_arith3(ctx, &gen_op_msklh, ra, rb, rc, islit, lit); 1310 + gen_byte_manipulation(helper_msklh, ra, rb, rc, islit, lit);
1224 break; 1311 break;
1225 case 0x67: 1312 case 0x67:
1226 /* INSLH */ 1313 /* INSLH */
1227 - gen_arith3(ctx, &gen_op_inslh, ra, rb, rc, islit, lit); 1314 + gen_byte_manipulation(helper_inslh, ra, rb, rc, islit, lit);
1228 break; 1315 break;
1229 case 0x6A: 1316 case 0x6A:
1230 /* EXTLH */ 1317 /* EXTLH */
1231 - gen_arith3(ctx, &gen_op_extlh, ra, rb, rc, islit, lit); 1318 + gen_ext_h(&tcg_gen_ext16u_i64, ra, rb, rc, islit, lit);
1232 break; 1319 break;
1233 case 0x72: 1320 case 0x72:
1234 /* MSKQH */ 1321 /* MSKQH */
1235 - gen_arith3(ctx, &gen_op_mskqh, ra, rb, rc, islit, lit); 1322 + gen_byte_manipulation(helper_mskqh, ra, rb, rc, islit, lit);
1236 break; 1323 break;
1237 case 0x77: 1324 case 0x77:
1238 /* INSQH */ 1325 /* INSQH */
1239 - gen_arith3(ctx, &gen_op_insqh, ra, rb, rc, islit, lit); 1326 + gen_byte_manipulation(helper_insqh, ra, rb, rc, islit, lit);
1240 break; 1327 break;
1241 case 0x7A: 1328 case 0x7A:
1242 /* EXTQH */ 1329 /* EXTQH */
1243 - gen_arith3(ctx, &gen_op_extqh, ra, rb, rc, islit, lit); 1330 + gen_ext_h(NULL, ra, rb, rc, islit, lit);
1244 break; 1331 break;
1245 default: 1332 default:
1246 goto invalid_opc; 1333 goto invalid_opc;