Commit b3249f630e95f3235da438ee1a6cd1b867084e9c
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
Showing
5 changed files
with
167 additions
and
266 deletions
target-alpha/helper.h
... | ... | @@ -9,3 +9,21 @@ DEF_HELPER(uint64_t, helper_amask, (uint64_t)) |
9 | 9 | DEF_HELPER(uint64_t, helper_ctpop, (uint64_t)) |
10 | 10 | DEF_HELPER(uint64_t, helper_ctlz, (uint64_t)) |
11 | 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 | 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 | 246 | /* Tests */ |
386 | 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 | 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 | 333 | void helper_cmpbge (void) | ... | ... |
target-alpha/op_helper.h
... | ... | @@ -33,29 +33,6 @@ void helper_subqv (void); |
33 | 33 | void helper_sublv (void); |
34 | 34 | void helper_mullv (void); |
35 | 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 | 36 | void helper_cmpbge (void); |
60 | 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 | 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 | 558 | static always_inline int translate_one (DisasContext *ctx, uint32_t insn) |
472 | 559 | { |
473 | 560 | uint32_t palcode; |
... | ... | @@ -1101,51 +1188,51 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn) |
1101 | 1188 | switch (fn7) { |
1102 | 1189 | case 0x02: |
1103 | 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 | 1192 | break; |
1106 | 1193 | case 0x06: |
1107 | 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 | 1196 | break; |
1110 | 1197 | case 0x0B: |
1111 | 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 | 1200 | break; |
1114 | 1201 | case 0x12: |
1115 | 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 | 1204 | break; |
1118 | 1205 | case 0x16: |
1119 | 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 | 1208 | break; |
1122 | 1209 | case 0x1B: |
1123 | 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 | 1212 | break; |
1126 | 1213 | case 0x22: |
1127 | 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 | 1216 | break; |
1130 | 1217 | case 0x26: |
1131 | 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 | 1220 | break; |
1134 | 1221 | case 0x2B: |
1135 | 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 | 1224 | break; |
1138 | 1225 | case 0x30: |
1139 | 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 | 1228 | break; |
1142 | 1229 | case 0x31: |
1143 | 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 | 1232 | break; |
1146 | 1233 | case 0x32: |
1147 | 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 | 1236 | break; |
1150 | 1237 | case 0x34: |
1151 | 1238 | /* SRL */ |
... | ... | @@ -1166,7 +1253,7 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn) |
1166 | 1253 | break; |
1167 | 1254 | case 0x36: |
1168 | 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 | 1257 | break; |
1171 | 1258 | case 0x39: |
1172 | 1259 | /* SLL */ |
... | ... | @@ -1187,7 +1274,7 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn) |
1187 | 1274 | break; |
1188 | 1275 | case 0x3B: |
1189 | 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 | 1278 | break; |
1192 | 1279 | case 0x3C: |
1193 | 1280 | /* SRA */ |
... | ... | @@ -1208,39 +1295,39 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn) |
1208 | 1295 | break; |
1209 | 1296 | case 0x52: |
1210 | 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 | 1299 | break; |
1213 | 1300 | case 0x57: |
1214 | 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 | 1303 | break; |
1217 | 1304 | case 0x5A: |
1218 | 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 | 1307 | break; |
1221 | 1308 | case 0x62: |
1222 | 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 | 1311 | break; |
1225 | 1312 | case 0x67: |
1226 | 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 | 1315 | break; |
1229 | 1316 | case 0x6A: |
1230 | 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 | 1319 | break; |
1233 | 1320 | case 0x72: |
1234 | 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 | 1323 | break; |
1237 | 1324 | case 0x77: |
1238 | 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 | 1327 | break; |
1241 | 1328 | case 0x7A: |
1242 | 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 | 1331 | break; |
1245 | 1332 | default: |
1246 | 1333 | goto invalid_opc; | ... | ... |