Commit 5c55ff99fa88158871d5b9f619c485deae5f3d5b
1 parent
2e610050
Replace ELF section hack with normal table
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Showing
2 changed files
with
883 additions
and
923 deletions
target-ppc/translate.c
... | ... | @@ -313,12 +313,10 @@ static always_inline void gen_sync_exception (DisasContext *ctx) |
313 | 313 | } |
314 | 314 | |
315 | 315 | #define GEN_HANDLER(name, opc1, opc2, opc3, inval, type) \ |
316 | -static void gen_##name (DisasContext *ctx); \ | |
317 | -GEN_OPCODE(name, opc1, opc2, opc3, inval, type); | |
316 | +GEN_OPCODE(name, opc1, opc2, opc3, inval, type) | |
318 | 317 | |
319 | 318 | #define GEN_HANDLER2(name, onam, opc1, opc2, opc3, inval, type) \ |
320 | -static void gen_##name (DisasContext *ctx); \ | |
321 | -GEN_OPCODE2(name, onam, opc1, opc2, opc3, inval, type); \ | |
319 | +GEN_OPCODE2(name, onam, opc1, opc2, opc3, inval, type) | |
322 | 320 | |
323 | 321 | typedef struct opcode_t { |
324 | 322 | unsigned char opc1, opc2, opc3; |
... | ... | @@ -456,23 +454,10 @@ static always_inline target_ulong MASK (uint32_t start, uint32_t end) |
456 | 454 | |
457 | 455 | /*****************************************************************************/ |
458 | 456 | /* PowerPC instructions table */ |
459 | -#if HOST_LONG_BITS == 64 | |
460 | -#define OPC_ALIGN 8 | |
461 | -#else | |
462 | -#define OPC_ALIGN 4 | |
463 | -#endif | |
464 | -#if defined(__APPLE__) | |
465 | -#define OPCODES_SECTION \ | |
466 | - __attribute__ ((section("__TEXT,__opcodes"), unused, aligned (OPC_ALIGN) )) | |
467 | -#else | |
468 | -#define OPCODES_SECTION \ | |
469 | - __attribute__ ((section(".opcodes"), unused, aligned (OPC_ALIGN) )) | |
470 | -#endif | |
471 | 457 | |
472 | 458 | #if defined(DO_PPC_STATISTICS) |
473 | 459 | #define GEN_OPCODE(name, op1, op2, op3, invl, _typ) \ |
474 | -extern opcode_t opc_##name; \ | |
475 | -OPCODES_SECTION opcode_t opc_##name = { \ | |
460 | +{ \ | |
476 | 461 | .opc1 = op1, \ |
477 | 462 | .opc2 = op2, \ |
478 | 463 | .opc3 = op3, \ |
... | ... | @@ -486,7 +471,7 @@ OPCODES_SECTION opcode_t opc_##name = { \ |
486 | 471 | .oname = stringify(name), \ |
487 | 472 | } |
488 | 473 | #define GEN_OPCODE2(name, onam, op1, op2, op3, invl, _typ) \ |
489 | -OPCODES_SECTION opcode_t opc_##name = { \ | |
474 | +{ \ | |
490 | 475 | .opc1 = op1, \ |
491 | 476 | .opc2 = op2, \ |
492 | 477 | .opc3 = op3, \ |
... | ... | @@ -501,22 +486,7 @@ OPCODES_SECTION opcode_t opc_##name = { \ |
501 | 486 | } |
502 | 487 | #else |
503 | 488 | #define GEN_OPCODE(name, op1, op2, op3, invl, _typ) \ |
504 | -extern opcode_t opc_##name; \ | |
505 | -OPCODES_SECTION opcode_t opc_##name = { \ | |
506 | - .opc1 = op1, \ | |
507 | - .opc2 = op2, \ | |
508 | - .opc3 = op3, \ | |
509 | - .pad = { 0, }, \ | |
510 | - .handler = { \ | |
511 | - .inval = invl, \ | |
512 | - .type = _typ, \ | |
513 | - .handler = &gen_##name, \ | |
514 | - }, \ | |
515 | - .oname = stringify(name), \ | |
516 | -} | |
517 | -#define GEN_OPCODE2(name, onam, op1, op2, op3, invl, _typ) \ | |
518 | -extern opcode_t opc_##name; \ | |
519 | -OPCODES_SECTION opcode_t opc_##name = { \ | |
489 | +{ \ | |
520 | 490 | .opc1 = op1, \ |
521 | 491 | .opc2 = op2, \ |
522 | 492 | .opc3 = op3, \ |
... | ... | @@ -525,887 +495,34 @@ OPCODES_SECTION opcode_t opc_##name = { \ |
525 | 495 | .inval = invl, \ |
526 | 496 | .type = _typ, \ |
527 | 497 | .handler = &gen_##name, \ |
528 | - }, \ | |
529 | - .oname = onam, \ | |
530 | -} | |
531 | -#endif | |
532 | - | |
533 | -#define GEN_OPCODE_MARK(name) \ | |
534 | -extern opcode_t opc_##name; \ | |
535 | -OPCODES_SECTION opcode_t opc_##name = { \ | |
536 | - .opc1 = 0xFF, \ | |
537 | - .opc2 = 0xFF, \ | |
538 | - .opc3 = 0xFF, \ | |
539 | - .pad = { 0, }, \ | |
540 | - .handler = { \ | |
541 | - .inval = 0x00000000, \ | |
542 | - .type = 0x00, \ | |
543 | - .handler = NULL, \ | |
544 | - }, \ | |
545 | - .oname = stringify(name), \ | |
546 | -} | |
547 | - | |
548 | -/* SPR load/store helpers */ | |
549 | -static always_inline void gen_load_spr(TCGv t, int reg) | |
550 | -{ | |
551 | - tcg_gen_ld_tl(t, cpu_env, offsetof(CPUState, spr[reg])); | |
552 | -} | |
553 | - | |
554 | -static always_inline void gen_store_spr(int reg, TCGv t) | |
555 | -{ | |
556 | - tcg_gen_st_tl(t, cpu_env, offsetof(CPUState, spr[reg])); | |
557 | -} | |
558 | - | |
559 | -/* Start opcode list */ | |
560 | -GEN_OPCODE_MARK(start); | |
561 | -GEN_HANDLER(invalid, 0x00, 0x00, 0x00, 0xFFFFFFFF, PPC_NONE); | |
562 | -GEN_HANDLER(cmp, 0x1F, 0x00, 0x00, 0x00400000, PPC_INTEGER); | |
563 | -GEN_HANDLER(cmpi, 0x0B, 0xFF, 0xFF, 0x00400000, PPC_INTEGER); | |
564 | -GEN_HANDLER(cmpl, 0x1F, 0x00, 0x01, 0x00400000, PPC_INTEGER); | |
565 | -GEN_HANDLER(cmpli, 0x0A, 0xFF, 0xFF, 0x00400000, PPC_INTEGER); | |
566 | -GEN_HANDLER(isel, 0x1F, 0x0F, 0xFF, 0x00000001, PPC_ISEL); | |
567 | -GEN_HANDLER(addi, 0x0E, 0xFF, 0xFF, 0x00000000, PPC_INTEGER); | |
568 | -GEN_HANDLER(addic, 0x0C, 0xFF, 0xFF, 0x00000000, PPC_INTEGER); | |
569 | -GEN_HANDLER2(addic_, "addic.", 0x0D, 0xFF, 0xFF, 0x00000000, PPC_INTEGER); | |
570 | -GEN_HANDLER(addis, 0x0F, 0xFF, 0xFF, 0x00000000, PPC_INTEGER); | |
571 | -GEN_HANDLER(mulhw, 0x1F, 0x0B, 0x02, 0x00000400, PPC_INTEGER); | |
572 | -GEN_HANDLER(mulhwu, 0x1F, 0x0B, 0x00, 0x00000400, PPC_INTEGER); | |
573 | -GEN_HANDLER(mullw, 0x1F, 0x0B, 0x07, 0x00000000, PPC_INTEGER); | |
574 | -GEN_HANDLER(mullwo, 0x1F, 0x0B, 0x17, 0x00000000, PPC_INTEGER); | |
575 | -GEN_HANDLER(mulli, 0x07, 0xFF, 0xFF, 0x00000000, PPC_INTEGER); | |
576 | -#if defined(TARGET_PPC64) | |
577 | -GEN_HANDLER(mulld, 0x1F, 0x09, 0x07, 0x00000000, PPC_64B); | |
578 | -#endif | |
579 | -GEN_HANDLER(neg, 0x1F, 0x08, 0x03, 0x0000F800, PPC_INTEGER); | |
580 | -GEN_HANDLER(nego, 0x1F, 0x08, 0x13, 0x0000F800, PPC_INTEGER); | |
581 | -GEN_HANDLER(subfic, 0x08, 0xFF, 0xFF, 0x00000000, PPC_INTEGER); | |
582 | -GEN_HANDLER2(andi_, "andi.", 0x1C, 0xFF, 0xFF, 0x00000000, PPC_INTEGER); | |
583 | -GEN_HANDLER2(andis_, "andis.", 0x1D, 0xFF, 0xFF, 0x00000000, PPC_INTEGER); | |
584 | -GEN_HANDLER(cntlzw, 0x1F, 0x1A, 0x00, 0x00000000, PPC_INTEGER); | |
585 | -GEN_HANDLER(or, 0x1F, 0x1C, 0x0D, 0x00000000, PPC_INTEGER); | |
586 | -GEN_HANDLER(xor, 0x1F, 0x1C, 0x09, 0x00000000, PPC_INTEGER); | |
587 | -GEN_HANDLER(ori, 0x18, 0xFF, 0xFF, 0x00000000, PPC_INTEGER); | |
588 | -GEN_HANDLER(oris, 0x19, 0xFF, 0xFF, 0x00000000, PPC_INTEGER); | |
589 | -GEN_HANDLER(xori, 0x1A, 0xFF, 0xFF, 0x00000000, PPC_INTEGER); | |
590 | -GEN_HANDLER(xoris, 0x1B, 0xFF, 0xFF, 0x00000000, PPC_INTEGER); | |
591 | -GEN_HANDLER(popcntb, 0x1F, 0x03, 0x03, 0x0000F801, PPC_POPCNTB); | |
592 | -#if defined(TARGET_PPC64) | |
593 | -GEN_HANDLER(cntlzd, 0x1F, 0x1A, 0x01, 0x00000000, PPC_64B); | |
594 | -#endif | |
595 | -GEN_HANDLER(rlwimi, 0x14, 0xFF, 0xFF, 0x00000000, PPC_INTEGER); | |
596 | -GEN_HANDLER(rlwinm, 0x15, 0xFF, 0xFF, 0x00000000, PPC_INTEGER); | |
597 | -GEN_HANDLER(rlwnm, 0x17, 0xFF, 0xFF, 0x00000000, PPC_INTEGER); | |
598 | -GEN_HANDLER(slw, 0x1F, 0x18, 0x00, 0x00000000, PPC_INTEGER); | |
599 | -GEN_HANDLER(sraw, 0x1F, 0x18, 0x18, 0x00000000, PPC_INTEGER); | |
600 | -GEN_HANDLER(srawi, 0x1F, 0x18, 0x19, 0x00000000, PPC_INTEGER); | |
601 | -GEN_HANDLER(srw, 0x1F, 0x18, 0x10, 0x00000000, PPC_INTEGER); | |
602 | -#if defined(TARGET_PPC64) | |
603 | -GEN_HANDLER(sld, 0x1F, 0x1B, 0x00, 0x00000000, PPC_64B); | |
604 | -GEN_HANDLER(srad, 0x1F, 0x1A, 0x18, 0x00000000, PPC_64B); | |
605 | -GEN_HANDLER2(sradi0, "sradi", 0x1F, 0x1A, 0x19, 0x00000000, PPC_64B); | |
606 | -GEN_HANDLER2(sradi1, "sradi", 0x1F, 0x1B, 0x19, 0x00000000, PPC_64B); | |
607 | -GEN_HANDLER(srd, 0x1F, 0x1B, 0x10, 0x00000000, PPC_64B); | |
608 | -#endif | |
609 | -GEN_HANDLER(frsqrtes, 0x3B, 0x1A, 0xFF, 0x001F07C0, PPC_FLOAT_FRSQRTES); | |
610 | -GEN_HANDLER(fsqrt, 0x3F, 0x16, 0xFF, 0x001F07C0, PPC_FLOAT_FSQRT); | |
611 | -GEN_HANDLER(fsqrts, 0x3B, 0x16, 0xFF, 0x001F07C0, PPC_FLOAT_FSQRT); | |
612 | -GEN_HANDLER(fcmpo, 0x3F, 0x00, 0x01, 0x00600001, PPC_FLOAT); | |
613 | -GEN_HANDLER(fcmpu, 0x3F, 0x00, 0x00, 0x00600001, PPC_FLOAT); | |
614 | -GEN_HANDLER(fmr, 0x3F, 0x08, 0x02, 0x001F0000, PPC_FLOAT); | |
615 | -GEN_HANDLER(mcrfs, 0x3F, 0x00, 0x02, 0x0063F801, PPC_FLOAT); | |
616 | -GEN_HANDLER(mffs, 0x3F, 0x07, 0x12, 0x001FF800, PPC_FLOAT); | |
617 | -GEN_HANDLER(mtfsb0, 0x3F, 0x06, 0x02, 0x001FF800, PPC_FLOAT); | |
618 | -GEN_HANDLER(mtfsb1, 0x3F, 0x06, 0x01, 0x001FF800, PPC_FLOAT); | |
619 | -GEN_HANDLER(mtfsf, 0x3F, 0x07, 0x16, 0x00010000, PPC_FLOAT); | |
620 | -GEN_HANDLER(mtfsfi, 0x3F, 0x06, 0x04, 0x006f0800, PPC_FLOAT); | |
621 | -#if defined(TARGET_PPC64) | |
622 | -GEN_HANDLER(ld, 0x3A, 0xFF, 0xFF, 0x00000000, PPC_64B); | |
623 | -GEN_HANDLER(lq, 0x38, 0xFF, 0xFF, 0x00000000, PPC_64BX); | |
624 | -GEN_HANDLER(std, 0x3E, 0xFF, 0xFF, 0x00000000, PPC_64B); | |
625 | -#endif | |
626 | -GEN_HANDLER(lmw, 0x2E, 0xFF, 0xFF, 0x00000000, PPC_INTEGER); | |
627 | -GEN_HANDLER(stmw, 0x2F, 0xFF, 0xFF, 0x00000000, PPC_INTEGER); | |
628 | -GEN_HANDLER(lswi, 0x1F, 0x15, 0x12, 0x00000001, PPC_STRING); | |
629 | -GEN_HANDLER(lswx, 0x1F, 0x15, 0x10, 0x00000001, PPC_STRING); | |
630 | -GEN_HANDLER(stswi, 0x1F, 0x15, 0x16, 0x00000001, PPC_STRING); | |
631 | -GEN_HANDLER(stswx, 0x1F, 0x15, 0x14, 0x00000001, PPC_STRING); | |
632 | -GEN_HANDLER(eieio, 0x1F, 0x16, 0x1A, 0x03FFF801, PPC_MEM_EIEIO); | |
633 | -GEN_HANDLER(isync, 0x13, 0x16, 0x04, 0x03FFF801, PPC_MEM); | |
634 | -GEN_HANDLER(lwarx, 0x1F, 0x14, 0x00, 0x00000001, PPC_RES); | |
635 | -GEN_HANDLER2(stwcx_, "stwcx.", 0x1F, 0x16, 0x04, 0x00000000, PPC_RES); | |
636 | -#if defined(TARGET_PPC64) | |
637 | -GEN_HANDLER(ldarx, 0x1F, 0x14, 0x02, 0x00000001, PPC_64B); | |
638 | -GEN_HANDLER2(stdcx_, "stdcx.", 0x1F, 0x16, 0x06, 0x00000000, PPC_64B); | |
639 | -#endif | |
640 | -GEN_HANDLER(sync, 0x1F, 0x16, 0x12, 0x039FF801, PPC_MEM_SYNC); | |
641 | -GEN_HANDLER(wait, 0x1F, 0x1E, 0x01, 0x03FFF801, PPC_WAIT); | |
642 | -GEN_HANDLER(b, 0x12, 0xFF, 0xFF, 0x00000000, PPC_FLOW); | |
643 | -GEN_HANDLER(bc, 0x10, 0xFF, 0xFF, 0x00000000, PPC_FLOW); | |
644 | -GEN_HANDLER(bcctr, 0x13, 0x10, 0x10, 0x00000000, PPC_FLOW); | |
645 | -GEN_HANDLER(bclr, 0x13, 0x10, 0x00, 0x00000000, PPC_FLOW); | |
646 | -GEN_HANDLER(mcrf, 0x13, 0x00, 0xFF, 0x00000001, PPC_INTEGER); | |
647 | -GEN_HANDLER(rfi, 0x13, 0x12, 0x01, 0x03FF8001, PPC_FLOW); | |
648 | -#if defined(TARGET_PPC64) | |
649 | -GEN_HANDLER(rfid, 0x13, 0x12, 0x00, 0x03FF8001, PPC_64B); | |
650 | -GEN_HANDLER(hrfid, 0x13, 0x12, 0x08, 0x03FF8001, PPC_64H); | |
651 | -#endif | |
652 | -GEN_HANDLER(sc, 0x11, 0xFF, 0xFF, 0x03FFF01D, PPC_FLOW); | |
653 | -GEN_HANDLER(tw, 0x1F, 0x04, 0x00, 0x00000001, PPC_FLOW); | |
654 | -GEN_HANDLER(twi, 0x03, 0xFF, 0xFF, 0x00000000, PPC_FLOW); | |
655 | -#if defined(TARGET_PPC64) | |
656 | -GEN_HANDLER(td, 0x1F, 0x04, 0x02, 0x00000001, PPC_64B); | |
657 | -GEN_HANDLER(tdi, 0x02, 0xFF, 0xFF, 0x00000000, PPC_64B); | |
658 | -#endif | |
659 | -GEN_HANDLER(mcrxr, 0x1F, 0x00, 0x10, 0x007FF801, PPC_MISC); | |
660 | -GEN_HANDLER(mfcr, 0x1F, 0x13, 0x00, 0x00000801, PPC_MISC); | |
661 | -GEN_HANDLER(mfmsr, 0x1F, 0x13, 0x02, 0x001FF801, PPC_MISC); | |
662 | -GEN_HANDLER(mfspr, 0x1F, 0x13, 0x0A, 0x00000001, PPC_MISC); | |
663 | -GEN_HANDLER(mftb, 0x1F, 0x13, 0x0B, 0x00000001, PPC_MFTB); | |
664 | -GEN_HANDLER(mtcrf, 0x1F, 0x10, 0x04, 0x00000801, PPC_MISC); | |
665 | -#if defined(TARGET_PPC64) | |
666 | -GEN_HANDLER(mtmsrd, 0x1F, 0x12, 0x05, 0x001EF801, PPC_64B); | |
667 | -#endif | |
668 | -GEN_HANDLER(mtmsr, 0x1F, 0x12, 0x04, 0x001FF801, PPC_MISC); | |
669 | -GEN_HANDLER(mtspr, 0x1F, 0x13, 0x0E, 0x00000001, PPC_MISC); | |
670 | -GEN_HANDLER(dcbf, 0x1F, 0x16, 0x02, 0x03C00001, PPC_CACHE); | |
671 | -GEN_HANDLER(dcbi, 0x1F, 0x16, 0x0E, 0x03E00001, PPC_CACHE); | |
672 | -GEN_HANDLER(dcbst, 0x1F, 0x16, 0x01, 0x03E00001, PPC_CACHE); | |
673 | -GEN_HANDLER(dcbt, 0x1F, 0x16, 0x08, 0x02000001, PPC_CACHE); | |
674 | -GEN_HANDLER(dcbtst, 0x1F, 0x16, 0x07, 0x02000001, PPC_CACHE); | |
675 | -GEN_HANDLER(dcbz, 0x1F, 0x16, 0x1F, 0x03E00001, PPC_CACHE_DCBZ); | |
676 | -GEN_HANDLER2(dcbz_970, "dcbz", 0x1F, 0x16, 0x1F, 0x03C00001, PPC_CACHE_DCBZT); | |
677 | -GEN_HANDLER(dst, 0x1F, 0x16, 0x0A, 0x01800001, PPC_ALTIVEC); | |
678 | -GEN_HANDLER(dstst, 0x1F, 0x16, 0x0B, 0x02000001, PPC_ALTIVEC); | |
679 | -GEN_HANDLER(dss, 0x1F, 0x16, 0x19, 0x019FF801, PPC_ALTIVEC); | |
680 | -GEN_HANDLER(icbi, 0x1F, 0x16, 0x1E, 0x03E00001, PPC_CACHE_ICBI); | |
681 | -GEN_HANDLER(dcba, 0x1F, 0x16, 0x17, 0x03E00001, PPC_CACHE_DCBA); | |
682 | -GEN_HANDLER(mfsr, 0x1F, 0x13, 0x12, 0x0010F801, PPC_SEGMENT); | |
683 | -GEN_HANDLER(mfsrin, 0x1F, 0x13, 0x14, 0x001F0001, PPC_SEGMENT); | |
684 | -GEN_HANDLER(mtsr, 0x1F, 0x12, 0x06, 0x0010F801, PPC_SEGMENT); | |
685 | -GEN_HANDLER(mtsrin, 0x1F, 0x12, 0x07, 0x001F0001, PPC_SEGMENT); | |
686 | -#if defined(TARGET_PPC64) | |
687 | -GEN_HANDLER2(mfsr_64b, "mfsr", 0x1F, 0x13, 0x12, 0x0010F801, PPC_SEGMENT_64B); | |
688 | -GEN_HANDLER2(mfsrin_64b, "mfsrin", 0x1F, 0x13, 0x14, 0x001F0001, | |
689 | - PPC_SEGMENT_64B); | |
690 | -GEN_HANDLER2(mtsr_64b, "mtsr", 0x1F, 0x12, 0x06, 0x0010F801, PPC_SEGMENT_64B); | |
691 | -GEN_HANDLER2(mtsrin_64b, "mtsrin", 0x1F, 0x12, 0x07, 0x001F0001, | |
692 | - PPC_SEGMENT_64B); | |
693 | -GEN_HANDLER2(slbmte, "slbmte", 0x1F, 0x12, 0x0C, 0x00000000, PPC_SEGMENT_64B); | |
694 | -#endif | |
695 | -GEN_HANDLER(tlbia, 0x1F, 0x12, 0x0B, 0x03FFFC01, PPC_MEM_TLBIA); | |
696 | -GEN_HANDLER(tlbiel, 0x1F, 0x12, 0x08, 0x03FF0001, PPC_MEM_TLBIE); | |
697 | -GEN_HANDLER(tlbie, 0x1F, 0x12, 0x09, 0x03FF0001, PPC_MEM_TLBIE); | |
698 | -GEN_HANDLER(tlbsync, 0x1F, 0x16, 0x11, 0x03FFF801, PPC_MEM_TLBSYNC); | |
699 | -#if defined(TARGET_PPC64) | |
700 | -GEN_HANDLER(slbia, 0x1F, 0x12, 0x0F, 0x03FFFC01, PPC_SLBI); | |
701 | -GEN_HANDLER(slbie, 0x1F, 0x12, 0x0D, 0x03FF0001, PPC_SLBI); | |
702 | -#endif | |
703 | -GEN_HANDLER(eciwx, 0x1F, 0x16, 0x0D, 0x00000001, PPC_EXTERN); | |
704 | -GEN_HANDLER(ecowx, 0x1F, 0x16, 0x09, 0x00000001, PPC_EXTERN); | |
705 | -GEN_HANDLER(abs, 0x1F, 0x08, 0x0B, 0x0000F800, PPC_POWER_BR); | |
706 | -GEN_HANDLER(abso, 0x1F, 0x08, 0x1B, 0x0000F800, PPC_POWER_BR); | |
707 | -GEN_HANDLER(clcs, 0x1F, 0x10, 0x13, 0x0000F800, PPC_POWER_BR); | |
708 | -GEN_HANDLER(div, 0x1F, 0x0B, 0x0A, 0x00000000, PPC_POWER_BR); | |
709 | -GEN_HANDLER(divo, 0x1F, 0x0B, 0x1A, 0x00000000, PPC_POWER_BR); | |
710 | -GEN_HANDLER(divs, 0x1F, 0x0B, 0x0B, 0x00000000, PPC_POWER_BR); | |
711 | -GEN_HANDLER(divso, 0x1F, 0x0B, 0x1B, 0x00000000, PPC_POWER_BR); | |
712 | -GEN_HANDLER(doz, 0x1F, 0x08, 0x08, 0x00000000, PPC_POWER_BR); | |
713 | -GEN_HANDLER(dozo, 0x1F, 0x08, 0x18, 0x00000000, PPC_POWER_BR); | |
714 | -GEN_HANDLER(dozi, 0x09, 0xFF, 0xFF, 0x00000000, PPC_POWER_BR); | |
715 | -GEN_HANDLER(lscbx, 0x1F, 0x15, 0x08, 0x00000000, PPC_POWER_BR); | |
716 | -GEN_HANDLER(maskg, 0x1F, 0x1D, 0x00, 0x00000000, PPC_POWER_BR); | |
717 | -GEN_HANDLER(maskir, 0x1F, 0x1D, 0x10, 0x00000000, PPC_POWER_BR); | |
718 | -GEN_HANDLER(mul, 0x1F, 0x0B, 0x03, 0x00000000, PPC_POWER_BR); | |
719 | -GEN_HANDLER(mulo, 0x1F, 0x0B, 0x13, 0x00000000, PPC_POWER_BR); | |
720 | -GEN_HANDLER(nabs, 0x1F, 0x08, 0x0F, 0x00000000, PPC_POWER_BR); | |
721 | -GEN_HANDLER(nabso, 0x1F, 0x08, 0x1F, 0x00000000, PPC_POWER_BR); | |
722 | -GEN_HANDLER(rlmi, 0x16, 0xFF, 0xFF, 0x00000000, PPC_POWER_BR); | |
723 | -GEN_HANDLER(rrib, 0x1F, 0x19, 0x10, 0x00000000, PPC_POWER_BR); | |
724 | -GEN_HANDLER(sle, 0x1F, 0x19, 0x04, 0x00000000, PPC_POWER_BR); | |
725 | -GEN_HANDLER(sleq, 0x1F, 0x19, 0x06, 0x00000000, PPC_POWER_BR); | |
726 | -GEN_HANDLER(sliq, 0x1F, 0x18, 0x05, 0x00000000, PPC_POWER_BR); | |
727 | -GEN_HANDLER(slliq, 0x1F, 0x18, 0x07, 0x00000000, PPC_POWER_BR); | |
728 | -GEN_HANDLER(sllq, 0x1F, 0x18, 0x06, 0x00000000, PPC_POWER_BR); | |
729 | -GEN_HANDLER(slq, 0x1F, 0x18, 0x04, 0x00000000, PPC_POWER_BR); | |
730 | -GEN_HANDLER(sraiq, 0x1F, 0x18, 0x1D, 0x00000000, PPC_POWER_BR); | |
731 | -GEN_HANDLER(sraq, 0x1F, 0x18, 0x1C, 0x00000000, PPC_POWER_BR); | |
732 | -GEN_HANDLER(sre, 0x1F, 0x19, 0x14, 0x00000000, PPC_POWER_BR); | |
733 | -GEN_HANDLER(srea, 0x1F, 0x19, 0x1C, 0x00000000, PPC_POWER_BR); | |
734 | -GEN_HANDLER(sreq, 0x1F, 0x19, 0x16, 0x00000000, PPC_POWER_BR); | |
735 | -GEN_HANDLER(sriq, 0x1F, 0x18, 0x15, 0x00000000, PPC_POWER_BR); | |
736 | -GEN_HANDLER(srliq, 0x1F, 0x18, 0x17, 0x00000000, PPC_POWER_BR); | |
737 | -GEN_HANDLER(srlq, 0x1F, 0x18, 0x16, 0x00000000, PPC_POWER_BR); | |
738 | -GEN_HANDLER(srq, 0x1F, 0x18, 0x14, 0x00000000, PPC_POWER_BR); | |
739 | -GEN_HANDLER(dsa, 0x1F, 0x14, 0x13, 0x03FFF801, PPC_602_SPEC); | |
740 | -GEN_HANDLER(esa, 0x1F, 0x14, 0x12, 0x03FFF801, PPC_602_SPEC); | |
741 | -GEN_HANDLER(mfrom, 0x1F, 0x09, 0x08, 0x03E0F801, PPC_602_SPEC); | |
742 | -GEN_HANDLER2(tlbld_6xx, "tlbld", 0x1F, 0x12, 0x1E, 0x03FF0001, PPC_6xx_TLB); | |
743 | -GEN_HANDLER2(tlbli_6xx, "tlbli", 0x1F, 0x12, 0x1F, 0x03FF0001, PPC_6xx_TLB); | |
744 | -GEN_HANDLER2(tlbld_74xx, "tlbld", 0x1F, 0x12, 0x1E, 0x03FF0001, PPC_74xx_TLB); | |
745 | -GEN_HANDLER2(tlbli_74xx, "tlbli", 0x1F, 0x12, 0x1F, 0x03FF0001, PPC_74xx_TLB); | |
746 | -GEN_HANDLER(clf, 0x1F, 0x16, 0x03, 0x03E00000, PPC_POWER); | |
747 | -GEN_HANDLER(cli, 0x1F, 0x16, 0x0F, 0x03E00000, PPC_POWER); | |
748 | -GEN_HANDLER(dclst, 0x1F, 0x16, 0x13, 0x03E00000, PPC_POWER); | |
749 | -GEN_HANDLER(mfsri, 0x1F, 0x13, 0x13, 0x00000001, PPC_POWER); | |
750 | -GEN_HANDLER(rac, 0x1F, 0x12, 0x19, 0x00000001, PPC_POWER); | |
751 | -GEN_HANDLER(rfsvc, 0x13, 0x12, 0x02, 0x03FFF0001, PPC_POWER); | |
752 | -GEN_HANDLER(lfq, 0x38, 0xFF, 0xFF, 0x00000003, PPC_POWER2); | |
753 | -GEN_HANDLER(lfqu, 0x39, 0xFF, 0xFF, 0x00000003, PPC_POWER2); | |
754 | -GEN_HANDLER(lfqux, 0x1F, 0x17, 0x19, 0x00000001, PPC_POWER2); | |
755 | -GEN_HANDLER(lfqx, 0x1F, 0x17, 0x18, 0x00000001, PPC_POWER2); | |
756 | -GEN_HANDLER(stfq, 0x3C, 0xFF, 0xFF, 0x00000003, PPC_POWER2); | |
757 | -GEN_HANDLER(stfqu, 0x3D, 0xFF, 0xFF, 0x00000003, PPC_POWER2); | |
758 | -GEN_HANDLER(stfqux, 0x1F, 0x17, 0x1D, 0x00000001, PPC_POWER2); | |
759 | -GEN_HANDLER(stfqx, 0x1F, 0x17, 0x1C, 0x00000001, PPC_POWER2); | |
760 | -GEN_HANDLER(mfapidi, 0x1F, 0x13, 0x08, 0x0000F801, PPC_MFAPIDI); | |
761 | -GEN_HANDLER(tlbiva, 0x1F, 0x12, 0x18, 0x03FFF801, PPC_TLBIVA); | |
762 | -GEN_HANDLER(mfdcr, 0x1F, 0x03, 0x0A, 0x00000001, PPC_DCR); | |
763 | -GEN_HANDLER(mtdcr, 0x1F, 0x03, 0x0E, 0x00000001, PPC_DCR); | |
764 | -GEN_HANDLER(mfdcrx, 0x1F, 0x03, 0x08, 0x00000000, PPC_DCRX); | |
765 | -GEN_HANDLER(mtdcrx, 0x1F, 0x03, 0x0C, 0x00000000, PPC_DCRX); | |
766 | -GEN_HANDLER(mfdcrux, 0x1F, 0x03, 0x09, 0x00000000, PPC_DCRUX); | |
767 | -GEN_HANDLER(mtdcrux, 0x1F, 0x03, 0x0D, 0x00000000, PPC_DCRUX); | |
768 | -GEN_HANDLER(dccci, 0x1F, 0x06, 0x0E, 0x03E00001, PPC_4xx_COMMON); | |
769 | -GEN_HANDLER(dcread, 0x1F, 0x06, 0x0F, 0x00000001, PPC_4xx_COMMON); | |
770 | -GEN_HANDLER2(icbt_40x, "icbt", 0x1F, 0x06, 0x08, 0x03E00001, PPC_40x_ICBT); | |
771 | -GEN_HANDLER(iccci, 0x1F, 0x06, 0x1E, 0x00000001, PPC_4xx_COMMON); | |
772 | -GEN_HANDLER(icread, 0x1F, 0x06, 0x1F, 0x03E00001, PPC_4xx_COMMON); | |
773 | -GEN_HANDLER2(rfci_40x, "rfci", 0x13, 0x13, 0x01, 0x03FF8001, PPC_40x_EXCP); | |
774 | -GEN_HANDLER(rfci, 0x13, 0x13, 0x01, 0x03FF8001, PPC_BOOKE); | |
775 | -GEN_HANDLER(rfdi, 0x13, 0x07, 0x01, 0x03FF8001, PPC_RFDI); | |
776 | -GEN_HANDLER(rfmci, 0x13, 0x06, 0x01, 0x03FF8001, PPC_RFMCI); | |
777 | -GEN_HANDLER2(tlbre_40x, "tlbre", 0x1F, 0x12, 0x1D, 0x00000001, PPC_40x_TLB); | |
778 | -GEN_HANDLER2(tlbsx_40x, "tlbsx", 0x1F, 0x12, 0x1C, 0x00000000, PPC_40x_TLB); | |
779 | -GEN_HANDLER2(tlbwe_40x, "tlbwe", 0x1F, 0x12, 0x1E, 0x00000001, PPC_40x_TLB); | |
780 | -GEN_HANDLER2(tlbre_440, "tlbre", 0x1F, 0x12, 0x1D, 0x00000001, PPC_BOOKE); | |
781 | -GEN_HANDLER2(tlbsx_440, "tlbsx", 0x1F, 0x12, 0x1C, 0x00000000, PPC_BOOKE); | |
782 | -GEN_HANDLER2(tlbwe_440, "tlbwe", 0x1F, 0x12, 0x1E, 0x00000001, PPC_BOOKE); | |
783 | -GEN_HANDLER(wrtee, 0x1F, 0x03, 0x04, 0x000FFC01, PPC_WRTEE); | |
784 | -GEN_HANDLER(wrteei, 0x1F, 0x03, 0x05, 0x000EFC01, PPC_WRTEE); | |
785 | -GEN_HANDLER(dlmzb, 0x1F, 0x0E, 0x02, 0x00000000, PPC_440_SPEC); | |
786 | -GEN_HANDLER(mbar, 0x1F, 0x16, 0x1a, 0x001FF801, PPC_BOOKE); | |
787 | -GEN_HANDLER(msync, 0x1F, 0x16, 0x12, 0x03FFF801, PPC_BOOKE); | |
788 | -GEN_HANDLER2(icbt_440, "icbt", 0x1F, 0x16, 0x00, 0x03E00001, PPC_BOOKE); | |
789 | -GEN_HANDLER(lvsl, 0x1f, 0x06, 0x00, 0x00000001, PPC_ALTIVEC); | |
790 | -GEN_HANDLER(lvsr, 0x1f, 0x06, 0x01, 0x00000001, PPC_ALTIVEC); | |
791 | -GEN_HANDLER(mfvscr, 0x04, 0x2, 0x18, 0x001ff800, PPC_ALTIVEC); | |
792 | -GEN_HANDLER(mtvscr, 0x04, 0x2, 0x19, 0x03ff0000, PPC_ALTIVEC); | |
793 | -GEN_HANDLER(vsldoi, 0x04, 0x16, 0xFF, 0x00000400, PPC_ALTIVEC); | |
794 | -GEN_HANDLER(vmladduhm, 0x04, 0x11, 0xFF, 0x00000000, PPC_ALTIVEC); | |
795 | -GEN_HANDLER2(evsel0, "evsel", 0x04, 0x1c, 0x09, 0x00000000, PPC_SPE); | |
796 | -GEN_HANDLER2(evsel1, "evsel", 0x04, 0x1d, 0x09, 0x00000000, PPC_SPE); | |
797 | -GEN_HANDLER2(evsel2, "evsel", 0x04, 0x1e, 0x09, 0x00000000, PPC_SPE); | |
798 | -GEN_HANDLER2(evsel3, "evsel", 0x04, 0x1f, 0x09, 0x00000000, PPC_SPE); | |
799 | - | |
800 | -#define GEN_INT_ARITH_ADD(name, opc3, add_ca, compute_ca, compute_ov) \ | |
801 | -GEN_HANDLER(name, 0x1F, 0x0A, opc3, 0x00000000, PPC_INTEGER); | |
802 | -#define GEN_INT_ARITH_ADD_CONST(name, opc3, const_val, \ | |
803 | - add_ca, compute_ca, compute_ov) \ | |
804 | -GEN_HANDLER(name, 0x1F, 0x0A, opc3, 0x0000F800, PPC_INTEGER); | |
805 | -GEN_INT_ARITH_ADD(add, 0x08, 0, 0, 0) | |
806 | -GEN_INT_ARITH_ADD(addo, 0x18, 0, 0, 1) | |
807 | -GEN_INT_ARITH_ADD(addc, 0x00, 0, 1, 0) | |
808 | -GEN_INT_ARITH_ADD(addco, 0x10, 0, 1, 1) | |
809 | -GEN_INT_ARITH_ADD(adde, 0x04, 1, 1, 0) | |
810 | -GEN_INT_ARITH_ADD(addeo, 0x14, 1, 1, 1) | |
811 | -GEN_INT_ARITH_ADD_CONST(addme, 0x07, -1LL, 1, 1, 0) | |
812 | -GEN_INT_ARITH_ADD_CONST(addmeo, 0x17, -1LL, 1, 1, 1) | |
813 | -GEN_INT_ARITH_ADD_CONST(addze, 0x06, 0, 1, 1, 0) | |
814 | -GEN_INT_ARITH_ADD_CONST(addzeo, 0x16, 0, 1, 1, 1) | |
815 | -#undef GEN_INT_ARITH_ADD | |
816 | -#undef GEN_INT_ARITH_ADD_CONST | |
817 | - | |
818 | -#define GEN_INT_ARITH_DIVW(name, opc3, sign, compute_ov) \ | |
819 | -GEN_HANDLER(name, 0x1F, 0x0B, opc3, 0x00000000, PPC_INTEGER); | |
820 | -GEN_INT_ARITH_DIVW(divwu, 0x0E, 0, 0); | |
821 | -GEN_INT_ARITH_DIVW(divwuo, 0x1E, 0, 1); | |
822 | -GEN_INT_ARITH_DIVW(divw, 0x0F, 1, 0); | |
823 | -GEN_INT_ARITH_DIVW(divwo, 0x1F, 1, 1); | |
824 | -#undef GEN_INT_ARITH_DIVW | |
825 | - | |
826 | -#if defined(TARGET_PPC64) | |
827 | -#define GEN_INT_ARITH_DIVD(name, opc3, sign, compute_ov) \ | |
828 | -GEN_HANDLER(name, 0x1F, 0x09, opc3, 0x00000000, PPC_64B); | |
829 | -GEN_INT_ARITH_DIVD(divdu, 0x0E, 0, 0); | |
830 | -GEN_INT_ARITH_DIVD(divduo, 0x1E, 0, 1); | |
831 | -GEN_INT_ARITH_DIVD(divd, 0x0F, 1, 0); | |
832 | -GEN_INT_ARITH_DIVD(divdo, 0x1F, 1, 1); | |
833 | -#undef GEN_INT_ARITH_DIVD | |
834 | - | |
835 | -#define GEN_INT_ARITH_MUL_HELPER(name, opc3) \ | |
836 | -GEN_HANDLER(name, 0x1F, 0x09, opc3, 0x00000000, PPC_64B); | |
837 | -GEN_INT_ARITH_MUL_HELPER(mulhdu, 0x00); | |
838 | -GEN_INT_ARITH_MUL_HELPER(mulhd, 0x02); | |
839 | -GEN_INT_ARITH_MUL_HELPER(mulldo, 0x17); | |
840 | -#undef GEN_INT_ARITH_MUL_HELPER | |
841 | -#endif | |
842 | - | |
843 | -#define GEN_INT_ARITH_SUBF(name, opc3, add_ca, compute_ca, compute_ov) \ | |
844 | -GEN_HANDLER(name, 0x1F, 0x08, opc3, 0x00000000, PPC_INTEGER); | |
845 | -#define GEN_INT_ARITH_SUBF_CONST(name, opc3, const_val, \ | |
846 | - add_ca, compute_ca, compute_ov) \ | |
847 | -GEN_HANDLER(name, 0x1F, 0x08, opc3, 0x0000F800, PPC_INTEGER); | |
848 | -GEN_INT_ARITH_SUBF(subf, 0x01, 0, 0, 0) | |
849 | -GEN_INT_ARITH_SUBF(subfo, 0x11, 0, 0, 1) | |
850 | -GEN_INT_ARITH_SUBF(subfc, 0x00, 0, 1, 0) | |
851 | -GEN_INT_ARITH_SUBF(subfco, 0x10, 0, 1, 1) | |
852 | -GEN_INT_ARITH_SUBF(subfe, 0x04, 1, 1, 0) | |
853 | -GEN_INT_ARITH_SUBF(subfeo, 0x14, 1, 1, 1) | |
854 | -GEN_INT_ARITH_SUBF_CONST(subfme, 0x07, -1LL, 1, 1, 0) | |
855 | -GEN_INT_ARITH_SUBF_CONST(subfmeo, 0x17, -1LL, 1, 1, 1) | |
856 | -GEN_INT_ARITH_SUBF_CONST(subfze, 0x06, 0, 1, 1, 0) | |
857 | -GEN_INT_ARITH_SUBF_CONST(subfzeo, 0x16, 0, 1, 1, 1) | |
858 | -#undef GEN_INT_ARITH_SUBF | |
859 | -#undef GEN_INT_ARITH_SUBF_CONST | |
860 | - | |
861 | -#define GEN_LOGICAL2(name, tcg_op, opc, type) \ | |
862 | -GEN_HANDLER(name, 0x1F, 0x1C, opc, 0x00000000, type); | |
863 | -#define GEN_LOGICAL1(name, tcg_op, opc, type) \ | |
864 | -GEN_HANDLER(name, 0x1F, 0x1A, opc, 0x00000000, type); | |
865 | -GEN_LOGICAL2(and, tcg_gen_and_tl, 0x00, PPC_INTEGER); | |
866 | -GEN_LOGICAL2(andc, tcg_gen_andc_tl, 0x01, PPC_INTEGER); | |
867 | -GEN_LOGICAL2(eqv, tcg_gen_eqv_tl, 0x08, PPC_INTEGER); | |
868 | -GEN_LOGICAL1(extsb, tcg_gen_ext8s_tl, 0x1D, PPC_INTEGER); | |
869 | -GEN_LOGICAL1(extsh, tcg_gen_ext16s_tl, 0x1C, PPC_INTEGER); | |
870 | -GEN_LOGICAL2(nand, tcg_gen_nand_tl, 0x0E, PPC_INTEGER); | |
871 | -GEN_LOGICAL2(nor, tcg_gen_nor_tl, 0x03, PPC_INTEGER); | |
872 | -GEN_LOGICAL2(orc, tcg_gen_orc_tl, 0x0C, PPC_INTEGER); | |
873 | -#if defined(TARGET_PPC64) | |
874 | -GEN_LOGICAL1(extsw, tcg_gen_ext32s_tl, 0x1E, PPC_64B); | |
875 | -#endif | |
876 | -#undef GEN_LOGICAL1 | |
877 | -#undef GEN_LOGICAL2 | |
878 | - | |
879 | -#if defined(TARGET_PPC64) | |
880 | -#define GEN_PPC64_R2(name, opc1, opc2) \ | |
881 | -GEN_HANDLER2(name##0, stringify(name), opc1, opc2, 0xFF, 0x00000000, PPC_64B);\ | |
882 | -GEN_HANDLER2(name##1, stringify(name), opc1, opc2 | 0x10, 0xFF, 0x00000000, \ | |
883 | - PPC_64B); | |
884 | -#define GEN_PPC64_R4(name, opc1, opc2) \ | |
885 | -GEN_HANDLER2(name##0, stringify(name), opc1, opc2, 0xFF, 0x00000000, PPC_64B);\ | |
886 | -GEN_HANDLER2(name##1, stringify(name), opc1, opc2 | 0x01, 0xFF, 0x00000000, \ | |
887 | - PPC_64B); \ | |
888 | -GEN_HANDLER2(name##2, stringify(name), opc1, opc2 | 0x10, 0xFF, 0x00000000, \ | |
889 | - PPC_64B); \ | |
890 | -GEN_HANDLER2(name##3, stringify(name), opc1, opc2 | 0x11, 0xFF, 0x00000000, \ | |
891 | - PPC_64B) | |
892 | -GEN_PPC64_R4(rldicl, 0x1E, 0x00); | |
893 | -GEN_PPC64_R4(rldicr, 0x1E, 0x02); | |
894 | -GEN_PPC64_R4(rldic, 0x1E, 0x04); | |
895 | -GEN_PPC64_R2(rldcl, 0x1E, 0x08); | |
896 | -GEN_PPC64_R2(rldcr, 0x1E, 0x09); | |
897 | -GEN_PPC64_R4(rldimi, 0x1E, 0x06); | |
898 | -#undef GEN_PPC64_R2 | |
899 | -#undef GEN_PPC64_R4 | |
900 | -#endif | |
901 | - | |
902 | -#define _GEN_FLOAT_ACB(name, op, op1, op2, isfloat, set_fprf, type) \ | |
903 | -GEN_HANDLER(f##name, op1, op2, 0xFF, 0x00000000, type); | |
904 | -#define GEN_FLOAT_ACB(name, op2, set_fprf, type) \ | |
905 | -_GEN_FLOAT_ACB(name, name, 0x3F, op2, 0, set_fprf, type); \ | |
906 | -_GEN_FLOAT_ACB(name##s, name, 0x3B, op2, 1, set_fprf, type); | |
907 | -#define _GEN_FLOAT_AB(name, op, op1, op2, inval, isfloat, set_fprf, type) \ | |
908 | -GEN_HANDLER(f##name, op1, op2, 0xFF, inval, type); | |
909 | -#define GEN_FLOAT_AB(name, op2, inval, set_fprf, type) \ | |
910 | -_GEN_FLOAT_AB(name, name, 0x3F, op2, inval, 0, set_fprf, type); \ | |
911 | -_GEN_FLOAT_AB(name##s, name, 0x3B, op2, inval, 1, set_fprf, type); | |
912 | -#define _GEN_FLOAT_AC(name, op, op1, op2, inval, isfloat, set_fprf, type) \ | |
913 | -GEN_HANDLER(f##name, op1, op2, 0xFF, inval, type); | |
914 | -#define GEN_FLOAT_AC(name, op2, inval, set_fprf, type) \ | |
915 | -_GEN_FLOAT_AC(name, name, 0x3F, op2, inval, 0, set_fprf, type); \ | |
916 | -_GEN_FLOAT_AC(name##s, name, 0x3B, op2, inval, 1, set_fprf, type); | |
917 | -#define GEN_FLOAT_B(name, op2, op3, set_fprf, type) \ | |
918 | -GEN_HANDLER(f##name, 0x3F, op2, op3, 0x001F0000, type); | |
919 | -#define GEN_FLOAT_BS(name, op1, op2, set_fprf, type) \ | |
920 | -GEN_HANDLER(f##name, op1, op2, 0xFF, 0x001F07C0, type); | |
921 | - | |
922 | -GEN_FLOAT_AB(add, 0x15, 0x000007C0, 1, PPC_FLOAT); | |
923 | -GEN_FLOAT_AB(div, 0x12, 0x000007C0, 1, PPC_FLOAT); | |
924 | -GEN_FLOAT_AC(mul, 0x19, 0x0000F800, 1, PPC_FLOAT); | |
925 | -GEN_FLOAT_BS(re, 0x3F, 0x18, 1, PPC_FLOAT_EXT); | |
926 | -GEN_FLOAT_BS(res, 0x3B, 0x18, 1, PPC_FLOAT_FRES); | |
927 | -GEN_FLOAT_BS(rsqrte, 0x3F, 0x1A, 1, PPC_FLOAT_FRSQRTE); | |
928 | -_GEN_FLOAT_ACB(sel, sel, 0x3F, 0x17, 0, 0, PPC_FLOAT_FSEL); | |
929 | -GEN_FLOAT_AB(sub, 0x14, 0x000007C0, 1, PPC_FLOAT); | |
930 | -GEN_FLOAT_ACB(madd, 0x1D, 1, PPC_FLOAT); | |
931 | -GEN_FLOAT_ACB(msub, 0x1C, 1, PPC_FLOAT); | |
932 | -GEN_FLOAT_ACB(nmadd, 0x1F, 1, PPC_FLOAT); | |
933 | -GEN_FLOAT_ACB(nmsub, 0x1E, 1, PPC_FLOAT); | |
934 | -GEN_FLOAT_B(ctiw, 0x0E, 0x00, 0, PPC_FLOAT); | |
935 | -GEN_FLOAT_B(ctiwz, 0x0F, 0x00, 0, PPC_FLOAT); | |
936 | -GEN_FLOAT_B(rsp, 0x0C, 0x00, 1, PPC_FLOAT); | |
937 | -#if defined(TARGET_PPC64) | |
938 | -GEN_FLOAT_B(cfid, 0x0E, 0x1A, 1, PPC_64B); | |
939 | -GEN_FLOAT_B(ctid, 0x0E, 0x19, 0, PPC_64B); | |
940 | -GEN_FLOAT_B(ctidz, 0x0F, 0x19, 0, PPC_64B); | |
941 | -#endif | |
942 | -GEN_FLOAT_B(rin, 0x08, 0x0C, 1, PPC_FLOAT_EXT); | |
943 | -GEN_FLOAT_B(riz, 0x08, 0x0D, 1, PPC_FLOAT_EXT); | |
944 | -GEN_FLOAT_B(rip, 0x08, 0x0E, 1, PPC_FLOAT_EXT); | |
945 | -GEN_FLOAT_B(rim, 0x08, 0x0F, 1, PPC_FLOAT_EXT); | |
946 | -GEN_FLOAT_B(abs, 0x08, 0x08, 0, PPC_FLOAT); | |
947 | -GEN_FLOAT_B(nabs, 0x08, 0x04, 0, PPC_FLOAT); | |
948 | -GEN_FLOAT_B(neg, 0x08, 0x01, 0, PPC_FLOAT); | |
949 | -#undef _GEN_FLOAT_ACB | |
950 | -#undef GEN_FLOAT_ACB | |
951 | -#undef _GEN_FLOAT_AB | |
952 | -#undef GEN_FLOAT_AB | |
953 | -#undef _GEN_FLOAT_AC | |
954 | -#undef GEN_FLOAT_AC | |
955 | -#undef GEN_FLOAT_B | |
956 | -#undef GEN_FLOAT_BS | |
957 | - | |
958 | -#define GEN_LD(name, ldop, opc, type) \ | |
959 | -GEN_HANDLER(name, opc, 0xFF, 0xFF, 0x00000000, type); | |
960 | -#define GEN_LDU(name, ldop, opc, type) \ | |
961 | -GEN_HANDLER(name##u, opc, 0xFF, 0xFF, 0x00000000, type); | |
962 | -#define GEN_LDUX(name, ldop, opc2, opc3, type) \ | |
963 | -GEN_HANDLER(name##ux, 0x1F, opc2, opc3, 0x00000001, type); | |
964 | -#define GEN_LDX(name, ldop, opc2, opc3, type) \ | |
965 | -GEN_HANDLER(name##x, 0x1F, opc2, opc3, 0x00000001, type); | |
966 | -#define GEN_LDS(name, ldop, op, type) \ | |
967 | -GEN_LD(name, ldop, op | 0x20, type); \ | |
968 | -GEN_LDU(name, ldop, op | 0x21, type); \ | |
969 | -GEN_LDUX(name, ldop, 0x17, op | 0x01, type); \ | |
970 | -GEN_LDX(name, ldop, 0x17, op | 0x00, type) | |
971 | - | |
972 | -GEN_LDS(lbz, ld8u, 0x02, PPC_INTEGER); | |
973 | -GEN_LDS(lha, ld16s, 0x0A, PPC_INTEGER); | |
974 | -GEN_LDS(lhz, ld16u, 0x08, PPC_INTEGER); | |
975 | -GEN_LDS(lwz, ld32u, 0x00, PPC_INTEGER); | |
976 | -#if defined(TARGET_PPC64) | |
977 | -GEN_LDUX(lwa, ld32s, 0x15, 0x0B, PPC_64B); | |
978 | -GEN_LDX(lwa, ld32s, 0x15, 0x0A, PPC_64B); | |
979 | -GEN_LDUX(ld, ld64, 0x15, 0x01, PPC_64B); | |
980 | -GEN_LDX(ld, ld64, 0x15, 0x00, PPC_64B); | |
981 | -#endif | |
982 | -GEN_LDX(lhbr, ld16ur, 0x16, 0x18, PPC_INTEGER); | |
983 | -GEN_LDX(lwbr, ld32ur, 0x16, 0x10, PPC_INTEGER); | |
984 | -#undef GEN_LD | |
985 | -#undef GEN_LDU | |
986 | -#undef GEN_LDUX | |
987 | -#undef GEN_LDX | |
988 | -#undef GEN_LDS | |
989 | - | |
990 | -#define GEN_ST(name, stop, opc, type) \ | |
991 | -GEN_HANDLER(name, opc, 0xFF, 0xFF, 0x00000000, type); | |
992 | -#define GEN_STU(name, stop, opc, type) \ | |
993 | -GEN_HANDLER(stop##u, opc, 0xFF, 0xFF, 0x00000000, type); | |
994 | -#define GEN_STUX(name, stop, opc2, opc3, type) \ | |
995 | -GEN_HANDLER(name##ux, 0x1F, opc2, opc3, 0x00000001, type); | |
996 | -#define GEN_STX(name, stop, opc2, opc3, type) \ | |
997 | -GEN_HANDLER(name##x, 0x1F, opc2, opc3, 0x00000001, type); | |
998 | -#define GEN_STS(name, stop, op, type) \ | |
999 | -GEN_ST(name, stop, op | 0x20, type); \ | |
1000 | -GEN_STU(name, stop, op | 0x21, type); \ | |
1001 | -GEN_STUX(name, stop, 0x17, op | 0x01, type); \ | |
1002 | -GEN_STX(name, stop, 0x17, op | 0x00, type) | |
1003 | - | |
1004 | -GEN_STS(stb, st8, 0x06, PPC_INTEGER); | |
1005 | -GEN_STS(sth, st16, 0x0C, PPC_INTEGER); | |
1006 | -GEN_STS(stw, st32, 0x04, PPC_INTEGER); | |
1007 | -#if defined(TARGET_PPC64) | |
1008 | -GEN_STUX(std, st64, 0x15, 0x05, PPC_64B); | |
1009 | -GEN_STX(std, st64, 0x15, 0x04, PPC_64B); | |
1010 | -#endif | |
1011 | -GEN_STX(sthbr, st16r, 0x16, 0x1C, PPC_INTEGER); | |
1012 | -GEN_STX(stwbr, st32r, 0x16, 0x14, PPC_INTEGER); | |
1013 | -#undef GEN_ST | |
1014 | -#undef GEN_STU | |
1015 | -#undef GEN_STUX | |
1016 | -#undef GEN_STX | |
1017 | -#undef GEN_STS | |
1018 | - | |
1019 | -#define GEN_LDF(name, ldop, opc, type) \ | |
1020 | -GEN_HANDLER(name, opc, 0xFF, 0xFF, 0x00000000, type); | |
1021 | -#define GEN_LDUF(name, ldop, opc, type) \ | |
1022 | -GEN_HANDLER(name##u, opc, 0xFF, 0xFF, 0x00000000, type); | |
1023 | -#define GEN_LDUXF(name, ldop, opc, type) \ | |
1024 | -GEN_HANDLER(name##ux, 0x1F, 0x17, opc, 0x00000001, type); | |
1025 | -#define GEN_LDXF(name, ldop, opc2, opc3, type) \ | |
1026 | -GEN_HANDLER(name##x, 0x1F, opc2, opc3, 0x00000001, type); | |
1027 | -#define GEN_LDFS(name, ldop, op, type) \ | |
1028 | -GEN_LDF(name, ldop, op | 0x20, type); \ | |
1029 | -GEN_LDUF(name, ldop, op | 0x21, type); \ | |
1030 | -GEN_LDUXF(name, ldop, op | 0x01, type); \ | |
1031 | -GEN_LDXF(name, ldop, 0x17, op | 0x00, type) | |
1032 | - | |
1033 | -GEN_LDFS(lfd, ld64, 0x12, PPC_FLOAT); | |
1034 | -GEN_LDFS(lfs, ld32fs, 0x10, PPC_FLOAT); | |
1035 | -#undef GEN_LDF | |
1036 | -#undef GEN_LDUF | |
1037 | -#undef GEN_LDUXF | |
1038 | -#undef GEN_LDXF | |
1039 | - | |
1040 | -#define GEN_STF(name, stop, opc, type) \ | |
1041 | -GEN_HANDLER(name, opc, 0xFF, 0xFF, 0x00000000, type); | |
1042 | -#define GEN_STUF(name, stop, opc, type) \ | |
1043 | -GEN_HANDLER(name##u, opc, 0xFF, 0xFF, 0x00000000, type); | |
1044 | -#define GEN_STUXF(name, stop, opc, type) \ | |
1045 | -GEN_HANDLER(name##ux, 0x1F, 0x17, opc, 0x00000001, type); | |
1046 | -#define GEN_STXF(name, stop, opc2, opc3, type) \ | |
1047 | -GEN_HANDLER(name##x, 0x1F, opc2, opc3, 0x00000001, type); | |
1048 | -#define GEN_STFS(name, stop, op, type) \ | |
1049 | -GEN_STF(name, stop, op | 0x20, type); \ | |
1050 | -GEN_STUF(name, stop, op | 0x21, type); \ | |
1051 | -GEN_STUXF(name, stop, op | 0x01, type); \ | |
1052 | -GEN_STXF(name, stop, 0x17, op | 0x00, type) | |
1053 | - | |
1054 | -GEN_STFS(stfd, st64, 0x16, PPC_FLOAT); | |
1055 | -GEN_STFS(stfs, st32fs, 0x14, PPC_FLOAT); | |
1056 | -GEN_STXF(stfiw, st32fiw, 0x17, 0x1E, PPC_FLOAT_STFIWX); | |
1057 | -#undef GEN_STF | |
1058 | -#undef GEN_STUF | |
1059 | -#undef GEN_STUXF | |
1060 | -#undef GEN_STXF | |
1061 | - | |
1062 | -#define GEN_CRLOGIC(name, tcg_op, opc) \ | |
1063 | -GEN_HANDLER(name, 0x13, 0x01, opc, 0x00000001, PPC_INTEGER); | |
1064 | -GEN_CRLOGIC(crand, tcg_gen_and_i32, 0x08); | |
1065 | -GEN_CRLOGIC(crandc, tcg_gen_andc_i32, 0x04); | |
1066 | -GEN_CRLOGIC(creqv, tcg_gen_eqv_i32, 0x09); | |
1067 | -GEN_CRLOGIC(crnand, tcg_gen_nand_i32, 0x07); | |
1068 | -GEN_CRLOGIC(crnor, tcg_gen_nor_i32, 0x01); | |
1069 | -GEN_CRLOGIC(cror, tcg_gen_or_i32, 0x0E); | |
1070 | -GEN_CRLOGIC(crorc, tcg_gen_orc_i32, 0x0D); | |
1071 | -GEN_CRLOGIC(crxor, tcg_gen_xor_i32, 0x06); | |
1072 | -#undef GEN_CRLOGIC | |
1073 | - | |
1074 | -#define GEN_MAC_HANDLER(name, opc2, opc3) \ | |
1075 | -GEN_HANDLER(name, 0x04, opc2, opc3, 0x00000000, PPC_405_MAC); | |
1076 | -GEN_MAC_HANDLER(macchw, 0x0C, 0x05); | |
1077 | -GEN_MAC_HANDLER(macchwo, 0x0C, 0x15); | |
1078 | -GEN_MAC_HANDLER(macchws, 0x0C, 0x07); | |
1079 | -GEN_MAC_HANDLER(macchwso, 0x0C, 0x17); | |
1080 | -GEN_MAC_HANDLER(macchwsu, 0x0C, 0x06); | |
1081 | -GEN_MAC_HANDLER(macchwsuo, 0x0C, 0x16); | |
1082 | -GEN_MAC_HANDLER(macchwu, 0x0C, 0x04); | |
1083 | -GEN_MAC_HANDLER(macchwuo, 0x0C, 0x14); | |
1084 | -GEN_MAC_HANDLER(machhw, 0x0C, 0x01); | |
1085 | -GEN_MAC_HANDLER(machhwo, 0x0C, 0x11); | |
1086 | -GEN_MAC_HANDLER(machhws, 0x0C, 0x03); | |
1087 | -GEN_MAC_HANDLER(machhwso, 0x0C, 0x13); | |
1088 | -GEN_MAC_HANDLER(machhwsu, 0x0C, 0x02); | |
1089 | -GEN_MAC_HANDLER(machhwsuo, 0x0C, 0x12); | |
1090 | -GEN_MAC_HANDLER(machhwu, 0x0C, 0x00); | |
1091 | -GEN_MAC_HANDLER(machhwuo, 0x0C, 0x10); | |
1092 | -GEN_MAC_HANDLER(maclhw, 0x0C, 0x0D); | |
1093 | -GEN_MAC_HANDLER(maclhwo, 0x0C, 0x1D); | |
1094 | -GEN_MAC_HANDLER(maclhws, 0x0C, 0x0F); | |
1095 | -GEN_MAC_HANDLER(maclhwso, 0x0C, 0x1F); | |
1096 | -GEN_MAC_HANDLER(maclhwu, 0x0C, 0x0C); | |
1097 | -GEN_MAC_HANDLER(maclhwuo, 0x0C, 0x1C); | |
1098 | -GEN_MAC_HANDLER(maclhwsu, 0x0C, 0x0E); | |
1099 | -GEN_MAC_HANDLER(maclhwsuo, 0x0C, 0x1E); | |
1100 | -GEN_MAC_HANDLER(nmacchw, 0x0E, 0x05); | |
1101 | -GEN_MAC_HANDLER(nmacchwo, 0x0E, 0x15); | |
1102 | -GEN_MAC_HANDLER(nmacchws, 0x0E, 0x07); | |
1103 | -GEN_MAC_HANDLER(nmacchwso, 0x0E, 0x17); | |
1104 | -GEN_MAC_HANDLER(nmachhw, 0x0E, 0x01); | |
1105 | -GEN_MAC_HANDLER(nmachhwo, 0x0E, 0x11); | |
1106 | -GEN_MAC_HANDLER(nmachhws, 0x0E, 0x03); | |
1107 | -GEN_MAC_HANDLER(nmachhwso, 0x0E, 0x13); | |
1108 | -GEN_MAC_HANDLER(nmaclhw, 0x0E, 0x0D); | |
1109 | -GEN_MAC_HANDLER(nmaclhwo, 0x0E, 0x1D); | |
1110 | -GEN_MAC_HANDLER(nmaclhws, 0x0E, 0x0F); | |
1111 | -GEN_MAC_HANDLER(nmaclhwso, 0x0E, 0x1F); | |
1112 | -GEN_MAC_HANDLER(mulchw, 0x08, 0x05); | |
1113 | -GEN_MAC_HANDLER(mulchwu, 0x08, 0x04); | |
1114 | -GEN_MAC_HANDLER(mulhhw, 0x08, 0x01); | |
1115 | -GEN_MAC_HANDLER(mulhhwu, 0x08, 0x00); | |
1116 | -GEN_MAC_HANDLER(mullhw, 0x08, 0x0D); | |
1117 | -GEN_MAC_HANDLER(mullhwu, 0x08, 0x0C); | |
1118 | -#undef GEN_MAC_HANDLER | |
1119 | - | |
1120 | -#define GEN_VR_LDX(name, opc2, opc3) \ | |
1121 | -GEN_HANDLER(name, 0x1F, opc2, opc3, 0x00000001, PPC_ALTIVEC); | |
1122 | -#define GEN_VR_STX(name, opc2, opc3) \ | |
1123 | -GEN_HANDLER(st##name, 0x1F, opc2, opc3, 0x00000001, PPC_ALTIVEC); | |
1124 | -#define GEN_VR_LVE(name, opc2, opc3) \ | |
1125 | - GEN_HANDLER(lve##name, 0x1F, opc2, opc3, 0x00000001, PPC_ALTIVEC); | |
1126 | -#define GEN_VR_STVE(name, opc2, opc3) \ | |
1127 | - GEN_HANDLER(stve##name, 0x1F, opc2, opc3, 0x00000001, PPC_ALTIVEC); | |
1128 | -GEN_VR_LDX(lvx, 0x07, 0x03); | |
1129 | -GEN_VR_LDX(lvxl, 0x07, 0x0B); | |
1130 | -GEN_VR_LVE(bx, 0x07, 0x00); | |
1131 | -GEN_VR_LVE(hx, 0x07, 0x01); | |
1132 | -GEN_VR_LVE(wx, 0x07, 0x02); | |
1133 | -GEN_VR_STX(svx, 0x07, 0x07); | |
1134 | -GEN_VR_STX(svxl, 0x07, 0x0F); | |
1135 | -GEN_VR_STVE(bx, 0x07, 0x04); | |
1136 | -GEN_VR_STVE(hx, 0x07, 0x05); | |
1137 | -GEN_VR_STVE(wx, 0x07, 0x06); | |
1138 | -#undef GEN_VR_LDX | |
1139 | -#undef GEN_VR_STX | |
1140 | -#undef GEN_VR_LVE | |
1141 | -#undef GEN_VR_STVE | |
1142 | - | |
1143 | -#define GEN_VX_LOGICAL(name, tcg_op, opc2, opc3) \ | |
1144 | -GEN_HANDLER(name, 0x04, opc2, opc3, 0x00000000, PPC_ALTIVEC); | |
1145 | -GEN_VX_LOGICAL(vand, tcg_gen_and_i64, 2, 16); | |
1146 | -GEN_VX_LOGICAL(vandc, tcg_gen_andc_i64, 2, 17); | |
1147 | -GEN_VX_LOGICAL(vor, tcg_gen_or_i64, 2, 18); | |
1148 | -GEN_VX_LOGICAL(vxor, tcg_gen_xor_i64, 2, 19); | |
1149 | -GEN_VX_LOGICAL(vnor, tcg_gen_nor_i64, 2, 20); | |
1150 | -#undef GEN_VX_LOGICAL | |
1151 | - | |
1152 | -#define GEN_VXFORM(name, opc2, opc3) \ | |
1153 | -GEN_HANDLER(name, 0x04, opc2, opc3, 0x00000000, PPC_ALTIVEC); | |
1154 | -GEN_VXFORM(vaddubm, 0, 0); | |
1155 | -GEN_VXFORM(vadduhm, 0, 1); | |
1156 | -GEN_VXFORM(vadduwm, 0, 2); | |
1157 | -GEN_VXFORM(vsububm, 0, 16); | |
1158 | -GEN_VXFORM(vsubuhm, 0, 17); | |
1159 | -GEN_VXFORM(vsubuwm, 0, 18); | |
1160 | -GEN_VXFORM(vmaxub, 1, 0); | |
1161 | -GEN_VXFORM(vmaxuh, 1, 1); | |
1162 | -GEN_VXFORM(vmaxuw, 1, 2); | |
1163 | -GEN_VXFORM(vmaxsb, 1, 4); | |
1164 | -GEN_VXFORM(vmaxsh, 1, 5); | |
1165 | -GEN_VXFORM(vmaxsw, 1, 6); | |
1166 | -GEN_VXFORM(vminub, 1, 8); | |
1167 | -GEN_VXFORM(vminuh, 1, 9); | |
1168 | -GEN_VXFORM(vminuw, 1, 10); | |
1169 | -GEN_VXFORM(vminsb, 1, 12); | |
1170 | -GEN_VXFORM(vminsh, 1, 13); | |
1171 | -GEN_VXFORM(vminsw, 1, 14); | |
1172 | -GEN_VXFORM(vavgub, 1, 16); | |
1173 | -GEN_VXFORM(vavguh, 1, 17); | |
1174 | -GEN_VXFORM(vavguw, 1, 18); | |
1175 | -GEN_VXFORM(vavgsb, 1, 20); | |
1176 | -GEN_VXFORM(vavgsh, 1, 21); | |
1177 | -GEN_VXFORM(vavgsw, 1, 22); | |
1178 | -GEN_VXFORM(vmrghb, 6, 0); | |
1179 | -GEN_VXFORM(vmrghh, 6, 1); | |
1180 | -GEN_VXFORM(vmrghw, 6, 2); | |
1181 | -GEN_VXFORM(vmrglb, 6, 4); | |
1182 | -GEN_VXFORM(vmrglh, 6, 5); | |
1183 | -GEN_VXFORM(vmrglw, 6, 6); | |
1184 | -GEN_VXFORM(vmuloub, 4, 0); | |
1185 | -GEN_VXFORM(vmulouh, 4, 1); | |
1186 | -GEN_VXFORM(vmulosb, 4, 4); | |
1187 | -GEN_VXFORM(vmulosh, 4, 5); | |
1188 | -GEN_VXFORM(vmuleub, 4, 8); | |
1189 | -GEN_VXFORM(vmuleuh, 4, 9); | |
1190 | -GEN_VXFORM(vmulesb, 4, 12); | |
1191 | -GEN_VXFORM(vmulesh, 4, 13); | |
1192 | -GEN_VXFORM(vslb, 2, 4); | |
1193 | -GEN_VXFORM(vslh, 2, 5); | |
1194 | -GEN_VXFORM(vslw, 2, 6); | |
1195 | -GEN_VXFORM(vsrb, 2, 8); | |
1196 | -GEN_VXFORM(vsrh, 2, 9); | |
1197 | -GEN_VXFORM(vsrw, 2, 10); | |
1198 | -GEN_VXFORM(vsrab, 2, 12); | |
1199 | -GEN_VXFORM(vsrah, 2, 13); | |
1200 | -GEN_VXFORM(vsraw, 2, 14); | |
1201 | -GEN_VXFORM(vslo, 6, 16); | |
1202 | -GEN_VXFORM(vsro, 6, 17); | |
1203 | -GEN_VXFORM(vaddcuw, 0, 6); | |
1204 | -GEN_VXFORM(vsubcuw, 0, 22); | |
1205 | -GEN_VXFORM(vaddubs, 0, 8); | |
1206 | -GEN_VXFORM(vadduhs, 0, 9); | |
1207 | -GEN_VXFORM(vadduws, 0, 10); | |
1208 | -GEN_VXFORM(vaddsbs, 0, 12); | |
1209 | -GEN_VXFORM(vaddshs, 0, 13); | |
1210 | -GEN_VXFORM(vaddsws, 0, 14); | |
1211 | -GEN_VXFORM(vsububs, 0, 24); | |
1212 | -GEN_VXFORM(vsubuhs, 0, 25); | |
1213 | -GEN_VXFORM(vsubuws, 0, 26); | |
1214 | -GEN_VXFORM(vsubsbs, 0, 28); | |
1215 | -GEN_VXFORM(vsubshs, 0, 29); | |
1216 | -GEN_VXFORM(vsubsws, 0, 30); | |
1217 | -GEN_VXFORM(vrlb, 2, 0); | |
1218 | -GEN_VXFORM(vrlh, 2, 1); | |
1219 | -GEN_VXFORM(vrlw, 2, 2); | |
1220 | -GEN_VXFORM(vsl, 2, 7); | |
1221 | -GEN_VXFORM(vsr, 2, 11); | |
1222 | -GEN_VXFORM(vpkuhum, 7, 0); | |
1223 | -GEN_VXFORM(vpkuwum, 7, 1); | |
1224 | -GEN_VXFORM(vpkuhus, 7, 2); | |
1225 | -GEN_VXFORM(vpkuwus, 7, 3); | |
1226 | -GEN_VXFORM(vpkshus, 7, 4); | |
1227 | -GEN_VXFORM(vpkswus, 7, 5); | |
1228 | -GEN_VXFORM(vpkshss, 7, 6); | |
1229 | -GEN_VXFORM(vpkswss, 7, 7); | |
1230 | -GEN_VXFORM(vpkpx, 7, 12); | |
1231 | -GEN_VXFORM(vsum4ubs, 4, 24); | |
1232 | -GEN_VXFORM(vsum4sbs, 4, 28); | |
1233 | -GEN_VXFORM(vsum4shs, 4, 25); | |
1234 | -GEN_VXFORM(vsum2sws, 4, 26); | |
1235 | -GEN_VXFORM(vsumsws, 4, 30); | |
1236 | -GEN_VXFORM(vaddfp, 5, 0); | |
1237 | -GEN_VXFORM(vsubfp, 5, 1); | |
1238 | -GEN_VXFORM(vmaxfp, 5, 16); | |
1239 | -GEN_VXFORM(vminfp, 5, 17); | |
1240 | -#undef GEN_VXFORM | |
1241 | - | |
1242 | -#define GEN_VXRFORM1(opname, name, str, opc2, opc3) \ | |
1243 | - GEN_HANDLER2(name, str, 0x4, opc2, opc3, 0x00000000, PPC_ALTIVEC); | |
1244 | -#define GEN_VXRFORM(name, opc2, opc3) \ | |
1245 | - GEN_VXRFORM1(name, name, #name, opc2, opc3) \ | |
1246 | - GEN_VXRFORM1(name##_dot, name##_, #name ".", opc2, (opc3 | (0x1 << 4))) | |
1247 | -GEN_VXRFORM(vcmpequb, 3, 0) | |
1248 | -GEN_VXRFORM(vcmpequh, 3, 1) | |
1249 | -GEN_VXRFORM(vcmpequw, 3, 2) | |
1250 | -GEN_VXRFORM(vcmpgtsb, 3, 12) | |
1251 | -GEN_VXRFORM(vcmpgtsh, 3, 13) | |
1252 | -GEN_VXRFORM(vcmpgtsw, 3, 14) | |
1253 | -GEN_VXRFORM(vcmpgtub, 3, 8) | |
1254 | -GEN_VXRFORM(vcmpgtuh, 3, 9) | |
1255 | -GEN_VXRFORM(vcmpgtuw, 3, 10) | |
1256 | -GEN_VXRFORM(vcmpeqfp, 3, 3) | |
1257 | -GEN_VXRFORM(vcmpgefp, 3, 7) | |
1258 | -GEN_VXRFORM(vcmpgtfp, 3, 11) | |
1259 | -GEN_VXRFORM(vcmpbfp, 3, 15) | |
1260 | -#undef GEN_VXRFORM1 | |
1261 | -#undef GEN_VXRFORM | |
1262 | - | |
1263 | -#define GEN_VXFORM_SIMM(name, opc2, opc3) \ | |
1264 | - GEN_HANDLER(name, 0x04, opc2, opc3, 0x00000000, PPC_ALTIVEC); | |
1265 | -GEN_VXFORM_SIMM(vspltisb, 6, 12); | |
1266 | -GEN_VXFORM_SIMM(vspltish, 6, 13); | |
1267 | -GEN_VXFORM_SIMM(vspltisw, 6, 14); | |
1268 | -#undef GEN_VXFORM_SIMM | |
1269 | - | |
1270 | -#define GEN_VXFORM_NOA(name, opc2, opc3) \ | |
1271 | - GEN_HANDLER(name, 0x04, opc2, opc3, 0x001f0000, PPC_ALTIVEC); | |
1272 | - | |
1273 | -GEN_VXFORM_NOA(vupkhsb, 7, 8); | |
1274 | -GEN_VXFORM_NOA(vupkhsh, 7, 9); | |
1275 | -GEN_VXFORM_NOA(vupklsb, 7, 10); | |
1276 | -GEN_VXFORM_NOA(vupklsh, 7, 11); | |
1277 | -GEN_VXFORM_NOA(vupkhpx, 7, 13); | |
1278 | -GEN_VXFORM_NOA(vupklpx, 7, 15); | |
1279 | -GEN_VXFORM_NOA(vrefp, 5, 4); | |
1280 | -GEN_VXFORM_NOA(vrsqrtefp, 5, 5); | |
1281 | -GEN_VXFORM_NOA(vlogefp, 5, 7); | |
1282 | -GEN_VXFORM_NOA(vrfim, 5, 8); | |
1283 | -GEN_VXFORM_NOA(vrfin, 5, 9); | |
1284 | -GEN_VXFORM_NOA(vrfip, 5, 10); | |
1285 | -GEN_VXFORM_NOA(vrfiz, 5, 11); | |
1286 | -#undef GEN_VXFORM_NOA | |
1287 | - | |
1288 | -#define GEN_VXFORM_UIMM(name, opc2, opc3) \ | |
1289 | - GEN_HANDLER(name, 0x04, opc2, opc3, 0x00000000, PPC_ALTIVEC); | |
1290 | -GEN_VXFORM_UIMM(vspltb, 6, 8); | |
1291 | -GEN_VXFORM_UIMM(vsplth, 6, 9); | |
1292 | -GEN_VXFORM_UIMM(vspltw, 6, 10); | |
1293 | -GEN_VXFORM_UIMM(vcfux, 5, 12); | |
1294 | -GEN_VXFORM_UIMM(vcfsx, 5, 13); | |
1295 | -GEN_VXFORM_UIMM(vctuxs, 5, 14); | |
1296 | -GEN_VXFORM_UIMM(vctsxs, 5, 15); | |
1297 | -#undef GEN_VXFORM_UIMM | |
1298 | - | |
1299 | -#define GEN_VAFORM_PAIRED(name0, name1, opc2) \ | |
1300 | - GEN_HANDLER(name0##_##name1, 0x04, opc2, 0xFF, 0x00000000, PPC_ALTIVEC); | |
1301 | -GEN_VAFORM_PAIRED(vmhaddshs, vmhraddshs, 16) | |
1302 | -GEN_VAFORM_PAIRED(vmsumubm, vmsummbm, 18) | |
1303 | -GEN_VAFORM_PAIRED(vmsumuhm, vmsumuhs, 19) | |
1304 | -GEN_VAFORM_PAIRED(vmsumshm, vmsumshs, 20) | |
1305 | -GEN_VAFORM_PAIRED(vsel, vperm, 21) | |
1306 | -GEN_VAFORM_PAIRED(vmaddfp, vnmsubfp, 23) | |
1307 | -#undef GEN_VAFORM_PAIRED | |
1308 | - | |
1309 | -#define GEN_SPE(name0, name1, opc2, opc3, inval, type) \ | |
1310 | -GEN_HANDLER(name0##_##name1, 0x04, opc2, opc3, inval, type); | |
1311 | -GEN_SPE(evaddw, speundef, 0x00, 0x08, 0x00000000, PPC_SPE); | |
1312 | -GEN_SPE(evaddiw, speundef, 0x01, 0x08, 0x00000000, PPC_SPE); | |
1313 | -GEN_SPE(evsubfw, speundef, 0x02, 0x08, 0x00000000, PPC_SPE); | |
1314 | -GEN_SPE(evsubifw, speundef, 0x03, 0x08, 0x00000000, PPC_SPE); | |
1315 | -GEN_SPE(evabs, evneg, 0x04, 0x08, 0x0000F800, PPC_SPE); | |
1316 | -GEN_SPE(evextsb, evextsh, 0x05, 0x08, 0x0000F800, PPC_SPE); | |
1317 | -GEN_SPE(evrndw, evcntlzw, 0x06, 0x08, 0x0000F800, PPC_SPE); | |
1318 | -GEN_SPE(evcntlsw, brinc, 0x07, 0x08, 0x00000000, PPC_SPE); | |
1319 | -GEN_SPE(speundef, evand, 0x08, 0x08, 0x00000000, PPC_SPE); | |
1320 | -GEN_SPE(evandc, speundef, 0x09, 0x08, 0x00000000, PPC_SPE); | |
1321 | -GEN_SPE(evxor, evor, 0x0B, 0x08, 0x00000000, PPC_SPE); | |
1322 | -GEN_SPE(evnor, eveqv, 0x0C, 0x08, 0x00000000, PPC_SPE); | |
1323 | -GEN_SPE(speundef, evorc, 0x0D, 0x08, 0x00000000, PPC_SPE); | |
1324 | -GEN_SPE(evnand, speundef, 0x0F, 0x08, 0x00000000, PPC_SPE); | |
1325 | -GEN_SPE(evsrwu, evsrws, 0x10, 0x08, 0x00000000, PPC_SPE); | |
1326 | -GEN_SPE(evsrwiu, evsrwis, 0x11, 0x08, 0x00000000, PPC_SPE); | |
1327 | -GEN_SPE(evslw, speundef, 0x12, 0x08, 0x00000000, PPC_SPE); | |
1328 | -GEN_SPE(evslwi, speundef, 0x13, 0x08, 0x00000000, PPC_SPE); | |
1329 | -GEN_SPE(evrlw, evsplati, 0x14, 0x08, 0x00000000, PPC_SPE); | |
1330 | -GEN_SPE(evrlwi, evsplatfi, 0x15, 0x08, 0x00000000, PPC_SPE); | |
1331 | -GEN_SPE(evmergehi, evmergelo, 0x16, 0x08, 0x00000000, PPC_SPE); | |
1332 | -GEN_SPE(evmergehilo, evmergelohi, 0x17, 0x08, 0x00000000, PPC_SPE); | |
1333 | -GEN_SPE(evcmpgtu, evcmpgts, 0x18, 0x08, 0x00600000, PPC_SPE); | |
1334 | -GEN_SPE(evcmpltu, evcmplts, 0x19, 0x08, 0x00600000, PPC_SPE); | |
1335 | -GEN_SPE(evcmpeq, speundef, 0x1A, 0x08, 0x00600000, PPC_SPE); | |
1336 | - | |
1337 | -GEN_SPE(evfsadd, evfssub, 0x00, 0x0A, 0x00000000, PPC_SPE_SINGLE); | |
1338 | -GEN_SPE(evfsabs, evfsnabs, 0x02, 0x0A, 0x0000F800, PPC_SPE_SINGLE); | |
1339 | -GEN_SPE(evfsneg, speundef, 0x03, 0x0A, 0x0000F800, PPC_SPE_SINGLE); | |
1340 | -GEN_SPE(evfsmul, evfsdiv, 0x04, 0x0A, 0x00000000, PPC_SPE_SINGLE); | |
1341 | -GEN_SPE(evfscmpgt, evfscmplt, 0x06, 0x0A, 0x00600000, PPC_SPE_SINGLE); | |
1342 | -GEN_SPE(evfscmpeq, speundef, 0x07, 0x0A, 0x00600000, PPC_SPE_SINGLE); | |
1343 | -GEN_SPE(evfscfui, evfscfsi, 0x08, 0x0A, 0x00180000, PPC_SPE_SINGLE); | |
1344 | -GEN_SPE(evfscfuf, evfscfsf, 0x09, 0x0A, 0x00180000, PPC_SPE_SINGLE); | |
1345 | -GEN_SPE(evfsctui, evfsctsi, 0x0A, 0x0A, 0x00180000, PPC_SPE_SINGLE); | |
1346 | -GEN_SPE(evfsctuf, evfsctsf, 0x0B, 0x0A, 0x00180000, PPC_SPE_SINGLE); | |
1347 | -GEN_SPE(evfsctuiz, speundef, 0x0C, 0x0A, 0x00180000, PPC_SPE_SINGLE); | |
1348 | -GEN_SPE(evfsctsiz, speundef, 0x0D, 0x0A, 0x00180000, PPC_SPE_SINGLE); | |
1349 | -GEN_SPE(evfststgt, evfststlt, 0x0E, 0x0A, 0x00600000, PPC_SPE_SINGLE); | |
1350 | -GEN_SPE(evfststeq, speundef, 0x0F, 0x0A, 0x00600000, PPC_SPE_SINGLE); | |
1351 | - | |
1352 | -GEN_SPE(efsadd, efssub, 0x00, 0x0B, 0x00000000, PPC_SPE_SINGLE); | |
1353 | -GEN_SPE(efsabs, efsnabs, 0x02, 0x0B, 0x0000F800, PPC_SPE_SINGLE); | |
1354 | -GEN_SPE(efsneg, speundef, 0x03, 0x0B, 0x0000F800, PPC_SPE_SINGLE); | |
1355 | -GEN_SPE(efsmul, efsdiv, 0x04, 0x0B, 0x00000000, PPC_SPE_SINGLE); | |
1356 | -GEN_SPE(efscmpgt, efscmplt, 0x06, 0x0B, 0x00600000, PPC_SPE_SINGLE); | |
1357 | -GEN_SPE(efscmpeq, efscfd, 0x07, 0x0B, 0x00600000, PPC_SPE_SINGLE); | |
1358 | -GEN_SPE(efscfui, efscfsi, 0x08, 0x0B, 0x00180000, PPC_SPE_SINGLE); | |
1359 | -GEN_SPE(efscfuf, efscfsf, 0x09, 0x0B, 0x00180000, PPC_SPE_SINGLE); | |
1360 | -GEN_SPE(efsctui, efsctsi, 0x0A, 0x0B, 0x00180000, PPC_SPE_SINGLE); | |
1361 | -GEN_SPE(efsctuf, efsctsf, 0x0B, 0x0B, 0x00180000, PPC_SPE_SINGLE); | |
1362 | -GEN_SPE(efsctuiz, speundef, 0x0C, 0x0B, 0x00180000, PPC_SPE_SINGLE); | |
1363 | -GEN_SPE(efsctsiz, speundef, 0x0D, 0x0B, 0x00180000, PPC_SPE_SINGLE); | |
1364 | -GEN_SPE(efststgt, efststlt, 0x0E, 0x0B, 0x00600000, PPC_SPE_SINGLE); | |
1365 | -GEN_SPE(efststeq, speundef, 0x0F, 0x0B, 0x00600000, PPC_SPE_SINGLE); | |
1366 | - | |
1367 | -GEN_SPE(efdadd, efdsub, 0x10, 0x0B, 0x00000000, PPC_SPE_DOUBLE); | |
1368 | -GEN_SPE(efdcfuid, efdcfsid, 0x11, 0x0B, 0x00180000, PPC_SPE_DOUBLE); | |
1369 | -GEN_SPE(efdabs, efdnabs, 0x12, 0x0B, 0x0000F800, PPC_SPE_DOUBLE); | |
1370 | -GEN_SPE(efdneg, speundef, 0x13, 0x0B, 0x0000F800, PPC_SPE_DOUBLE); | |
1371 | -GEN_SPE(efdmul, efddiv, 0x14, 0x0B, 0x00000000, PPC_SPE_DOUBLE); | |
1372 | -GEN_SPE(efdctuidz, efdctsidz, 0x15, 0x0B, 0x00180000, PPC_SPE_DOUBLE); | |
1373 | -GEN_SPE(efdcmpgt, efdcmplt, 0x16, 0x0B, 0x00600000, PPC_SPE_DOUBLE); | |
1374 | -GEN_SPE(efdcmpeq, efdcfs, 0x17, 0x0B, 0x00600000, PPC_SPE_DOUBLE); | |
1375 | -GEN_SPE(efdcfui, efdcfsi, 0x18, 0x0B, 0x00180000, PPC_SPE_DOUBLE); | |
1376 | -GEN_SPE(efdcfuf, efdcfsf, 0x19, 0x0B, 0x00180000, PPC_SPE_DOUBLE); | |
1377 | -GEN_SPE(efdctui, efdctsi, 0x1A, 0x0B, 0x00180000, PPC_SPE_DOUBLE); | |
1378 | -GEN_SPE(efdctuf, efdctsf, 0x1B, 0x0B, 0x00180000, PPC_SPE_DOUBLE); | |
1379 | -GEN_SPE(efdctuiz, speundef, 0x1C, 0x0B, 0x00180000, PPC_SPE_DOUBLE); | |
1380 | -GEN_SPE(efdctsiz, speundef, 0x1D, 0x0B, 0x00180000, PPC_SPE_DOUBLE); | |
1381 | -GEN_SPE(efdtstgt, efdtstlt, 0x1E, 0x0B, 0x00600000, PPC_SPE_DOUBLE); | |
1382 | -GEN_SPE(efdtsteq, speundef, 0x1F, 0x0B, 0x00600000, PPC_SPE_DOUBLE); | |
1383 | -#undef GEN_SPE | |
498 | + }, \ | |
499 | + .oname = stringify(name), \ | |
500 | +} | |
501 | +#define GEN_OPCODE2(name, onam, op1, op2, op3, invl, _typ) \ | |
502 | +{ \ | |
503 | + .opc1 = op1, \ | |
504 | + .opc2 = op2, \ | |
505 | + .opc3 = op3, \ | |
506 | + .pad = { 0, }, \ | |
507 | + .handler = { \ | |
508 | + .inval = invl, \ | |
509 | + .type = _typ, \ | |
510 | + .handler = &gen_##name, \ | |
511 | + }, \ | |
512 | + .oname = onam, \ | |
513 | +} | |
514 | +#endif | |
1384 | 515 | |
1385 | -#define GEN_SPEOP_LDST(name, opc2, sh) \ | |
1386 | -GEN_HANDLER(name, 0x04, opc2, 0x0C, 0x00000000, PPC_SPE); | |
1387 | -GEN_SPEOP_LDST(evldd, 0x00, 3); | |
1388 | -GEN_SPEOP_LDST(evldw, 0x01, 3); | |
1389 | -GEN_SPEOP_LDST(evldh, 0x02, 3); | |
1390 | -GEN_SPEOP_LDST(evlhhesplat, 0x04, 1); | |
1391 | -GEN_SPEOP_LDST(evlhhousplat, 0x06, 1); | |
1392 | -GEN_SPEOP_LDST(evlhhossplat, 0x07, 1); | |
1393 | -GEN_SPEOP_LDST(evlwhe, 0x08, 2); | |
1394 | -GEN_SPEOP_LDST(evlwhou, 0x0A, 2); | |
1395 | -GEN_SPEOP_LDST(evlwhos, 0x0B, 2); | |
1396 | -GEN_SPEOP_LDST(evlwwsplat, 0x0C, 2); | |
1397 | -GEN_SPEOP_LDST(evlwhsplat, 0x0E, 2); | |
516 | +/* SPR load/store helpers */ | |
517 | +static always_inline void gen_load_spr(TCGv t, int reg) | |
518 | +{ | |
519 | + tcg_gen_ld_tl(t, cpu_env, offsetof(CPUState, spr[reg])); | |
520 | +} | |
1398 | 521 | |
1399 | -GEN_SPEOP_LDST(evstdd, 0x10, 3); | |
1400 | -GEN_SPEOP_LDST(evstdw, 0x11, 3); | |
1401 | -GEN_SPEOP_LDST(evstdh, 0x12, 3); | |
1402 | -GEN_SPEOP_LDST(evstwhe, 0x18, 2); | |
1403 | -GEN_SPEOP_LDST(evstwho, 0x1A, 2); | |
1404 | -GEN_SPEOP_LDST(evstwwe, 0x1C, 2); | |
1405 | -GEN_SPEOP_LDST(evstwwo, 0x1E, 2); | |
1406 | -#undef GEN_SPEOP_LDST | |
1407 | -/* End opcode list */ | |
1408 | -GEN_OPCODE_MARK(end); | |
522 | +static always_inline void gen_store_spr(int reg, TCGv t) | |
523 | +{ | |
524 | + tcg_gen_st_tl(t, cpu_env, offsetof(CPUState, spr[reg])); | |
525 | +} | |
1409 | 526 | |
1410 | 527 | /* Invalid instruction */ |
1411 | 528 | static void gen_invalid(DisasContext *ctx) |
... | ... | @@ -8803,6 +7920,856 @@ GEN_SPE(efdctsiz, speundef, 0x1D, 0x0B, 0x00180000, PPC_SPE_DOUBLE); |
8803 | 7920 | GEN_SPE(efdtstgt, efdtstlt, 0x1E, 0x0B, 0x00600000, PPC_SPE_DOUBLE); // |
8804 | 7921 | GEN_SPE(efdtsteq, speundef, 0x1F, 0x0B, 0x00600000, PPC_SPE_DOUBLE); // |
8805 | 7922 | |
7923 | +static opcode_t opcodes[] = { | |
7924 | +GEN_HANDLER(invalid, 0x00, 0x00, 0x00, 0xFFFFFFFF, PPC_NONE), | |
7925 | +GEN_HANDLER(cmp, 0x1F, 0x00, 0x00, 0x00400000, PPC_INTEGER), | |
7926 | +GEN_HANDLER(cmpi, 0x0B, 0xFF, 0xFF, 0x00400000, PPC_INTEGER), | |
7927 | +GEN_HANDLER(cmpl, 0x1F, 0x00, 0x01, 0x00400000, PPC_INTEGER), | |
7928 | +GEN_HANDLER(cmpli, 0x0A, 0xFF, 0xFF, 0x00400000, PPC_INTEGER), | |
7929 | +GEN_HANDLER(isel, 0x1F, 0x0F, 0xFF, 0x00000001, PPC_ISEL), | |
7930 | +GEN_HANDLER(addi, 0x0E, 0xFF, 0xFF, 0x00000000, PPC_INTEGER), | |
7931 | +GEN_HANDLER(addic, 0x0C, 0xFF, 0xFF, 0x00000000, PPC_INTEGER), | |
7932 | +GEN_HANDLER2(addic_, "addic.", 0x0D, 0xFF, 0xFF, 0x00000000, PPC_INTEGER), | |
7933 | +GEN_HANDLER(addis, 0x0F, 0xFF, 0xFF, 0x00000000, PPC_INTEGER), | |
7934 | +GEN_HANDLER(mulhw, 0x1F, 0x0B, 0x02, 0x00000400, PPC_INTEGER), | |
7935 | +GEN_HANDLER(mulhwu, 0x1F, 0x0B, 0x00, 0x00000400, PPC_INTEGER), | |
7936 | +GEN_HANDLER(mullw, 0x1F, 0x0B, 0x07, 0x00000000, PPC_INTEGER), | |
7937 | +GEN_HANDLER(mullwo, 0x1F, 0x0B, 0x17, 0x00000000, PPC_INTEGER), | |
7938 | +GEN_HANDLER(mulli, 0x07, 0xFF, 0xFF, 0x00000000, PPC_INTEGER), | |
7939 | +#if defined(TARGET_PPC64) | |
7940 | +GEN_HANDLER(mulld, 0x1F, 0x09, 0x07, 0x00000000, PPC_64B), | |
7941 | +#endif | |
7942 | +GEN_HANDLER(neg, 0x1F, 0x08, 0x03, 0x0000F800, PPC_INTEGER), | |
7943 | +GEN_HANDLER(nego, 0x1F, 0x08, 0x13, 0x0000F800, PPC_INTEGER), | |
7944 | +GEN_HANDLER(subfic, 0x08, 0xFF, 0xFF, 0x00000000, PPC_INTEGER), | |
7945 | +GEN_HANDLER2(andi_, "andi.", 0x1C, 0xFF, 0xFF, 0x00000000, PPC_INTEGER), | |
7946 | +GEN_HANDLER2(andis_, "andis.", 0x1D, 0xFF, 0xFF, 0x00000000, PPC_INTEGER), | |
7947 | +GEN_HANDLER(cntlzw, 0x1F, 0x1A, 0x00, 0x00000000, PPC_INTEGER), | |
7948 | +GEN_HANDLER(or, 0x1F, 0x1C, 0x0D, 0x00000000, PPC_INTEGER), | |
7949 | +GEN_HANDLER(xor, 0x1F, 0x1C, 0x09, 0x00000000, PPC_INTEGER), | |
7950 | +GEN_HANDLER(ori, 0x18, 0xFF, 0xFF, 0x00000000, PPC_INTEGER), | |
7951 | +GEN_HANDLER(oris, 0x19, 0xFF, 0xFF, 0x00000000, PPC_INTEGER), | |
7952 | +GEN_HANDLER(xori, 0x1A, 0xFF, 0xFF, 0x00000000, PPC_INTEGER), | |
7953 | +GEN_HANDLER(xoris, 0x1B, 0xFF, 0xFF, 0x00000000, PPC_INTEGER), | |
7954 | +GEN_HANDLER(popcntb, 0x1F, 0x03, 0x03, 0x0000F801, PPC_POPCNTB), | |
7955 | +#if defined(TARGET_PPC64) | |
7956 | +GEN_HANDLER(cntlzd, 0x1F, 0x1A, 0x01, 0x00000000, PPC_64B), | |
7957 | +#endif | |
7958 | +GEN_HANDLER(rlwimi, 0x14, 0xFF, 0xFF, 0x00000000, PPC_INTEGER), | |
7959 | +GEN_HANDLER(rlwinm, 0x15, 0xFF, 0xFF, 0x00000000, PPC_INTEGER), | |
7960 | +GEN_HANDLER(rlwnm, 0x17, 0xFF, 0xFF, 0x00000000, PPC_INTEGER), | |
7961 | +GEN_HANDLER(slw, 0x1F, 0x18, 0x00, 0x00000000, PPC_INTEGER), | |
7962 | +GEN_HANDLER(sraw, 0x1F, 0x18, 0x18, 0x00000000, PPC_INTEGER), | |
7963 | +GEN_HANDLER(srawi, 0x1F, 0x18, 0x19, 0x00000000, PPC_INTEGER), | |
7964 | +GEN_HANDLER(srw, 0x1F, 0x18, 0x10, 0x00000000, PPC_INTEGER), | |
7965 | +#if defined(TARGET_PPC64) | |
7966 | +GEN_HANDLER(sld, 0x1F, 0x1B, 0x00, 0x00000000, PPC_64B), | |
7967 | +GEN_HANDLER(srad, 0x1F, 0x1A, 0x18, 0x00000000, PPC_64B), | |
7968 | +GEN_HANDLER2(sradi0, "sradi", 0x1F, 0x1A, 0x19, 0x00000000, PPC_64B), | |
7969 | +GEN_HANDLER2(sradi1, "sradi", 0x1F, 0x1B, 0x19, 0x00000000, PPC_64B), | |
7970 | +GEN_HANDLER(srd, 0x1F, 0x1B, 0x10, 0x00000000, PPC_64B), | |
7971 | +#endif | |
7972 | +GEN_HANDLER(frsqrtes, 0x3B, 0x1A, 0xFF, 0x001F07C0, PPC_FLOAT_FRSQRTES), | |
7973 | +GEN_HANDLER(fsqrt, 0x3F, 0x16, 0xFF, 0x001F07C0, PPC_FLOAT_FSQRT), | |
7974 | +GEN_HANDLER(fsqrts, 0x3B, 0x16, 0xFF, 0x001F07C0, PPC_FLOAT_FSQRT), | |
7975 | +GEN_HANDLER(fcmpo, 0x3F, 0x00, 0x01, 0x00600001, PPC_FLOAT), | |
7976 | +GEN_HANDLER(fcmpu, 0x3F, 0x00, 0x00, 0x00600001, PPC_FLOAT), | |
7977 | +GEN_HANDLER(fmr, 0x3F, 0x08, 0x02, 0x001F0000, PPC_FLOAT), | |
7978 | +GEN_HANDLER(mcrfs, 0x3F, 0x00, 0x02, 0x0063F801, PPC_FLOAT), | |
7979 | +GEN_HANDLER(mffs, 0x3F, 0x07, 0x12, 0x001FF800, PPC_FLOAT), | |
7980 | +GEN_HANDLER(mtfsb0, 0x3F, 0x06, 0x02, 0x001FF800, PPC_FLOAT), | |
7981 | +GEN_HANDLER(mtfsb1, 0x3F, 0x06, 0x01, 0x001FF800, PPC_FLOAT), | |
7982 | +GEN_HANDLER(mtfsf, 0x3F, 0x07, 0x16, 0x00010000, PPC_FLOAT), | |
7983 | +GEN_HANDLER(mtfsfi, 0x3F, 0x06, 0x04, 0x006f0800, PPC_FLOAT), | |
7984 | +#if defined(TARGET_PPC64) | |
7985 | +GEN_HANDLER(ld, 0x3A, 0xFF, 0xFF, 0x00000000, PPC_64B), | |
7986 | +GEN_HANDLER(lq, 0x38, 0xFF, 0xFF, 0x00000000, PPC_64BX), | |
7987 | +GEN_HANDLER(std, 0x3E, 0xFF, 0xFF, 0x00000000, PPC_64B), | |
7988 | +#endif | |
7989 | +GEN_HANDLER(lmw, 0x2E, 0xFF, 0xFF, 0x00000000, PPC_INTEGER), | |
7990 | +GEN_HANDLER(stmw, 0x2F, 0xFF, 0xFF, 0x00000000, PPC_INTEGER), | |
7991 | +GEN_HANDLER(lswi, 0x1F, 0x15, 0x12, 0x00000001, PPC_STRING), | |
7992 | +GEN_HANDLER(lswx, 0x1F, 0x15, 0x10, 0x00000001, PPC_STRING), | |
7993 | +GEN_HANDLER(stswi, 0x1F, 0x15, 0x16, 0x00000001, PPC_STRING), | |
7994 | +GEN_HANDLER(stswx, 0x1F, 0x15, 0x14, 0x00000001, PPC_STRING), | |
7995 | +GEN_HANDLER(eieio, 0x1F, 0x16, 0x1A, 0x03FFF801, PPC_MEM_EIEIO), | |
7996 | +GEN_HANDLER(isync, 0x13, 0x16, 0x04, 0x03FFF801, PPC_MEM), | |
7997 | +GEN_HANDLER(lwarx, 0x1F, 0x14, 0x00, 0x00000001, PPC_RES), | |
7998 | +GEN_HANDLER2(stwcx_, "stwcx.", 0x1F, 0x16, 0x04, 0x00000000, PPC_RES), | |
7999 | +#if defined(TARGET_PPC64) | |
8000 | +GEN_HANDLER(ldarx, 0x1F, 0x14, 0x02, 0x00000001, PPC_64B), | |
8001 | +GEN_HANDLER2(stdcx_, "stdcx.", 0x1F, 0x16, 0x06, 0x00000000, PPC_64B), | |
8002 | +#endif | |
8003 | +GEN_HANDLER(sync, 0x1F, 0x16, 0x12, 0x039FF801, PPC_MEM_SYNC), | |
8004 | +GEN_HANDLER(wait, 0x1F, 0x1E, 0x01, 0x03FFF801, PPC_WAIT), | |
8005 | +GEN_HANDLER(b, 0x12, 0xFF, 0xFF, 0x00000000, PPC_FLOW), | |
8006 | +GEN_HANDLER(bc, 0x10, 0xFF, 0xFF, 0x00000000, PPC_FLOW), | |
8007 | +GEN_HANDLER(bcctr, 0x13, 0x10, 0x10, 0x00000000, PPC_FLOW), | |
8008 | +GEN_HANDLER(bclr, 0x13, 0x10, 0x00, 0x00000000, PPC_FLOW), | |
8009 | +GEN_HANDLER(mcrf, 0x13, 0x00, 0xFF, 0x00000001, PPC_INTEGER), | |
8010 | +GEN_HANDLER(rfi, 0x13, 0x12, 0x01, 0x03FF8001, PPC_FLOW), | |
8011 | +#if defined(TARGET_PPC64) | |
8012 | +GEN_HANDLER(rfid, 0x13, 0x12, 0x00, 0x03FF8001, PPC_64B), | |
8013 | +GEN_HANDLER(hrfid, 0x13, 0x12, 0x08, 0x03FF8001, PPC_64H), | |
8014 | +#endif | |
8015 | +GEN_HANDLER(sc, 0x11, 0xFF, 0xFF, 0x03FFF01D, PPC_FLOW), | |
8016 | +GEN_HANDLER(tw, 0x1F, 0x04, 0x00, 0x00000001, PPC_FLOW), | |
8017 | +GEN_HANDLER(twi, 0x03, 0xFF, 0xFF, 0x00000000, PPC_FLOW), | |
8018 | +#if defined(TARGET_PPC64) | |
8019 | +GEN_HANDLER(td, 0x1F, 0x04, 0x02, 0x00000001, PPC_64B), | |
8020 | +GEN_HANDLER(tdi, 0x02, 0xFF, 0xFF, 0x00000000, PPC_64B), | |
8021 | +#endif | |
8022 | +GEN_HANDLER(mcrxr, 0x1F, 0x00, 0x10, 0x007FF801, PPC_MISC), | |
8023 | +GEN_HANDLER(mfcr, 0x1F, 0x13, 0x00, 0x00000801, PPC_MISC), | |
8024 | +GEN_HANDLER(mfmsr, 0x1F, 0x13, 0x02, 0x001FF801, PPC_MISC), | |
8025 | +GEN_HANDLER(mfspr, 0x1F, 0x13, 0x0A, 0x00000001, PPC_MISC), | |
8026 | +GEN_HANDLER(mftb, 0x1F, 0x13, 0x0B, 0x00000001, PPC_MFTB), | |
8027 | +GEN_HANDLER(mtcrf, 0x1F, 0x10, 0x04, 0x00000801, PPC_MISC), | |
8028 | +#if defined(TARGET_PPC64) | |
8029 | +GEN_HANDLER(mtmsrd, 0x1F, 0x12, 0x05, 0x001EF801, PPC_64B), | |
8030 | +#endif | |
8031 | +GEN_HANDLER(mtmsr, 0x1F, 0x12, 0x04, 0x001FF801, PPC_MISC), | |
8032 | +GEN_HANDLER(mtspr, 0x1F, 0x13, 0x0E, 0x00000001, PPC_MISC), | |
8033 | +GEN_HANDLER(dcbf, 0x1F, 0x16, 0x02, 0x03C00001, PPC_CACHE), | |
8034 | +GEN_HANDLER(dcbi, 0x1F, 0x16, 0x0E, 0x03E00001, PPC_CACHE), | |
8035 | +GEN_HANDLER(dcbst, 0x1F, 0x16, 0x01, 0x03E00001, PPC_CACHE), | |
8036 | +GEN_HANDLER(dcbt, 0x1F, 0x16, 0x08, 0x02000001, PPC_CACHE), | |
8037 | +GEN_HANDLER(dcbtst, 0x1F, 0x16, 0x07, 0x02000001, PPC_CACHE), | |
8038 | +GEN_HANDLER(dcbz, 0x1F, 0x16, 0x1F, 0x03E00001, PPC_CACHE_DCBZ), | |
8039 | +GEN_HANDLER2(dcbz_970, "dcbz", 0x1F, 0x16, 0x1F, 0x03C00001, PPC_CACHE_DCBZT), | |
8040 | +GEN_HANDLER(dst, 0x1F, 0x16, 0x0A, 0x01800001, PPC_ALTIVEC), | |
8041 | +GEN_HANDLER(dstst, 0x1F, 0x16, 0x0B, 0x02000001, PPC_ALTIVEC), | |
8042 | +GEN_HANDLER(dss, 0x1F, 0x16, 0x19, 0x019FF801, PPC_ALTIVEC), | |
8043 | +GEN_HANDLER(icbi, 0x1F, 0x16, 0x1E, 0x03E00001, PPC_CACHE_ICBI), | |
8044 | +GEN_HANDLER(dcba, 0x1F, 0x16, 0x17, 0x03E00001, PPC_CACHE_DCBA), | |
8045 | +GEN_HANDLER(mfsr, 0x1F, 0x13, 0x12, 0x0010F801, PPC_SEGMENT), | |
8046 | +GEN_HANDLER(mfsrin, 0x1F, 0x13, 0x14, 0x001F0001, PPC_SEGMENT), | |
8047 | +GEN_HANDLER(mtsr, 0x1F, 0x12, 0x06, 0x0010F801, PPC_SEGMENT), | |
8048 | +GEN_HANDLER(mtsrin, 0x1F, 0x12, 0x07, 0x001F0001, PPC_SEGMENT), | |
8049 | +#if defined(TARGET_PPC64) | |
8050 | +GEN_HANDLER2(mfsr_64b, "mfsr", 0x1F, 0x13, 0x12, 0x0010F801, PPC_SEGMENT_64B), | |
8051 | +GEN_HANDLER2(mfsrin_64b, "mfsrin", 0x1F, 0x13, 0x14, 0x001F0001, | |
8052 | + PPC_SEGMENT_64B), | |
8053 | +GEN_HANDLER2(mtsr_64b, "mtsr", 0x1F, 0x12, 0x06, 0x0010F801, PPC_SEGMENT_64B), | |
8054 | +GEN_HANDLER2(mtsrin_64b, "mtsrin", 0x1F, 0x12, 0x07, 0x001F0001, | |
8055 | + PPC_SEGMENT_64B), | |
8056 | +GEN_HANDLER2(slbmte, "slbmte", 0x1F, 0x12, 0x0C, 0x00000000, PPC_SEGMENT_64B), | |
8057 | +#endif | |
8058 | +GEN_HANDLER(tlbia, 0x1F, 0x12, 0x0B, 0x03FFFC01, PPC_MEM_TLBIA), | |
8059 | +GEN_HANDLER(tlbiel, 0x1F, 0x12, 0x08, 0x03FF0001, PPC_MEM_TLBIE), | |
8060 | +GEN_HANDLER(tlbie, 0x1F, 0x12, 0x09, 0x03FF0001, PPC_MEM_TLBIE), | |
8061 | +GEN_HANDLER(tlbsync, 0x1F, 0x16, 0x11, 0x03FFF801, PPC_MEM_TLBSYNC), | |
8062 | +#if defined(TARGET_PPC64) | |
8063 | +GEN_HANDLER(slbia, 0x1F, 0x12, 0x0F, 0x03FFFC01, PPC_SLBI), | |
8064 | +GEN_HANDLER(slbie, 0x1F, 0x12, 0x0D, 0x03FF0001, PPC_SLBI), | |
8065 | +#endif | |
8066 | +GEN_HANDLER(eciwx, 0x1F, 0x16, 0x0D, 0x00000001, PPC_EXTERN), | |
8067 | +GEN_HANDLER(ecowx, 0x1F, 0x16, 0x09, 0x00000001, PPC_EXTERN), | |
8068 | +GEN_HANDLER(abs, 0x1F, 0x08, 0x0B, 0x0000F800, PPC_POWER_BR), | |
8069 | +GEN_HANDLER(abso, 0x1F, 0x08, 0x1B, 0x0000F800, PPC_POWER_BR), | |
8070 | +GEN_HANDLER(clcs, 0x1F, 0x10, 0x13, 0x0000F800, PPC_POWER_BR), | |
8071 | +GEN_HANDLER(div, 0x1F, 0x0B, 0x0A, 0x00000000, PPC_POWER_BR), | |
8072 | +GEN_HANDLER(divo, 0x1F, 0x0B, 0x1A, 0x00000000, PPC_POWER_BR), | |
8073 | +GEN_HANDLER(divs, 0x1F, 0x0B, 0x0B, 0x00000000, PPC_POWER_BR), | |
8074 | +GEN_HANDLER(divso, 0x1F, 0x0B, 0x1B, 0x00000000, PPC_POWER_BR), | |
8075 | +GEN_HANDLER(doz, 0x1F, 0x08, 0x08, 0x00000000, PPC_POWER_BR), | |
8076 | +GEN_HANDLER(dozo, 0x1F, 0x08, 0x18, 0x00000000, PPC_POWER_BR), | |
8077 | +GEN_HANDLER(dozi, 0x09, 0xFF, 0xFF, 0x00000000, PPC_POWER_BR), | |
8078 | +GEN_HANDLER(lscbx, 0x1F, 0x15, 0x08, 0x00000000, PPC_POWER_BR), | |
8079 | +GEN_HANDLER(maskg, 0x1F, 0x1D, 0x00, 0x00000000, PPC_POWER_BR), | |
8080 | +GEN_HANDLER(maskir, 0x1F, 0x1D, 0x10, 0x00000000, PPC_POWER_BR), | |
8081 | +GEN_HANDLER(mul, 0x1F, 0x0B, 0x03, 0x00000000, PPC_POWER_BR), | |
8082 | +GEN_HANDLER(mulo, 0x1F, 0x0B, 0x13, 0x00000000, PPC_POWER_BR), | |
8083 | +GEN_HANDLER(nabs, 0x1F, 0x08, 0x0F, 0x00000000, PPC_POWER_BR), | |
8084 | +GEN_HANDLER(nabso, 0x1F, 0x08, 0x1F, 0x00000000, PPC_POWER_BR), | |
8085 | +GEN_HANDLER(rlmi, 0x16, 0xFF, 0xFF, 0x00000000, PPC_POWER_BR), | |
8086 | +GEN_HANDLER(rrib, 0x1F, 0x19, 0x10, 0x00000000, PPC_POWER_BR), | |
8087 | +GEN_HANDLER(sle, 0x1F, 0x19, 0x04, 0x00000000, PPC_POWER_BR), | |
8088 | +GEN_HANDLER(sleq, 0x1F, 0x19, 0x06, 0x00000000, PPC_POWER_BR), | |
8089 | +GEN_HANDLER(sliq, 0x1F, 0x18, 0x05, 0x00000000, PPC_POWER_BR), | |
8090 | +GEN_HANDLER(slliq, 0x1F, 0x18, 0x07, 0x00000000, PPC_POWER_BR), | |
8091 | +GEN_HANDLER(sllq, 0x1F, 0x18, 0x06, 0x00000000, PPC_POWER_BR), | |
8092 | +GEN_HANDLER(slq, 0x1F, 0x18, 0x04, 0x00000000, PPC_POWER_BR), | |
8093 | +GEN_HANDLER(sraiq, 0x1F, 0x18, 0x1D, 0x00000000, PPC_POWER_BR), | |
8094 | +GEN_HANDLER(sraq, 0x1F, 0x18, 0x1C, 0x00000000, PPC_POWER_BR), | |
8095 | +GEN_HANDLER(sre, 0x1F, 0x19, 0x14, 0x00000000, PPC_POWER_BR), | |
8096 | +GEN_HANDLER(srea, 0x1F, 0x19, 0x1C, 0x00000000, PPC_POWER_BR), | |
8097 | +GEN_HANDLER(sreq, 0x1F, 0x19, 0x16, 0x00000000, PPC_POWER_BR), | |
8098 | +GEN_HANDLER(sriq, 0x1F, 0x18, 0x15, 0x00000000, PPC_POWER_BR), | |
8099 | +GEN_HANDLER(srliq, 0x1F, 0x18, 0x17, 0x00000000, PPC_POWER_BR), | |
8100 | +GEN_HANDLER(srlq, 0x1F, 0x18, 0x16, 0x00000000, PPC_POWER_BR), | |
8101 | +GEN_HANDLER(srq, 0x1F, 0x18, 0x14, 0x00000000, PPC_POWER_BR), | |
8102 | +GEN_HANDLER(dsa, 0x1F, 0x14, 0x13, 0x03FFF801, PPC_602_SPEC), | |
8103 | +GEN_HANDLER(esa, 0x1F, 0x14, 0x12, 0x03FFF801, PPC_602_SPEC), | |
8104 | +GEN_HANDLER(mfrom, 0x1F, 0x09, 0x08, 0x03E0F801, PPC_602_SPEC), | |
8105 | +GEN_HANDLER2(tlbld_6xx, "tlbld", 0x1F, 0x12, 0x1E, 0x03FF0001, PPC_6xx_TLB), | |
8106 | +GEN_HANDLER2(tlbli_6xx, "tlbli", 0x1F, 0x12, 0x1F, 0x03FF0001, PPC_6xx_TLB), | |
8107 | +GEN_HANDLER2(tlbld_74xx, "tlbld", 0x1F, 0x12, 0x1E, 0x03FF0001, PPC_74xx_TLB), | |
8108 | +GEN_HANDLER2(tlbli_74xx, "tlbli", 0x1F, 0x12, 0x1F, 0x03FF0001, PPC_74xx_TLB), | |
8109 | +GEN_HANDLER(clf, 0x1F, 0x16, 0x03, 0x03E00000, PPC_POWER), | |
8110 | +GEN_HANDLER(cli, 0x1F, 0x16, 0x0F, 0x03E00000, PPC_POWER), | |
8111 | +GEN_HANDLER(dclst, 0x1F, 0x16, 0x13, 0x03E00000, PPC_POWER), | |
8112 | +GEN_HANDLER(mfsri, 0x1F, 0x13, 0x13, 0x00000001, PPC_POWER), | |
8113 | +GEN_HANDLER(rac, 0x1F, 0x12, 0x19, 0x00000001, PPC_POWER), | |
8114 | +GEN_HANDLER(rfsvc, 0x13, 0x12, 0x02, 0x03FFF0001, PPC_POWER), | |
8115 | +GEN_HANDLER(lfq, 0x38, 0xFF, 0xFF, 0x00000003, PPC_POWER2), | |
8116 | +GEN_HANDLER(lfqu, 0x39, 0xFF, 0xFF, 0x00000003, PPC_POWER2), | |
8117 | +GEN_HANDLER(lfqux, 0x1F, 0x17, 0x19, 0x00000001, PPC_POWER2), | |
8118 | +GEN_HANDLER(lfqx, 0x1F, 0x17, 0x18, 0x00000001, PPC_POWER2), | |
8119 | +GEN_HANDLER(stfq, 0x3C, 0xFF, 0xFF, 0x00000003, PPC_POWER2), | |
8120 | +GEN_HANDLER(stfqu, 0x3D, 0xFF, 0xFF, 0x00000003, PPC_POWER2), | |
8121 | +GEN_HANDLER(stfqux, 0x1F, 0x17, 0x1D, 0x00000001, PPC_POWER2), | |
8122 | +GEN_HANDLER(stfqx, 0x1F, 0x17, 0x1C, 0x00000001, PPC_POWER2), | |
8123 | +GEN_HANDLER(mfapidi, 0x1F, 0x13, 0x08, 0x0000F801, PPC_MFAPIDI), | |
8124 | +GEN_HANDLER(tlbiva, 0x1F, 0x12, 0x18, 0x03FFF801, PPC_TLBIVA), | |
8125 | +GEN_HANDLER(mfdcr, 0x1F, 0x03, 0x0A, 0x00000001, PPC_DCR), | |
8126 | +GEN_HANDLER(mtdcr, 0x1F, 0x03, 0x0E, 0x00000001, PPC_DCR), | |
8127 | +GEN_HANDLER(mfdcrx, 0x1F, 0x03, 0x08, 0x00000000, PPC_DCRX), | |
8128 | +GEN_HANDLER(mtdcrx, 0x1F, 0x03, 0x0C, 0x00000000, PPC_DCRX), | |
8129 | +GEN_HANDLER(mfdcrux, 0x1F, 0x03, 0x09, 0x00000000, PPC_DCRUX), | |
8130 | +GEN_HANDLER(mtdcrux, 0x1F, 0x03, 0x0D, 0x00000000, PPC_DCRUX), | |
8131 | +GEN_HANDLER(dccci, 0x1F, 0x06, 0x0E, 0x03E00001, PPC_4xx_COMMON), | |
8132 | +GEN_HANDLER(dcread, 0x1F, 0x06, 0x0F, 0x00000001, PPC_4xx_COMMON), | |
8133 | +GEN_HANDLER2(icbt_40x, "icbt", 0x1F, 0x06, 0x08, 0x03E00001, PPC_40x_ICBT), | |
8134 | +GEN_HANDLER(iccci, 0x1F, 0x06, 0x1E, 0x00000001, PPC_4xx_COMMON), | |
8135 | +GEN_HANDLER(icread, 0x1F, 0x06, 0x1F, 0x03E00001, PPC_4xx_COMMON), | |
8136 | +GEN_HANDLER2(rfci_40x, "rfci", 0x13, 0x13, 0x01, 0x03FF8001, PPC_40x_EXCP), | |
8137 | +GEN_HANDLER(rfci, 0x13, 0x13, 0x01, 0x03FF8001, PPC_BOOKE), | |
8138 | +GEN_HANDLER(rfdi, 0x13, 0x07, 0x01, 0x03FF8001, PPC_RFDI), | |
8139 | +GEN_HANDLER(rfmci, 0x13, 0x06, 0x01, 0x03FF8001, PPC_RFMCI), | |
8140 | +GEN_HANDLER2(tlbre_40x, "tlbre", 0x1F, 0x12, 0x1D, 0x00000001, PPC_40x_TLB), | |
8141 | +GEN_HANDLER2(tlbsx_40x, "tlbsx", 0x1F, 0x12, 0x1C, 0x00000000, PPC_40x_TLB), | |
8142 | +GEN_HANDLER2(tlbwe_40x, "tlbwe", 0x1F, 0x12, 0x1E, 0x00000001, PPC_40x_TLB), | |
8143 | +GEN_HANDLER2(tlbre_440, "tlbre", 0x1F, 0x12, 0x1D, 0x00000001, PPC_BOOKE), | |
8144 | +GEN_HANDLER2(tlbsx_440, "tlbsx", 0x1F, 0x12, 0x1C, 0x00000000, PPC_BOOKE), | |
8145 | +GEN_HANDLER2(tlbwe_440, "tlbwe", 0x1F, 0x12, 0x1E, 0x00000001, PPC_BOOKE), | |
8146 | +GEN_HANDLER(wrtee, 0x1F, 0x03, 0x04, 0x000FFC01, PPC_WRTEE), | |
8147 | +GEN_HANDLER(wrteei, 0x1F, 0x03, 0x05, 0x000EFC01, PPC_WRTEE), | |
8148 | +GEN_HANDLER(dlmzb, 0x1F, 0x0E, 0x02, 0x00000000, PPC_440_SPEC), | |
8149 | +GEN_HANDLER(mbar, 0x1F, 0x16, 0x1a, 0x001FF801, PPC_BOOKE), | |
8150 | +GEN_HANDLER(msync, 0x1F, 0x16, 0x12, 0x03FFF801, PPC_BOOKE), | |
8151 | +GEN_HANDLER2(icbt_440, "icbt", 0x1F, 0x16, 0x00, 0x03E00001, PPC_BOOKE), | |
8152 | +GEN_HANDLER(lvsl, 0x1f, 0x06, 0x00, 0x00000001, PPC_ALTIVEC), | |
8153 | +GEN_HANDLER(lvsr, 0x1f, 0x06, 0x01, 0x00000001, PPC_ALTIVEC), | |
8154 | +GEN_HANDLER(mfvscr, 0x04, 0x2, 0x18, 0x001ff800, PPC_ALTIVEC), | |
8155 | +GEN_HANDLER(mtvscr, 0x04, 0x2, 0x19, 0x03ff0000, PPC_ALTIVEC), | |
8156 | +GEN_HANDLER(vsldoi, 0x04, 0x16, 0xFF, 0x00000400, PPC_ALTIVEC), | |
8157 | +GEN_HANDLER(vmladduhm, 0x04, 0x11, 0xFF, 0x00000000, PPC_ALTIVEC), | |
8158 | +GEN_HANDLER2(evsel0, "evsel", 0x04, 0x1c, 0x09, 0x00000000, PPC_SPE), | |
8159 | +GEN_HANDLER2(evsel1, "evsel", 0x04, 0x1d, 0x09, 0x00000000, PPC_SPE), | |
8160 | +GEN_HANDLER2(evsel2, "evsel", 0x04, 0x1e, 0x09, 0x00000000, PPC_SPE), | |
8161 | +GEN_HANDLER2(evsel3, "evsel", 0x04, 0x1f, 0x09, 0x00000000, PPC_SPE), | |
8162 | + | |
8163 | +#undef GEN_INT_ARITH_ADD | |
8164 | +#undef GEN_INT_ARITH_ADD_CONST | |
8165 | +#define GEN_INT_ARITH_ADD(name, opc3, add_ca, compute_ca, compute_ov) \ | |
8166 | +GEN_HANDLER(name, 0x1F, 0x0A, opc3, 0x00000000, PPC_INTEGER), | |
8167 | +#define GEN_INT_ARITH_ADD_CONST(name, opc3, const_val, \ | |
8168 | + add_ca, compute_ca, compute_ov) \ | |
8169 | +GEN_HANDLER(name, 0x1F, 0x0A, opc3, 0x0000F800, PPC_INTEGER), | |
8170 | +GEN_INT_ARITH_ADD(add, 0x08, 0, 0, 0) | |
8171 | +GEN_INT_ARITH_ADD(addo, 0x18, 0, 0, 1) | |
8172 | +GEN_INT_ARITH_ADD(addc, 0x00, 0, 1, 0) | |
8173 | +GEN_INT_ARITH_ADD(addco, 0x10, 0, 1, 1) | |
8174 | +GEN_INT_ARITH_ADD(adde, 0x04, 1, 1, 0) | |
8175 | +GEN_INT_ARITH_ADD(addeo, 0x14, 1, 1, 1) | |
8176 | +GEN_INT_ARITH_ADD_CONST(addme, 0x07, -1LL, 1, 1, 0) | |
8177 | +GEN_INT_ARITH_ADD_CONST(addmeo, 0x17, -1LL, 1, 1, 1) | |
8178 | +GEN_INT_ARITH_ADD_CONST(addze, 0x06, 0, 1, 1, 0) | |
8179 | +GEN_INT_ARITH_ADD_CONST(addzeo, 0x16, 0, 1, 1, 1) | |
8180 | + | |
8181 | +#undef GEN_INT_ARITH_DIVW | |
8182 | +#define GEN_INT_ARITH_DIVW(name, opc3, sign, compute_ov) \ | |
8183 | +GEN_HANDLER(name, 0x1F, 0x0B, opc3, 0x00000000, PPC_INTEGER) | |
8184 | +GEN_INT_ARITH_DIVW(divwu, 0x0E, 0, 0), | |
8185 | +GEN_INT_ARITH_DIVW(divwuo, 0x1E, 0, 1), | |
8186 | +GEN_INT_ARITH_DIVW(divw, 0x0F, 1, 0), | |
8187 | +GEN_INT_ARITH_DIVW(divwo, 0x1F, 1, 1), | |
8188 | + | |
8189 | +#if defined(TARGET_PPC64) | |
8190 | +#undef GEN_INT_ARITH_DIVD | |
8191 | +#define GEN_INT_ARITH_DIVD(name, opc3, sign, compute_ov) \ | |
8192 | +GEN_HANDLER(name, 0x1F, 0x09, opc3, 0x00000000, PPC_64B) | |
8193 | +GEN_INT_ARITH_DIVD(divdu, 0x0E, 0, 0), | |
8194 | +GEN_INT_ARITH_DIVD(divduo, 0x1E, 0, 1), | |
8195 | +GEN_INT_ARITH_DIVD(divd, 0x0F, 1, 0), | |
8196 | +GEN_INT_ARITH_DIVD(divdo, 0x1F, 1, 1), | |
8197 | + | |
8198 | +#undef GEN_INT_ARITH_MUL_HELPER | |
8199 | +#define GEN_INT_ARITH_MUL_HELPER(name, opc3) \ | |
8200 | +GEN_HANDLER(name, 0x1F, 0x09, opc3, 0x00000000, PPC_64B) | |
8201 | +GEN_INT_ARITH_MUL_HELPER(mulhdu, 0x00), | |
8202 | +GEN_INT_ARITH_MUL_HELPER(mulhd, 0x02), | |
8203 | +GEN_INT_ARITH_MUL_HELPER(mulldo, 0x17), | |
8204 | +#endif | |
8205 | + | |
8206 | +#undef GEN_INT_ARITH_SUBF | |
8207 | +#undef GEN_INT_ARITH_SUBF_CONST | |
8208 | +#define GEN_INT_ARITH_SUBF(name, opc3, add_ca, compute_ca, compute_ov) \ | |
8209 | +GEN_HANDLER(name, 0x1F, 0x08, opc3, 0x00000000, PPC_INTEGER), | |
8210 | +#define GEN_INT_ARITH_SUBF_CONST(name, opc3, const_val, \ | |
8211 | + add_ca, compute_ca, compute_ov) \ | |
8212 | +GEN_HANDLER(name, 0x1F, 0x08, opc3, 0x0000F800, PPC_INTEGER), | |
8213 | +GEN_INT_ARITH_SUBF(subf, 0x01, 0, 0, 0) | |
8214 | +GEN_INT_ARITH_SUBF(subfo, 0x11, 0, 0, 1) | |
8215 | +GEN_INT_ARITH_SUBF(subfc, 0x00, 0, 1, 0) | |
8216 | +GEN_INT_ARITH_SUBF(subfco, 0x10, 0, 1, 1) | |
8217 | +GEN_INT_ARITH_SUBF(subfe, 0x04, 1, 1, 0) | |
8218 | +GEN_INT_ARITH_SUBF(subfeo, 0x14, 1, 1, 1) | |
8219 | +GEN_INT_ARITH_SUBF_CONST(subfme, 0x07, -1LL, 1, 1, 0) | |
8220 | +GEN_INT_ARITH_SUBF_CONST(subfmeo, 0x17, -1LL, 1, 1, 1) | |
8221 | +GEN_INT_ARITH_SUBF_CONST(subfze, 0x06, 0, 1, 1, 0) | |
8222 | +GEN_INT_ARITH_SUBF_CONST(subfzeo, 0x16, 0, 1, 1, 1) | |
8223 | + | |
8224 | +#undef GEN_LOGICAL1 | |
8225 | +#undef GEN_LOGICAL2 | |
8226 | +#define GEN_LOGICAL2(name, tcg_op, opc, type) \ | |
8227 | +GEN_HANDLER(name, 0x1F, 0x1C, opc, 0x00000000, type) | |
8228 | +#define GEN_LOGICAL1(name, tcg_op, opc, type) \ | |
8229 | +GEN_HANDLER(name, 0x1F, 0x1A, opc, 0x00000000, type) | |
8230 | +GEN_LOGICAL2(and, tcg_gen_and_tl, 0x00, PPC_INTEGER), | |
8231 | +GEN_LOGICAL2(andc, tcg_gen_andc_tl, 0x01, PPC_INTEGER), | |
8232 | +GEN_LOGICAL2(eqv, tcg_gen_eqv_tl, 0x08, PPC_INTEGER), | |
8233 | +GEN_LOGICAL1(extsb, tcg_gen_ext8s_tl, 0x1D, PPC_INTEGER), | |
8234 | +GEN_LOGICAL1(extsh, tcg_gen_ext16s_tl, 0x1C, PPC_INTEGER), | |
8235 | +GEN_LOGICAL2(nand, tcg_gen_nand_tl, 0x0E, PPC_INTEGER), | |
8236 | +GEN_LOGICAL2(nor, tcg_gen_nor_tl, 0x03, PPC_INTEGER), | |
8237 | +GEN_LOGICAL2(orc, tcg_gen_orc_tl, 0x0C, PPC_INTEGER), | |
8238 | +#if defined(TARGET_PPC64) | |
8239 | +GEN_LOGICAL1(extsw, tcg_gen_ext32s_tl, 0x1E, PPC_64B), | |
8240 | +#endif | |
8241 | + | |
8242 | +#if defined(TARGET_PPC64) | |
8243 | +#undef GEN_PPC64_R2 | |
8244 | +#undef GEN_PPC64_R4 | |
8245 | +#define GEN_PPC64_R2(name, opc1, opc2) \ | |
8246 | +GEN_HANDLER2(name##0, stringify(name), opc1, opc2, 0xFF, 0x00000000, PPC_64B),\ | |
8247 | +GEN_HANDLER2(name##1, stringify(name), opc1, opc2 | 0x10, 0xFF, 0x00000000, \ | |
8248 | + PPC_64B) | |
8249 | +#define GEN_PPC64_R4(name, opc1, opc2) \ | |
8250 | +GEN_HANDLER2(name##0, stringify(name), opc1, opc2, 0xFF, 0x00000000, PPC_64B),\ | |
8251 | +GEN_HANDLER2(name##1, stringify(name), opc1, opc2 | 0x01, 0xFF, 0x00000000, \ | |
8252 | + PPC_64B), \ | |
8253 | +GEN_HANDLER2(name##2, stringify(name), opc1, opc2 | 0x10, 0xFF, 0x00000000, \ | |
8254 | + PPC_64B), \ | |
8255 | +GEN_HANDLER2(name##3, stringify(name), opc1, opc2 | 0x11, 0xFF, 0x00000000, \ | |
8256 | + PPC_64B) | |
8257 | +GEN_PPC64_R4(rldicl, 0x1E, 0x00), | |
8258 | +GEN_PPC64_R4(rldicr, 0x1E, 0x02), | |
8259 | +GEN_PPC64_R4(rldic, 0x1E, 0x04), | |
8260 | +GEN_PPC64_R2(rldcl, 0x1E, 0x08), | |
8261 | +GEN_PPC64_R2(rldcr, 0x1E, 0x09), | |
8262 | +GEN_PPC64_R4(rldimi, 0x1E, 0x06), | |
8263 | +#endif | |
8264 | + | |
8265 | +#undef _GEN_FLOAT_ACB | |
8266 | +#undef GEN_FLOAT_ACB | |
8267 | +#undef _GEN_FLOAT_AB | |
8268 | +#undef GEN_FLOAT_AB | |
8269 | +#undef _GEN_FLOAT_AC | |
8270 | +#undef GEN_FLOAT_AC | |
8271 | +#undef GEN_FLOAT_B | |
8272 | +#undef GEN_FLOAT_BS | |
8273 | +#define _GEN_FLOAT_ACB(name, op, op1, op2, isfloat, set_fprf, type) \ | |
8274 | +GEN_HANDLER(f##name, op1, op2, 0xFF, 0x00000000, type) | |
8275 | +#define GEN_FLOAT_ACB(name, op2, set_fprf, type) \ | |
8276 | +_GEN_FLOAT_ACB(name, name, 0x3F, op2, 0, set_fprf, type), \ | |
8277 | +_GEN_FLOAT_ACB(name##s, name, 0x3B, op2, 1, set_fprf, type) | |
8278 | +#define _GEN_FLOAT_AB(name, op, op1, op2, inval, isfloat, set_fprf, type) \ | |
8279 | +GEN_HANDLER(f##name, op1, op2, 0xFF, inval, type) | |
8280 | +#define GEN_FLOAT_AB(name, op2, inval, set_fprf, type) \ | |
8281 | +_GEN_FLOAT_AB(name, name, 0x3F, op2, inval, 0, set_fprf, type), \ | |
8282 | +_GEN_FLOAT_AB(name##s, name, 0x3B, op2, inval, 1, set_fprf, type) | |
8283 | +#define _GEN_FLOAT_AC(name, op, op1, op2, inval, isfloat, set_fprf, type) \ | |
8284 | +GEN_HANDLER(f##name, op1, op2, 0xFF, inval, type) | |
8285 | +#define GEN_FLOAT_AC(name, op2, inval, set_fprf, type) \ | |
8286 | +_GEN_FLOAT_AC(name, name, 0x3F, op2, inval, 0, set_fprf, type), \ | |
8287 | +_GEN_FLOAT_AC(name##s, name, 0x3B, op2, inval, 1, set_fprf, type) | |
8288 | +#define GEN_FLOAT_B(name, op2, op3, set_fprf, type) \ | |
8289 | +GEN_HANDLER(f##name, 0x3F, op2, op3, 0x001F0000, type) | |
8290 | +#define GEN_FLOAT_BS(name, op1, op2, set_fprf, type) \ | |
8291 | +GEN_HANDLER(f##name, op1, op2, 0xFF, 0x001F07C0, type) | |
8292 | + | |
8293 | +GEN_FLOAT_AB(add, 0x15, 0x000007C0, 1, PPC_FLOAT), | |
8294 | +GEN_FLOAT_AB(div, 0x12, 0x000007C0, 1, PPC_FLOAT), | |
8295 | +GEN_FLOAT_AC(mul, 0x19, 0x0000F800, 1, PPC_FLOAT), | |
8296 | +GEN_FLOAT_BS(re, 0x3F, 0x18, 1, PPC_FLOAT_EXT), | |
8297 | +GEN_FLOAT_BS(res, 0x3B, 0x18, 1, PPC_FLOAT_FRES), | |
8298 | +GEN_FLOAT_BS(rsqrte, 0x3F, 0x1A, 1, PPC_FLOAT_FRSQRTE), | |
8299 | +_GEN_FLOAT_ACB(sel, sel, 0x3F, 0x17, 0, 0, PPC_FLOAT_FSEL), | |
8300 | +GEN_FLOAT_AB(sub, 0x14, 0x000007C0, 1, PPC_FLOAT), | |
8301 | +GEN_FLOAT_ACB(madd, 0x1D, 1, PPC_FLOAT), | |
8302 | +GEN_FLOAT_ACB(msub, 0x1C, 1, PPC_FLOAT), | |
8303 | +GEN_FLOAT_ACB(nmadd, 0x1F, 1, PPC_FLOAT), | |
8304 | +GEN_FLOAT_ACB(nmsub, 0x1E, 1, PPC_FLOAT), | |
8305 | +GEN_FLOAT_B(ctiw, 0x0E, 0x00, 0, PPC_FLOAT), | |
8306 | +GEN_FLOAT_B(ctiwz, 0x0F, 0x00, 0, PPC_FLOAT), | |
8307 | +GEN_FLOAT_B(rsp, 0x0C, 0x00, 1, PPC_FLOAT), | |
8308 | +#if defined(TARGET_PPC64) | |
8309 | +GEN_FLOAT_B(cfid, 0x0E, 0x1A, 1, PPC_64B), | |
8310 | +GEN_FLOAT_B(ctid, 0x0E, 0x19, 0, PPC_64B), | |
8311 | +GEN_FLOAT_B(ctidz, 0x0F, 0x19, 0, PPC_64B), | |
8312 | +#endif | |
8313 | +GEN_FLOAT_B(rin, 0x08, 0x0C, 1, PPC_FLOAT_EXT), | |
8314 | +GEN_FLOAT_B(riz, 0x08, 0x0D, 1, PPC_FLOAT_EXT), | |
8315 | +GEN_FLOAT_B(rip, 0x08, 0x0E, 1, PPC_FLOAT_EXT), | |
8316 | +GEN_FLOAT_B(rim, 0x08, 0x0F, 1, PPC_FLOAT_EXT), | |
8317 | +GEN_FLOAT_B(abs, 0x08, 0x08, 0, PPC_FLOAT), | |
8318 | +GEN_FLOAT_B(nabs, 0x08, 0x04, 0, PPC_FLOAT), | |
8319 | +GEN_FLOAT_B(neg, 0x08, 0x01, 0, PPC_FLOAT), | |
8320 | + | |
8321 | +#undef GEN_LD | |
8322 | +#undef GEN_LDU | |
8323 | +#undef GEN_LDUX | |
8324 | +#undef GEN_LDX | |
8325 | +#undef GEN_LDS | |
8326 | +#define GEN_LD(name, ldop, opc, type) \ | |
8327 | +GEN_HANDLER(name, opc, 0xFF, 0xFF, 0x00000000, type), | |
8328 | +#define GEN_LDU(name, ldop, opc, type) \ | |
8329 | +GEN_HANDLER(name##u, opc, 0xFF, 0xFF, 0x00000000, type), | |
8330 | +#define GEN_LDUX(name, ldop, opc2, opc3, type) \ | |
8331 | +GEN_HANDLER(name##ux, 0x1F, opc2, opc3, 0x00000001, type), | |
8332 | +#define GEN_LDX(name, ldop, opc2, opc3, type) \ | |
8333 | +GEN_HANDLER(name##x, 0x1F, opc2, opc3, 0x00000001, type), | |
8334 | +#define GEN_LDS(name, ldop, op, type) \ | |
8335 | +GEN_LD(name, ldop, op | 0x20, type) \ | |
8336 | +GEN_LDU(name, ldop, op | 0x21, type) \ | |
8337 | +GEN_LDUX(name, ldop, 0x17, op | 0x01, type) \ | |
8338 | +GEN_LDX(name, ldop, 0x17, op | 0x00, type) | |
8339 | + | |
8340 | +GEN_LDS(lbz, ld8u, 0x02, PPC_INTEGER) | |
8341 | +GEN_LDS(lha, ld16s, 0x0A, PPC_INTEGER) | |
8342 | +GEN_LDS(lhz, ld16u, 0x08, PPC_INTEGER) | |
8343 | +GEN_LDS(lwz, ld32u, 0x00, PPC_INTEGER) | |
8344 | +#if defined(TARGET_PPC64) | |
8345 | +GEN_LDUX(lwa, ld32s, 0x15, 0x0B, PPC_64B) | |
8346 | +GEN_LDX(lwa, ld32s, 0x15, 0x0A, PPC_64B) | |
8347 | +GEN_LDUX(ld, ld64, 0x15, 0x01, PPC_64B) | |
8348 | +GEN_LDX(ld, ld64, 0x15, 0x00, PPC_64B) | |
8349 | +#endif | |
8350 | +GEN_LDX(lhbr, ld16ur, 0x16, 0x18, PPC_INTEGER) | |
8351 | +GEN_LDX(lwbr, ld32ur, 0x16, 0x10, PPC_INTEGER) | |
8352 | + | |
8353 | +#undef GEN_ST | |
8354 | +#undef GEN_STU | |
8355 | +#undef GEN_STUX | |
8356 | +#undef GEN_STX | |
8357 | +#undef GEN_STS | |
8358 | +#define GEN_ST(name, stop, opc, type) \ | |
8359 | +GEN_HANDLER(name, opc, 0xFF, 0xFF, 0x00000000, type), | |
8360 | +#define GEN_STU(name, stop, opc, type) \ | |
8361 | +GEN_HANDLER(stop##u, opc, 0xFF, 0xFF, 0x00000000, type), | |
8362 | +#define GEN_STUX(name, stop, opc2, opc3, type) \ | |
8363 | +GEN_HANDLER(name##ux, 0x1F, opc2, opc3, 0x00000001, type), | |
8364 | +#define GEN_STX(name, stop, opc2, opc3, type) \ | |
8365 | +GEN_HANDLER(name##x, 0x1F, opc2, opc3, 0x00000001, type), | |
8366 | +#define GEN_STS(name, stop, op, type) \ | |
8367 | +GEN_ST(name, stop, op | 0x20, type) \ | |
8368 | +GEN_STU(name, stop, op | 0x21, type) \ | |
8369 | +GEN_STUX(name, stop, 0x17, op | 0x01, type) \ | |
8370 | +GEN_STX(name, stop, 0x17, op | 0x00, type) | |
8371 | + | |
8372 | +GEN_STS(stb, st8, 0x06, PPC_INTEGER) | |
8373 | +GEN_STS(sth, st16, 0x0C, PPC_INTEGER) | |
8374 | +GEN_STS(stw, st32, 0x04, PPC_INTEGER) | |
8375 | +#if defined(TARGET_PPC64) | |
8376 | +GEN_STUX(std, st64, 0x15, 0x05, PPC_64B) | |
8377 | +GEN_STX(std, st64, 0x15, 0x04, PPC_64B) | |
8378 | +#endif | |
8379 | +GEN_STX(sthbr, st16r, 0x16, 0x1C, PPC_INTEGER) | |
8380 | +GEN_STX(stwbr, st32r, 0x16, 0x14, PPC_INTEGER) | |
8381 | + | |
8382 | +#undef GEN_LDF | |
8383 | +#undef GEN_LDUF | |
8384 | +#undef GEN_LDUXF | |
8385 | +#undef GEN_LDXF | |
8386 | +#undef GEN_LDFS | |
8387 | +#define GEN_LDF(name, ldop, opc, type) \ | |
8388 | +GEN_HANDLER(name, opc, 0xFF, 0xFF, 0x00000000, type), | |
8389 | +#define GEN_LDUF(name, ldop, opc, type) \ | |
8390 | +GEN_HANDLER(name##u, opc, 0xFF, 0xFF, 0x00000000, type), | |
8391 | +#define GEN_LDUXF(name, ldop, opc, type) \ | |
8392 | +GEN_HANDLER(name##ux, 0x1F, 0x17, opc, 0x00000001, type), | |
8393 | +#define GEN_LDXF(name, ldop, opc2, opc3, type) \ | |
8394 | +GEN_HANDLER(name##x, 0x1F, opc2, opc3, 0x00000001, type), | |
8395 | +#define GEN_LDFS(name, ldop, op, type) \ | |
8396 | +GEN_LDF(name, ldop, op | 0x20, type) \ | |
8397 | +GEN_LDUF(name, ldop, op | 0x21, type) \ | |
8398 | +GEN_LDUXF(name, ldop, op | 0x01, type) \ | |
8399 | +GEN_LDXF(name, ldop, 0x17, op | 0x00, type) | |
8400 | + | |
8401 | +GEN_LDFS(lfd, ld64, 0x12, PPC_FLOAT) | |
8402 | +GEN_LDFS(lfs, ld32fs, 0x10, PPC_FLOAT) | |
8403 | + | |
8404 | +#undef GEN_STF | |
8405 | +#undef GEN_STUF | |
8406 | +#undef GEN_STUXF | |
8407 | +#undef GEN_STXF | |
8408 | +#undef GEN_STFS | |
8409 | +#define GEN_STF(name, stop, opc, type) \ | |
8410 | +GEN_HANDLER(name, opc, 0xFF, 0xFF, 0x00000000, type), | |
8411 | +#define GEN_STUF(name, stop, opc, type) \ | |
8412 | +GEN_HANDLER(name##u, opc, 0xFF, 0xFF, 0x00000000, type), | |
8413 | +#define GEN_STUXF(name, stop, opc, type) \ | |
8414 | +GEN_HANDLER(name##ux, 0x1F, 0x17, opc, 0x00000001, type), | |
8415 | +#define GEN_STXF(name, stop, opc2, opc3, type) \ | |
8416 | +GEN_HANDLER(name##x, 0x1F, opc2, opc3, 0x00000001, type), | |
8417 | +#define GEN_STFS(name, stop, op, type) \ | |
8418 | +GEN_STF(name, stop, op | 0x20, type) \ | |
8419 | +GEN_STUF(name, stop, op | 0x21, type) \ | |
8420 | +GEN_STUXF(name, stop, op | 0x01, type) \ | |
8421 | +GEN_STXF(name, stop, 0x17, op | 0x00, type) | |
8422 | + | |
8423 | +GEN_STFS(stfd, st64, 0x16, PPC_FLOAT) | |
8424 | +GEN_STFS(stfs, st32fs, 0x14, PPC_FLOAT) | |
8425 | +GEN_STXF(stfiw, st32fiw, 0x17, 0x1E, PPC_FLOAT_STFIWX) | |
8426 | + | |
8427 | +#undef GEN_CRLOGIC | |
8428 | +#define GEN_CRLOGIC(name, tcg_op, opc) \ | |
8429 | +GEN_HANDLER(name, 0x13, 0x01, opc, 0x00000001, PPC_INTEGER) | |
8430 | +GEN_CRLOGIC(crand, tcg_gen_and_i32, 0x08), | |
8431 | +GEN_CRLOGIC(crandc, tcg_gen_andc_i32, 0x04), | |
8432 | +GEN_CRLOGIC(creqv, tcg_gen_eqv_i32, 0x09), | |
8433 | +GEN_CRLOGIC(crnand, tcg_gen_nand_i32, 0x07), | |
8434 | +GEN_CRLOGIC(crnor, tcg_gen_nor_i32, 0x01), | |
8435 | +GEN_CRLOGIC(cror, tcg_gen_or_i32, 0x0E), | |
8436 | +GEN_CRLOGIC(crorc, tcg_gen_orc_i32, 0x0D), | |
8437 | +GEN_CRLOGIC(crxor, tcg_gen_xor_i32, 0x06), | |
8438 | + | |
8439 | +#undef GEN_MAC_HANDLER | |
8440 | +#define GEN_MAC_HANDLER(name, opc2, opc3) \ | |
8441 | +GEN_HANDLER(name, 0x04, opc2, opc3, 0x00000000, PPC_405_MAC) | |
8442 | +GEN_MAC_HANDLER(macchw, 0x0C, 0x05), | |
8443 | +GEN_MAC_HANDLER(macchwo, 0x0C, 0x15), | |
8444 | +GEN_MAC_HANDLER(macchws, 0x0C, 0x07), | |
8445 | +GEN_MAC_HANDLER(macchwso, 0x0C, 0x17), | |
8446 | +GEN_MAC_HANDLER(macchwsu, 0x0C, 0x06), | |
8447 | +GEN_MAC_HANDLER(macchwsuo, 0x0C, 0x16), | |
8448 | +GEN_MAC_HANDLER(macchwu, 0x0C, 0x04), | |
8449 | +GEN_MAC_HANDLER(macchwuo, 0x0C, 0x14), | |
8450 | +GEN_MAC_HANDLER(machhw, 0x0C, 0x01), | |
8451 | +GEN_MAC_HANDLER(machhwo, 0x0C, 0x11), | |
8452 | +GEN_MAC_HANDLER(machhws, 0x0C, 0x03), | |
8453 | +GEN_MAC_HANDLER(machhwso, 0x0C, 0x13), | |
8454 | +GEN_MAC_HANDLER(machhwsu, 0x0C, 0x02), | |
8455 | +GEN_MAC_HANDLER(machhwsuo, 0x0C, 0x12), | |
8456 | +GEN_MAC_HANDLER(machhwu, 0x0C, 0x00), | |
8457 | +GEN_MAC_HANDLER(machhwuo, 0x0C, 0x10), | |
8458 | +GEN_MAC_HANDLER(maclhw, 0x0C, 0x0D), | |
8459 | +GEN_MAC_HANDLER(maclhwo, 0x0C, 0x1D), | |
8460 | +GEN_MAC_HANDLER(maclhws, 0x0C, 0x0F), | |
8461 | +GEN_MAC_HANDLER(maclhwso, 0x0C, 0x1F), | |
8462 | +GEN_MAC_HANDLER(maclhwu, 0x0C, 0x0C), | |
8463 | +GEN_MAC_HANDLER(maclhwuo, 0x0C, 0x1C), | |
8464 | +GEN_MAC_HANDLER(maclhwsu, 0x0C, 0x0E), | |
8465 | +GEN_MAC_HANDLER(maclhwsuo, 0x0C, 0x1E), | |
8466 | +GEN_MAC_HANDLER(nmacchw, 0x0E, 0x05), | |
8467 | +GEN_MAC_HANDLER(nmacchwo, 0x0E, 0x15), | |
8468 | +GEN_MAC_HANDLER(nmacchws, 0x0E, 0x07), | |
8469 | +GEN_MAC_HANDLER(nmacchwso, 0x0E, 0x17), | |
8470 | +GEN_MAC_HANDLER(nmachhw, 0x0E, 0x01), | |
8471 | +GEN_MAC_HANDLER(nmachhwo, 0x0E, 0x11), | |
8472 | +GEN_MAC_HANDLER(nmachhws, 0x0E, 0x03), | |
8473 | +GEN_MAC_HANDLER(nmachhwso, 0x0E, 0x13), | |
8474 | +GEN_MAC_HANDLER(nmaclhw, 0x0E, 0x0D), | |
8475 | +GEN_MAC_HANDLER(nmaclhwo, 0x0E, 0x1D), | |
8476 | +GEN_MAC_HANDLER(nmaclhws, 0x0E, 0x0F), | |
8477 | +GEN_MAC_HANDLER(nmaclhwso, 0x0E, 0x1F), | |
8478 | +GEN_MAC_HANDLER(mulchw, 0x08, 0x05), | |
8479 | +GEN_MAC_HANDLER(mulchwu, 0x08, 0x04), | |
8480 | +GEN_MAC_HANDLER(mulhhw, 0x08, 0x01), | |
8481 | +GEN_MAC_HANDLER(mulhhwu, 0x08, 0x00), | |
8482 | +GEN_MAC_HANDLER(mullhw, 0x08, 0x0D), | |
8483 | +GEN_MAC_HANDLER(mullhwu, 0x08, 0x0C), | |
8484 | + | |
8485 | +#undef GEN_VR_LDX | |
8486 | +#undef GEN_VR_STX | |
8487 | +#undef GEN_VR_LVE | |
8488 | +#undef GEN_VR_STVE | |
8489 | +#define GEN_VR_LDX(name, opc2, opc3) \ | |
8490 | +GEN_HANDLER(name, 0x1F, opc2, opc3, 0x00000001, PPC_ALTIVEC) | |
8491 | +#define GEN_VR_STX(name, opc2, opc3) \ | |
8492 | +GEN_HANDLER(st##name, 0x1F, opc2, opc3, 0x00000001, PPC_ALTIVEC) | |
8493 | +#define GEN_VR_LVE(name, opc2, opc3) \ | |
8494 | + GEN_HANDLER(lve##name, 0x1F, opc2, opc3, 0x00000001, PPC_ALTIVEC) | |
8495 | +#define GEN_VR_STVE(name, opc2, opc3) \ | |
8496 | + GEN_HANDLER(stve##name, 0x1F, opc2, opc3, 0x00000001, PPC_ALTIVEC) | |
8497 | +GEN_VR_LDX(lvx, 0x07, 0x03), | |
8498 | +GEN_VR_LDX(lvxl, 0x07, 0x0B), | |
8499 | +GEN_VR_LVE(bx, 0x07, 0x00), | |
8500 | +GEN_VR_LVE(hx, 0x07, 0x01), | |
8501 | +GEN_VR_LVE(wx, 0x07, 0x02), | |
8502 | +GEN_VR_STX(svx, 0x07, 0x07), | |
8503 | +GEN_VR_STX(svxl, 0x07, 0x0F), | |
8504 | +GEN_VR_STVE(bx, 0x07, 0x04), | |
8505 | +GEN_VR_STVE(hx, 0x07, 0x05), | |
8506 | +GEN_VR_STVE(wx, 0x07, 0x06), | |
8507 | + | |
8508 | +#undef GEN_VX_LOGICAL | |
8509 | +#define GEN_VX_LOGICAL(name, tcg_op, opc2, opc3) \ | |
8510 | +GEN_HANDLER(name, 0x04, opc2, opc3, 0x00000000, PPC_ALTIVEC) | |
8511 | +GEN_VX_LOGICAL(vand, tcg_gen_and_i64, 2, 16), | |
8512 | +GEN_VX_LOGICAL(vandc, tcg_gen_andc_i64, 2, 17), | |
8513 | +GEN_VX_LOGICAL(vor, tcg_gen_or_i64, 2, 18), | |
8514 | +GEN_VX_LOGICAL(vxor, tcg_gen_xor_i64, 2, 19), | |
8515 | +GEN_VX_LOGICAL(vnor, tcg_gen_nor_i64, 2, 20), | |
8516 | + | |
8517 | +#undef GEN_VXFORM | |
8518 | +#define GEN_VXFORM(name, opc2, opc3) \ | |
8519 | +GEN_HANDLER(name, 0x04, opc2, opc3, 0x00000000, PPC_ALTIVEC) | |
8520 | +GEN_VXFORM(vaddubm, 0, 0), | |
8521 | +GEN_VXFORM(vadduhm, 0, 1), | |
8522 | +GEN_VXFORM(vadduwm, 0, 2), | |
8523 | +GEN_VXFORM(vsububm, 0, 16), | |
8524 | +GEN_VXFORM(vsubuhm, 0, 17), | |
8525 | +GEN_VXFORM(vsubuwm, 0, 18), | |
8526 | +GEN_VXFORM(vmaxub, 1, 0), | |
8527 | +GEN_VXFORM(vmaxuh, 1, 1), | |
8528 | +GEN_VXFORM(vmaxuw, 1, 2), | |
8529 | +GEN_VXFORM(vmaxsb, 1, 4), | |
8530 | +GEN_VXFORM(vmaxsh, 1, 5), | |
8531 | +GEN_VXFORM(vmaxsw, 1, 6), | |
8532 | +GEN_VXFORM(vminub, 1, 8), | |
8533 | +GEN_VXFORM(vminuh, 1, 9), | |
8534 | +GEN_VXFORM(vminuw, 1, 10), | |
8535 | +GEN_VXFORM(vminsb, 1, 12), | |
8536 | +GEN_VXFORM(vminsh, 1, 13), | |
8537 | +GEN_VXFORM(vminsw, 1, 14), | |
8538 | +GEN_VXFORM(vavgub, 1, 16), | |
8539 | +GEN_VXFORM(vavguh, 1, 17), | |
8540 | +GEN_VXFORM(vavguw, 1, 18), | |
8541 | +GEN_VXFORM(vavgsb, 1, 20), | |
8542 | +GEN_VXFORM(vavgsh, 1, 21), | |
8543 | +GEN_VXFORM(vavgsw, 1, 22), | |
8544 | +GEN_VXFORM(vmrghb, 6, 0), | |
8545 | +GEN_VXFORM(vmrghh, 6, 1), | |
8546 | +GEN_VXFORM(vmrghw, 6, 2), | |
8547 | +GEN_VXFORM(vmrglb, 6, 4), | |
8548 | +GEN_VXFORM(vmrglh, 6, 5), | |
8549 | +GEN_VXFORM(vmrglw, 6, 6), | |
8550 | +GEN_VXFORM(vmuloub, 4, 0), | |
8551 | +GEN_VXFORM(vmulouh, 4, 1), | |
8552 | +GEN_VXFORM(vmulosb, 4, 4), | |
8553 | +GEN_VXFORM(vmulosh, 4, 5), | |
8554 | +GEN_VXFORM(vmuleub, 4, 8), | |
8555 | +GEN_VXFORM(vmuleuh, 4, 9), | |
8556 | +GEN_VXFORM(vmulesb, 4, 12), | |
8557 | +GEN_VXFORM(vmulesh, 4, 13), | |
8558 | +GEN_VXFORM(vslb, 2, 4), | |
8559 | +GEN_VXFORM(vslh, 2, 5), | |
8560 | +GEN_VXFORM(vslw, 2, 6), | |
8561 | +GEN_VXFORM(vsrb, 2, 8), | |
8562 | +GEN_VXFORM(vsrh, 2, 9), | |
8563 | +GEN_VXFORM(vsrw, 2, 10), | |
8564 | +GEN_VXFORM(vsrab, 2, 12), | |
8565 | +GEN_VXFORM(vsrah, 2, 13), | |
8566 | +GEN_VXFORM(vsraw, 2, 14), | |
8567 | +GEN_VXFORM(vslo, 6, 16), | |
8568 | +GEN_VXFORM(vsro, 6, 17), | |
8569 | +GEN_VXFORM(vaddcuw, 0, 6), | |
8570 | +GEN_VXFORM(vsubcuw, 0, 22), | |
8571 | +GEN_VXFORM(vaddubs, 0, 8), | |
8572 | +GEN_VXFORM(vadduhs, 0, 9), | |
8573 | +GEN_VXFORM(vadduws, 0, 10), | |
8574 | +GEN_VXFORM(vaddsbs, 0, 12), | |
8575 | +GEN_VXFORM(vaddshs, 0, 13), | |
8576 | +GEN_VXFORM(vaddsws, 0, 14), | |
8577 | +GEN_VXFORM(vsububs, 0, 24), | |
8578 | +GEN_VXFORM(vsubuhs, 0, 25), | |
8579 | +GEN_VXFORM(vsubuws, 0, 26), | |
8580 | +GEN_VXFORM(vsubsbs, 0, 28), | |
8581 | +GEN_VXFORM(vsubshs, 0, 29), | |
8582 | +GEN_VXFORM(vsubsws, 0, 30), | |
8583 | +GEN_VXFORM(vrlb, 2, 0), | |
8584 | +GEN_VXFORM(vrlh, 2, 1), | |
8585 | +GEN_VXFORM(vrlw, 2, 2), | |
8586 | +GEN_VXFORM(vsl, 2, 7), | |
8587 | +GEN_VXFORM(vsr, 2, 11), | |
8588 | +GEN_VXFORM(vpkuhum, 7, 0), | |
8589 | +GEN_VXFORM(vpkuwum, 7, 1), | |
8590 | +GEN_VXFORM(vpkuhus, 7, 2), | |
8591 | +GEN_VXFORM(vpkuwus, 7, 3), | |
8592 | +GEN_VXFORM(vpkshus, 7, 4), | |
8593 | +GEN_VXFORM(vpkswus, 7, 5), | |
8594 | +GEN_VXFORM(vpkshss, 7, 6), | |
8595 | +GEN_VXFORM(vpkswss, 7, 7), | |
8596 | +GEN_VXFORM(vpkpx, 7, 12), | |
8597 | +GEN_VXFORM(vsum4ubs, 4, 24), | |
8598 | +GEN_VXFORM(vsum4sbs, 4, 28), | |
8599 | +GEN_VXFORM(vsum4shs, 4, 25), | |
8600 | +GEN_VXFORM(vsum2sws, 4, 26), | |
8601 | +GEN_VXFORM(vsumsws, 4, 30), | |
8602 | +GEN_VXFORM(vaddfp, 5, 0), | |
8603 | +GEN_VXFORM(vsubfp, 5, 1), | |
8604 | +GEN_VXFORM(vmaxfp, 5, 16), | |
8605 | +GEN_VXFORM(vminfp, 5, 17), | |
8606 | + | |
8607 | +#undef GEN_VXRFORM1 | |
8608 | +#undef GEN_VXRFORM | |
8609 | +#define GEN_VXRFORM1(opname, name, str, opc2, opc3) \ | |
8610 | + GEN_HANDLER2(name, str, 0x4, opc2, opc3, 0x00000000, PPC_ALTIVEC), | |
8611 | +#define GEN_VXRFORM(name, opc2, opc3) \ | |
8612 | + GEN_VXRFORM1(name, name, #name, opc2, opc3) \ | |
8613 | + GEN_VXRFORM1(name##_dot, name##_, #name ".", opc2, (opc3 | (0x1 << 4))) | |
8614 | +GEN_VXRFORM(vcmpequb, 3, 0) | |
8615 | +GEN_VXRFORM(vcmpequh, 3, 1) | |
8616 | +GEN_VXRFORM(vcmpequw, 3, 2) | |
8617 | +GEN_VXRFORM(vcmpgtsb, 3, 12) | |
8618 | +GEN_VXRFORM(vcmpgtsh, 3, 13) | |
8619 | +GEN_VXRFORM(vcmpgtsw, 3, 14) | |
8620 | +GEN_VXRFORM(vcmpgtub, 3, 8) | |
8621 | +GEN_VXRFORM(vcmpgtuh, 3, 9) | |
8622 | +GEN_VXRFORM(vcmpgtuw, 3, 10) | |
8623 | +GEN_VXRFORM(vcmpeqfp, 3, 3) | |
8624 | +GEN_VXRFORM(vcmpgefp, 3, 7) | |
8625 | +GEN_VXRFORM(vcmpgtfp, 3, 11) | |
8626 | +GEN_VXRFORM(vcmpbfp, 3, 15) | |
8627 | + | |
8628 | +#undef GEN_VXFORM_SIMM | |
8629 | +#define GEN_VXFORM_SIMM(name, opc2, opc3) \ | |
8630 | + GEN_HANDLER(name, 0x04, opc2, opc3, 0x00000000, PPC_ALTIVEC) | |
8631 | +GEN_VXFORM_SIMM(vspltisb, 6, 12), | |
8632 | +GEN_VXFORM_SIMM(vspltish, 6, 13), | |
8633 | +GEN_VXFORM_SIMM(vspltisw, 6, 14), | |
8634 | + | |
8635 | +#undef GEN_VXFORM_NOA | |
8636 | +#define GEN_VXFORM_NOA(name, opc2, opc3) \ | |
8637 | + GEN_HANDLER(name, 0x04, opc2, opc3, 0x001f0000, PPC_ALTIVEC) | |
8638 | +GEN_VXFORM_NOA(vupkhsb, 7, 8), | |
8639 | +GEN_VXFORM_NOA(vupkhsh, 7, 9), | |
8640 | +GEN_VXFORM_NOA(vupklsb, 7, 10), | |
8641 | +GEN_VXFORM_NOA(vupklsh, 7, 11), | |
8642 | +GEN_VXFORM_NOA(vupkhpx, 7, 13), | |
8643 | +GEN_VXFORM_NOA(vupklpx, 7, 15), | |
8644 | +GEN_VXFORM_NOA(vrefp, 5, 4), | |
8645 | +GEN_VXFORM_NOA(vrsqrtefp, 5, 5), | |
8646 | +GEN_VXFORM_NOA(vlogefp, 5, 7), | |
8647 | +GEN_VXFORM_NOA(vrfim, 5, 8), | |
8648 | +GEN_VXFORM_NOA(vrfin, 5, 9), | |
8649 | +GEN_VXFORM_NOA(vrfip, 5, 10), | |
8650 | +GEN_VXFORM_NOA(vrfiz, 5, 11), | |
8651 | + | |
8652 | +#undef GEN_VXFORM_UIMM | |
8653 | +#define GEN_VXFORM_UIMM(name, opc2, opc3) \ | |
8654 | + GEN_HANDLER(name, 0x04, opc2, opc3, 0x00000000, PPC_ALTIVEC) | |
8655 | +GEN_VXFORM_UIMM(vspltb, 6, 8), | |
8656 | +GEN_VXFORM_UIMM(vsplth, 6, 9), | |
8657 | +GEN_VXFORM_UIMM(vspltw, 6, 10), | |
8658 | +GEN_VXFORM_UIMM(vcfux, 5, 12), | |
8659 | +GEN_VXFORM_UIMM(vcfsx, 5, 13), | |
8660 | +GEN_VXFORM_UIMM(vctuxs, 5, 14), | |
8661 | +GEN_VXFORM_UIMM(vctsxs, 5, 15), | |
8662 | + | |
8663 | +#undef GEN_VAFORM_PAIRED | |
8664 | +#define GEN_VAFORM_PAIRED(name0, name1, opc2) \ | |
8665 | + GEN_HANDLER(name0##_##name1, 0x04, opc2, 0xFF, 0x00000000, PPC_ALTIVEC) | |
8666 | +GEN_VAFORM_PAIRED(vmhaddshs, vmhraddshs, 16), | |
8667 | +GEN_VAFORM_PAIRED(vmsumubm, vmsummbm, 18), | |
8668 | +GEN_VAFORM_PAIRED(vmsumuhm, vmsumuhs, 19), | |
8669 | +GEN_VAFORM_PAIRED(vmsumshm, vmsumshs, 20), | |
8670 | +GEN_VAFORM_PAIRED(vsel, vperm, 21), | |
8671 | +GEN_VAFORM_PAIRED(vmaddfp, vnmsubfp, 23), | |
8672 | + | |
8673 | +#undef GEN_SPE | |
8674 | +#define GEN_SPE(name0, name1, opc2, opc3, inval, type) \ | |
8675 | +GEN_HANDLER(name0##_##name1, 0x04, opc2, opc3, inval, type) | |
8676 | +GEN_SPE(evaddw, speundef, 0x00, 0x08, 0x00000000, PPC_SPE), | |
8677 | +GEN_SPE(evaddiw, speundef, 0x01, 0x08, 0x00000000, PPC_SPE), | |
8678 | +GEN_SPE(evsubfw, speundef, 0x02, 0x08, 0x00000000, PPC_SPE), | |
8679 | +GEN_SPE(evsubifw, speundef, 0x03, 0x08, 0x00000000, PPC_SPE), | |
8680 | +GEN_SPE(evabs, evneg, 0x04, 0x08, 0x0000F800, PPC_SPE), | |
8681 | +GEN_SPE(evextsb, evextsh, 0x05, 0x08, 0x0000F800, PPC_SPE), | |
8682 | +GEN_SPE(evrndw, evcntlzw, 0x06, 0x08, 0x0000F800, PPC_SPE), | |
8683 | +GEN_SPE(evcntlsw, brinc, 0x07, 0x08, 0x00000000, PPC_SPE), | |
8684 | +GEN_SPE(speundef, evand, 0x08, 0x08, 0x00000000, PPC_SPE), | |
8685 | +GEN_SPE(evandc, speundef, 0x09, 0x08, 0x00000000, PPC_SPE), | |
8686 | +GEN_SPE(evxor, evor, 0x0B, 0x08, 0x00000000, PPC_SPE), | |
8687 | +GEN_SPE(evnor, eveqv, 0x0C, 0x08, 0x00000000, PPC_SPE), | |
8688 | +GEN_SPE(speundef, evorc, 0x0D, 0x08, 0x00000000, PPC_SPE), | |
8689 | +GEN_SPE(evnand, speundef, 0x0F, 0x08, 0x00000000, PPC_SPE), | |
8690 | +GEN_SPE(evsrwu, evsrws, 0x10, 0x08, 0x00000000, PPC_SPE), | |
8691 | +GEN_SPE(evsrwiu, evsrwis, 0x11, 0x08, 0x00000000, PPC_SPE), | |
8692 | +GEN_SPE(evslw, speundef, 0x12, 0x08, 0x00000000, PPC_SPE), | |
8693 | +GEN_SPE(evslwi, speundef, 0x13, 0x08, 0x00000000, PPC_SPE), | |
8694 | +GEN_SPE(evrlw, evsplati, 0x14, 0x08, 0x00000000, PPC_SPE), | |
8695 | +GEN_SPE(evrlwi, evsplatfi, 0x15, 0x08, 0x00000000, PPC_SPE), | |
8696 | +GEN_SPE(evmergehi, evmergelo, 0x16, 0x08, 0x00000000, PPC_SPE), | |
8697 | +GEN_SPE(evmergehilo, evmergelohi, 0x17, 0x08, 0x00000000, PPC_SPE), | |
8698 | +GEN_SPE(evcmpgtu, evcmpgts, 0x18, 0x08, 0x00600000, PPC_SPE), | |
8699 | +GEN_SPE(evcmpltu, evcmplts, 0x19, 0x08, 0x00600000, PPC_SPE), | |
8700 | +GEN_SPE(evcmpeq, speundef, 0x1A, 0x08, 0x00600000, PPC_SPE), | |
8701 | + | |
8702 | +GEN_SPE(evfsadd, evfssub, 0x00, 0x0A, 0x00000000, PPC_SPE_SINGLE), | |
8703 | +GEN_SPE(evfsabs, evfsnabs, 0x02, 0x0A, 0x0000F800, PPC_SPE_SINGLE), | |
8704 | +GEN_SPE(evfsneg, speundef, 0x03, 0x0A, 0x0000F800, PPC_SPE_SINGLE), | |
8705 | +GEN_SPE(evfsmul, evfsdiv, 0x04, 0x0A, 0x00000000, PPC_SPE_SINGLE), | |
8706 | +GEN_SPE(evfscmpgt, evfscmplt, 0x06, 0x0A, 0x00600000, PPC_SPE_SINGLE), | |
8707 | +GEN_SPE(evfscmpeq, speundef, 0x07, 0x0A, 0x00600000, PPC_SPE_SINGLE), | |
8708 | +GEN_SPE(evfscfui, evfscfsi, 0x08, 0x0A, 0x00180000, PPC_SPE_SINGLE), | |
8709 | +GEN_SPE(evfscfuf, evfscfsf, 0x09, 0x0A, 0x00180000, PPC_SPE_SINGLE), | |
8710 | +GEN_SPE(evfsctui, evfsctsi, 0x0A, 0x0A, 0x00180000, PPC_SPE_SINGLE), | |
8711 | +GEN_SPE(evfsctuf, evfsctsf, 0x0B, 0x0A, 0x00180000, PPC_SPE_SINGLE), | |
8712 | +GEN_SPE(evfsctuiz, speundef, 0x0C, 0x0A, 0x00180000, PPC_SPE_SINGLE), | |
8713 | +GEN_SPE(evfsctsiz, speundef, 0x0D, 0x0A, 0x00180000, PPC_SPE_SINGLE), | |
8714 | +GEN_SPE(evfststgt, evfststlt, 0x0E, 0x0A, 0x00600000, PPC_SPE_SINGLE), | |
8715 | +GEN_SPE(evfststeq, speundef, 0x0F, 0x0A, 0x00600000, PPC_SPE_SINGLE), | |
8716 | + | |
8717 | +GEN_SPE(efsadd, efssub, 0x00, 0x0B, 0x00000000, PPC_SPE_SINGLE), | |
8718 | +GEN_SPE(efsabs, efsnabs, 0x02, 0x0B, 0x0000F800, PPC_SPE_SINGLE), | |
8719 | +GEN_SPE(efsneg, speundef, 0x03, 0x0B, 0x0000F800, PPC_SPE_SINGLE), | |
8720 | +GEN_SPE(efsmul, efsdiv, 0x04, 0x0B, 0x00000000, PPC_SPE_SINGLE), | |
8721 | +GEN_SPE(efscmpgt, efscmplt, 0x06, 0x0B, 0x00600000, PPC_SPE_SINGLE), | |
8722 | +GEN_SPE(efscmpeq, efscfd, 0x07, 0x0B, 0x00600000, PPC_SPE_SINGLE), | |
8723 | +GEN_SPE(efscfui, efscfsi, 0x08, 0x0B, 0x00180000, PPC_SPE_SINGLE), | |
8724 | +GEN_SPE(efscfuf, efscfsf, 0x09, 0x0B, 0x00180000, PPC_SPE_SINGLE), | |
8725 | +GEN_SPE(efsctui, efsctsi, 0x0A, 0x0B, 0x00180000, PPC_SPE_SINGLE), | |
8726 | +GEN_SPE(efsctuf, efsctsf, 0x0B, 0x0B, 0x00180000, PPC_SPE_SINGLE), | |
8727 | +GEN_SPE(efsctuiz, speundef, 0x0C, 0x0B, 0x00180000, PPC_SPE_SINGLE), | |
8728 | +GEN_SPE(efsctsiz, speundef, 0x0D, 0x0B, 0x00180000, PPC_SPE_SINGLE), | |
8729 | +GEN_SPE(efststgt, efststlt, 0x0E, 0x0B, 0x00600000, PPC_SPE_SINGLE), | |
8730 | +GEN_SPE(efststeq, speundef, 0x0F, 0x0B, 0x00600000, PPC_SPE_SINGLE), | |
8731 | + | |
8732 | +GEN_SPE(efdadd, efdsub, 0x10, 0x0B, 0x00000000, PPC_SPE_DOUBLE), | |
8733 | +GEN_SPE(efdcfuid, efdcfsid, 0x11, 0x0B, 0x00180000, PPC_SPE_DOUBLE), | |
8734 | +GEN_SPE(efdabs, efdnabs, 0x12, 0x0B, 0x0000F800, PPC_SPE_DOUBLE), | |
8735 | +GEN_SPE(efdneg, speundef, 0x13, 0x0B, 0x0000F800, PPC_SPE_DOUBLE), | |
8736 | +GEN_SPE(efdmul, efddiv, 0x14, 0x0B, 0x00000000, PPC_SPE_DOUBLE), | |
8737 | +GEN_SPE(efdctuidz, efdctsidz, 0x15, 0x0B, 0x00180000, PPC_SPE_DOUBLE), | |
8738 | +GEN_SPE(efdcmpgt, efdcmplt, 0x16, 0x0B, 0x00600000, PPC_SPE_DOUBLE), | |
8739 | +GEN_SPE(efdcmpeq, efdcfs, 0x17, 0x0B, 0x00600000, PPC_SPE_DOUBLE), | |
8740 | +GEN_SPE(efdcfui, efdcfsi, 0x18, 0x0B, 0x00180000, PPC_SPE_DOUBLE), | |
8741 | +GEN_SPE(efdcfuf, efdcfsf, 0x19, 0x0B, 0x00180000, PPC_SPE_DOUBLE), | |
8742 | +GEN_SPE(efdctui, efdctsi, 0x1A, 0x0B, 0x00180000, PPC_SPE_DOUBLE), | |
8743 | +GEN_SPE(efdctuf, efdctsf, 0x1B, 0x0B, 0x00180000, PPC_SPE_DOUBLE), | |
8744 | +GEN_SPE(efdctuiz, speundef, 0x1C, 0x0B, 0x00180000, PPC_SPE_DOUBLE), | |
8745 | +GEN_SPE(efdctsiz, speundef, 0x1D, 0x0B, 0x00180000, PPC_SPE_DOUBLE), | |
8746 | +GEN_SPE(efdtstgt, efdtstlt, 0x1E, 0x0B, 0x00600000, PPC_SPE_DOUBLE), | |
8747 | +GEN_SPE(efdtsteq, speundef, 0x1F, 0x0B, 0x00600000, PPC_SPE_DOUBLE), | |
8748 | + | |
8749 | +#undef GEN_SPEOP_LDST | |
8750 | +#define GEN_SPEOP_LDST(name, opc2, sh) \ | |
8751 | +GEN_HANDLER(name, 0x04, opc2, 0x0C, 0x00000000, PPC_SPE) | |
8752 | +GEN_SPEOP_LDST(evldd, 0x00, 3), | |
8753 | +GEN_SPEOP_LDST(evldw, 0x01, 3), | |
8754 | +GEN_SPEOP_LDST(evldh, 0x02, 3), | |
8755 | +GEN_SPEOP_LDST(evlhhesplat, 0x04, 1), | |
8756 | +GEN_SPEOP_LDST(evlhhousplat, 0x06, 1), | |
8757 | +GEN_SPEOP_LDST(evlhhossplat, 0x07, 1), | |
8758 | +GEN_SPEOP_LDST(evlwhe, 0x08, 2), | |
8759 | +GEN_SPEOP_LDST(evlwhou, 0x0A, 2), | |
8760 | +GEN_SPEOP_LDST(evlwhos, 0x0B, 2), | |
8761 | +GEN_SPEOP_LDST(evlwwsplat, 0x0C, 2), | |
8762 | +GEN_SPEOP_LDST(evlwhsplat, 0x0E, 2), | |
8763 | + | |
8764 | +GEN_SPEOP_LDST(evstdd, 0x10, 3), | |
8765 | +GEN_SPEOP_LDST(evstdw, 0x11, 3), | |
8766 | +GEN_SPEOP_LDST(evstdh, 0x12, 3), | |
8767 | +GEN_SPEOP_LDST(evstwhe, 0x18, 2), | |
8768 | +GEN_SPEOP_LDST(evstwho, 0x1A, 2), | |
8769 | +GEN_SPEOP_LDST(evstwwe, 0x1C, 2), | |
8770 | +GEN_SPEOP_LDST(evstwwo, 0x1E, 2), | |
8771 | +}; | |
8772 | + | |
8806 | 8773 | #include "translate_init.c" |
8807 | 8774 | #include "helper_regs.h" |
8808 | 8775 | ... | ... |
target-ppc/translate_init.c
... | ... | @@ -9260,17 +9260,10 @@ static void fix_opcode_tables (opc_handler_t **ppc_opcodes) |
9260 | 9260 | /*****************************************************************************/ |
9261 | 9261 | static int create_ppc_opcodes (CPUPPCState *env, const ppc_def_t *def) |
9262 | 9262 | { |
9263 | - opcode_t *opc, *start, *end; | |
9263 | + opcode_t *opc; | |
9264 | 9264 | |
9265 | 9265 | fill_new_table(env->opcodes, 0x40); |
9266 | - if (&opc_start < &opc_end) { | |
9267 | - start = &opc_start; | |
9268 | - end = &opc_end; | |
9269 | - } else { | |
9270 | - start = &opc_end; | |
9271 | - end = &opc_start; | |
9272 | - } | |
9273 | - for (opc = start + 1; opc != end; opc++) { | |
9266 | + for (opc = opcodes; opc < &opcodes[ARRAY_SIZE(opcodes)]; opc++) { | |
9274 | 9267 | if ((opc->handler.type & def->insns_flags) != 0) { |
9275 | 9268 | if (register_insn(env->opcodes, opc) < 0) { |
9276 | 9269 | printf("*** ERROR initializing PowerPC instruction " | ... | ... |