Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Architecture updater (auto-sync) - Updating PPC #2013

Merged
merged 76 commits into from
Sep 5, 2023

Conversation

Rot127
Copy link
Collaborator

@Rot127 Rot127 commented May 7, 2023

Base on: #1949

Draft PR for the auto-sync refactor of PPC.

It will also refactor quite a lot of general mapping logic used by auto-sync archs

TODO

  • PS instructions
  • Make Capstone build with generated and translated files.
  • Add details
    • Print different deatil for branch hints and add not set flag.
    • Move add_cs_detail to new cs_mapping.h
    • Implement operand handling
    • Handle TH operands for dcbt
    • Fix td files
  • "0x04,0x00,0x00,0x00,0xf4,0xa4,0x00,0x08" -> pstd 5, 8(4), 0
  • Fuzz more
  • Update and add tests

Optimizations to do afterwards (in another PR)

  • Macros should end with ; for proper formatting.
  • Data types of mapped operands should be excluded for CAPSTONE_DIET
  • Add get_cs_reg_alias() for non LLVM register names.
  • Add add_cs_group() for non LLVM instruction groups.
  • Add asserts (again for translated files) which are disabled by default.
  • Upstream additions in PPCPredicate.h to LLVM

Closes

closes #1909
closes #476
closes #1936
closes #1914
closes #1912
closes #1693
closes #1527
closes #944

Test again

Breaking changes

  • Predicate enums members are renamed. They now use the LLVM name (e.g. PPC_BC_NU_PLUS -> PPC_PRED_NU_PLUS).
  • Branch conditions are now saved in more detail in cs_ppc.bc.
  • The base register of an PPC memory operand was not present if reg = r0. This is fixed now.
  • ppc_ops_crx is removed (wasn't used).

@Rot127
Copy link
Collaborator Author

Rot127 commented May 10, 2023

Hi @terorie! As you see I am just in the process to refactor the PPC module. You added the paired-single instructions, but I couldn't find them in LLVM. Have you used this revision (https://reviews.llvm.org/D85137)? Or were the PS instructions at some point part of LLVM and they are now deprecated? Could you tell me the release you used in the latter case?

@riptl
Copy link
Contributor

riptl commented May 10, 2023

Hey @Rot127 unfortunately I made minimal progress here.

There was a TableGen version mismatch between DarkKirb's patch and the one that Capstone needed.

So, I started learning and rewriting TableGen rules by hand a long time ago but not sure where I left that off.

Will share the code if I can find it again. Happy to pick this back up if there's interest.

@Rot127
Copy link
Collaborator Author

Rot127 commented May 10, 2023

Will share the code if I can find it again.

This would be great!

Happy to pick this back up if there's interest.

While I am at it I would try to add it on my own. But can I come back to your offer if I get stuck? The priority is to focus on refactoring as many archs as possible to use auto-sync

arch/PowerPC/PPCDisassembler.c Outdated Show resolved Hide resolved
arch/PowerPC/PPCDisassembler.c Show resolved Hide resolved
Copy link
Contributor

@XVilka XVilka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two minor things

@Rot127
Copy link
Collaborator Author

Rot127 commented May 13, 2023

@kabeor @XVilka What are your opinions regarding asserts? They were removed in Capstone (for performance I guess?) and so I removed them as well during translation. Should they be reintroduced? But wrapped in a macro. So we can only use it for debugging?

@XVilka
Copy link
Contributor

XVilka commented May 15, 2023

@Rot127 no objections against asserts if they are disabled by default. Maybe could be something like cs_assert() to avoid any possible clash with the standard one?

@Rot127
Copy link
Collaborator Author

Rot127 commented May 19, 2023

@terorie The PS instructions are now implemented. Wasn't too much trouble.

Details
./cstool -d ppc32be "\x10\x00\x1f\xec\xe0\x6d\x80\x04\xe4\x6d\x80\x04\x10\x60\x1c\x4c\x10\x60\x1c\x0c\xf0\x6d\x80\x04\xf4\x6d\x80\x04\x10\x60\x1c\x4e\x10\x60\x1c\x0e\x10\x60\x1a\x10\x10\x60\x1a\x11\x10\x63\x20\x2a\x10\x63\x20\x2b\x10\x83\x20\x40\x10\x83\x20\xC0\x10\x83\x20\x00\x10\x83\x20\x80\x10\x63\x20\x24\x10\x63\x20\x25\x10\x63\x29\x3a\x10\x63\x29\x3b\x10\x63\x29\x1c\x10\x63\x29\x1d\x10\x63\x29\x1e\x10\x63\x29\x1f\x10\x63\x24\x20\x10\x63\x24\x21\x10\x63\x24\x60\x10\x63\x24\x61\x10\x63\x24\xA0\x10\x63\x24\xA1\x10\x63\x24\xE0\x10\x63\x24\xE1\x10\x60\x20\x90\x10\x60\x20\x91\x10\x63\x29\x38\x10\x63\x29\x39\x10\x63\x01\x32\x10\x63\x01\x33\x10\x63\x01\x18\x10\x63\x01\x19\x10\x63\x01\x1A\x10\x63\x01\x1B\x10\x60\x19\x10\x10\x60\x19\x11\x10\x60\x18\x50\x10\x60\x18\x51\x10\x63\x29\x3e\x10\x63\x29\x3f\x10\x63\x29\x3c\x10\x63\x29\x3d\x10\x60\x18\x30\x10\x60\x18\x31\x10\x60\x18\x34\x10\x60\x18\x35\x10\x63\x29\x2e\x10\x63\x29\x2f\x10\x63\x20\x28\x10\x63\x20\x29\x10\x63\x29\x14\x10\x63\x29\x15\x10\x63\x29\x16\x10\x63\x29\x17"
 0  10 00 1f ec  dcbz_l	r0, r3
    ID: 730 (popcntw)
    op_count: 2
  	  operands[0].type: REG = r0
  	  operands[0].access: READ
  	  operands[1].type: REG = r3
  	  operands[1].access: READ
    Groups: HasPS 

 4  e0 6d 80 04  psq_l	f3, 4(r13), 1, 0
    ID: 731 (dcbz_l)
    op_count: 4
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: MEM
  		  operands[1].mem.base: REG = r13
  		  operands[1].mem.disp: 0x4
  	  operands[1].access: READ
  	  operands[2].type: IMM = 0x1
  	  operands[2].access: READ
  	  operands[3].type: IMM = 0x0
  	  operands[3].access: READ
    Groups: HasPS 

 8  e4 6d 80 04  psq_lu	f3, 4(r13), 1, 0
    ID: 732 (psq_l)
    op_count: 4
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: MEM
  		  operands[1].mem.base: REG = r13
  		  operands[1].mem.disp: 0x4
  	  operands[1].access: READ
  	  operands[2].type: IMM = 0x1
  	  operands[2].access: READ
  	  operands[3].type: IMM = 0x0
  	  operands[3].access: READ
    Groups: HasPS 

 c  10 60 1c 4c  psq_lux	f3, r0, r3, 1, 0
    ID: 733 (psq_lu)
    op_count: 5
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = r0
  	  operands[1].access: READ
  	  operands[2].type: REG = r3
  	  operands[2].access: READ
  	  operands[3].type: IMM = 0x1
  	  operands[3].access: READ
  	  operands[4].type: IMM = 0x0
  	  operands[4].access: READ
    Groups: HasPS 

10  10 60 1c 0c  psq_lx	f3, r0, r3, 1, 0
    ID: 734 (psq_lux)
    op_count: 5
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = r0
  	  operands[1].access: READ
  	  operands[2].type: REG = r3
  	  operands[2].access: READ
  	  operands[3].type: IMM = 0x1
  	  operands[3].access: READ
  	  operands[4].type: IMM = 0x0
  	  operands[4].access: READ
    Groups: HasPS 

14  f0 6d 80 04  psq_st	f3, 4(r13), 1, 0
    ID: 735 (psq_lx)
    op_count: 4
  	  operands[0].type: REG = f3
  	  operands[0].access: READ
  	  operands[1].type: MEM
  		  operands[1].mem.base: REG = r13
  		  operands[1].mem.disp: 0x4
  	  operands[1].access: WRITE
  	  operands[2].type: IMM = 0x1
  	  operands[2].access: READ
  	  operands[3].type: IMM = 0x0
  	  operands[3].access: READ
    Groups: HasPS 

18  f4 6d 80 04  psq_stu	f3, 4(r13), 1, 0
    ID: 736 (psq_st)
    op_count: 4
  	  operands[0].type: REG = f3
  	  operands[0].access: READ
  	  operands[1].type: MEM
  		  operands[1].mem.base: REG = r13
  		  operands[1].mem.disp: 0x4
  	  operands[1].access: WRITE
  	  operands[2].type: IMM = 0x1
  	  operands[2].access: READ
  	  operands[3].type: IMM = 0x0
  	  operands[3].access: READ
    Groups: HasPS 

1c  10 60 1c 4e  psq_stux	f3, r0, r3, 1, 0
    ID: 737 (psq_stu)
    op_count: 5
  	  operands[0].type: REG = f3
  	  operands[0].access: READ
  	  operands[1].type: REG = r0
  	  operands[1].access: READ
  	  operands[2].type: REG = r3
  	  operands[2].access: READ
  	  operands[3].type: IMM = 0x1
  	  operands[3].access: READ
  	  operands[4].type: IMM = 0x0
  	  operands[4].access: READ
    Groups: HasPS 

20  10 60 1c 0e  psq_stx	f3, r0, r3, 1, 0
    ID: 738 (psq_stux)
    op_count: 5
  	  operands[0].type: REG = f3
  	  operands[0].access: READ
  	  operands[1].type: REG = r0
  	  operands[1].access: READ
  	  operands[2].type: REG = r3
  	  operands[2].access: READ
  	  operands[3].type: IMM = 0x1
  	  operands[3].access: READ
  	  operands[4].type: IMM = 0x0
  	  operands[4].access: READ
    Groups: HasPS 

24  10 60 1a 10  ps_abs	f3, f3
    ID: 749 (pstxvp)
    op_count: 2
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
    Groups: HasPS 

28  10 60 1a 11  ps_abs.	f3, f3
    ID: 749 (pstxvp)
    op_count: 2
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
    Groups: HasPS 

2c  10 63 20 2a  ps_add	f3, f3, f4
    ID: 750 (ps_abs)
    op_count: 3
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
    Groups: HasPS 

30  10 63 20 2b  ps_add.	f3, f3, f4
    ID: 750 (ps_abs)
    op_count: 3
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
    Groups: HasPS 

34  10 83 20 40  ps_cmpo0	cr1, f3, f4
    ID: 751 (ps_add)
    op_count: 3
  	  operands[0].type: REG = cr1
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
    Groups: HasPS 

38  10 83 20 c0  ps_cmpo1	cr1, f3, f4
    ID: 752 (ps_cmpo0)
    op_count: 3
  	  operands[0].type: REG = cr1
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
    Groups: HasPS 

3c  10 83 20 00  ps_cmpu0	cr1, f3, f4
    ID: 753 (ps_cmpo1)
    op_count: 3
  	  operands[0].type: REG = cr1
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
    Groups: HasPS 

40  10 83 20 80  ps_cmpu1	cr1, f3, f4
    ID: 754 (ps_cmpu0)
    op_count: 3
  	  operands[0].type: REG = cr1
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
    Groups: HasPS 

44  10 63 20 24  ps_div	f3, f3, f4
    ID: 755 (ps_cmpu1)
    op_count: 3
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
    Groups: HasPS 

48  10 63 20 25  ps_div.	f3, f3, f4
    ID: 755 (ps_cmpu1)
    op_count: 3
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
    Groups: HasPS 

4c  10 63 29 3a  ps_madd	f3, f3, f4, f5
    ID: 756 (ps_div)
    op_count: 4
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
  	  operands[3].type: REG = f5
  	  operands[3].access: READ
    Groups: HasPS 

50  10 63 29 3b  ps_madd.	f3, f3, f4, f5
    ID: 756 (ps_div)
    op_count: 4
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
  	  operands[3].type: REG = f5
  	  operands[3].access: READ
    Groups: HasPS 

54  10 63 29 1c  ps_madds0	f3, f3, f4, f5
    ID: 757 (ps_madd)
    op_count: 4
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
  	  operands[3].type: REG = f5
  	  operands[3].access: READ
    Groups: HasPS 

58  10 63 29 1d  ps_madds0.	f3, f3, f4, f5
    ID: 757 (ps_madd)
    op_count: 4
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
  	  operands[3].type: REG = f5
  	  operands[3].access: READ
    Groups: HasPS 

5c  10 63 29 1e  ps_madds1	f3, f3, f4, f5
    ID: 758 (ps_madds0)
    op_count: 4
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
  	  operands[3].type: REG = f5
  	  operands[3].access: READ
    Groups: HasPS 

60  10 63 29 1f  ps_madds1.	f3, f3, f4, f5
    ID: 758 (ps_madds0)
    op_count: 4
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
  	  operands[3].type: REG = f5
  	  operands[3].access: READ
    Groups: HasPS 

64  10 63 24 20  ps_merge00	f3, f3, f4
    ID: 759 (ps_madds1)
    op_count: 3
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
    Groups: HasPS 

68  10 63 24 21  ps_merge00.	f3, f3, f4
    ID: 759 (ps_madds1)
    op_count: 3
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
    Groups: HasPS 

6c  10 63 24 60  ps_merge01	f3, f3, f4
    ID: 760 (ps_merge00)
    op_count: 3
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
    Groups: HasPS 

70  10 63 24 61  ps_merge01.	f3, f3, f4
    ID: 760 (ps_merge00)
    op_count: 3
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
    Groups: HasPS 

74  10 63 24 a0  ps_merge10	f3, f3, f4
    ID: 761 (ps_merge01)
    op_count: 3
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
    Groups: HasPS 

78  10 63 24 a1  ps_merge10.	f3, f3, f4
    ID: 761 (ps_merge01)
    op_count: 3
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
    Groups: HasPS 

7c  10 63 24 e0  ps_merge11	f3, f3, f4
    ID: 762 (ps_merge10)
    op_count: 3
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
    Groups: HasPS 

80  10 63 24 e1  ps_merge11.	f3, f3, f4
    ID: 762 (ps_merge10)
    op_count: 3
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
    Groups: HasPS 

84  10 60 20 90  ps_mr	f3, f4
    ID: 763 (ps_merge11)
    op_count: 2
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f4
  	  operands[1].access: READ
    Groups: HasPS 

88  10 60 20 91  ps_mr.	f3, f4
    ID: 763 (ps_merge11)
    op_count: 2
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f4
  	  operands[1].access: READ
    Groups: HasPS 

8c  10 63 29 38  ps_msub	f3, f3, f4, f5
    ID: 764 (ps_mr)
    op_count: 4
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
  	  operands[3].type: REG = f5
  	  operands[3].access: READ
    Groups: HasPS 

90  10 63 29 39  ps_msub.	f3, f3, f4, f5
    ID: 764 (ps_mr)
    op_count: 4
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
  	  operands[3].type: REG = f5
  	  operands[3].access: READ
    Groups: HasPS 

94  10 63 01 32  ps_mul	f3, f3, f4
    ID: 765 (ps_msub)
    op_count: 3
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
    Groups: HasPS 

98  10 63 01 33  ps_mul.	f3, f3, f4
    ID: 765 (ps_msub)
    op_count: 3
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
    Groups: HasPS 

9c  10 63 01 18  ps_muls0	f3, f3, f4
    ID: 766 (ps_mul)
    op_count: 3
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
    Groups: HasPS 

a0  10 63 01 19  ps_muls0.	f3, f3, f4
    ID: 766 (ps_mul)
    op_count: 3
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
    Groups: HasPS 

a4  10 63 01 1a  ps_muls1	f3, f3, f4
    ID: 767 (ps_muls0)
    op_count: 3
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
    Groups: HasPS 

a8  10 63 01 1b  ps_muls1.	f3, f3, f4
    ID: 767 (ps_muls0)
    op_count: 3
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
    Groups: HasPS 

ac  10 60 19 10  ps_nabs	f3, f3
    ID: 768 (ps_muls1)
    op_count: 2
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
    Groups: HasPS 

b0  10 60 19 11  ps_nabs.	f3, f3
    ID: 768 (ps_muls1)
    op_count: 2
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
    Groups: HasPS 

b4  10 60 18 50  ps_neg	f3, f3
    ID: 769 (ps_nabs)
    op_count: 2
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
    Groups: HasPS 

b8  10 60 18 51  ps_neg.	f3, f3
    ID: 769 (ps_nabs)
    op_count: 2
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
    Groups: HasPS 

bc  10 63 29 3e  ps_nmadd	f3, f3, f4, f5
    ID: 770 (ps_neg)
    op_count: 4
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
  	  operands[3].type: REG = f5
  	  operands[3].access: READ
    Groups: HasPS 

c0  10 63 29 3f  ps_nmadd.	f3, f3, f4, f5
    ID: 770 (ps_neg)
    op_count: 4
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
  	  operands[3].type: REG = f5
  	  operands[3].access: READ
    Groups: HasPS 

c4  10 63 29 3c  ps_nmsub	f3, f3, f4, f5
    ID: 771 (ps_nmadd)
    op_count: 4
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
  	  operands[3].type: REG = f5
  	  operands[3].access: READ
    Groups: HasPS 

c8  10 63 29 3d  ps_nmsub.	f3, f3, f4, f5
    ID: 771 (ps_nmadd)
    op_count: 4
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
  	  operands[3].type: REG = f5
  	  operands[3].access: READ
    Groups: HasPS 

cc  10 60 18 30  ps_res	f3, f3
    ID: 772 (ps_nmsub)
    op_count: 2
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
    Groups: HasPS 

d0  10 60 18 31  ps_res.	f3, f3
    ID: 772 (ps_nmsub)
    op_count: 2
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
    Groups: HasPS 

d4  10 60 18 34  ps_rsqrte	f3, f3
    ID: 773 (ps_res)
    op_count: 2
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
    Groups: HasPS 

d8  10 60 18 35  ps_rsqrte.	f3, f3
    ID: 773 (ps_res)
    op_count: 2
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
    Groups: HasPS 

dc  10 63 29 2e  ps_sel	f3, f3, f4, f5
    ID: 774 (ps_rsqrte)
    op_count: 4
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
  	  operands[3].type: REG = f5
  	  operands[3].access: READ
    Groups: HasPS 

e0  10 63 29 2f  ps_sel.	f3, f3, f4, f5
    ID: 774 (ps_rsqrte)
    op_count: 4
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
  	  operands[3].type: REG = f5
  	  operands[3].access: READ
    Groups: HasPS 

e4  10 63 20 28  ps_sub	f3, f3, f4
    ID: 775 (ps_sel)
    op_count: 3
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
    Groups: HasPS 

e8  10 63 20 29  ps_sub.	f3, f3, f4
    ID: 775 (ps_sel)
    op_count: 3
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
    Groups: HasPS 

ec  10 63 29 14  ps_sum0	f3, f3, f4, f5
    ID: 776 (ps_sub)
    op_count: 4
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
  	  operands[3].type: REG = f5
  	  operands[3].access: READ
    Groups: HasPS 

f0  10 63 29 15  ps_sum0.	f3, f3, f4, f5
    ID: 776 (ps_sub)
    op_count: 4
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
  	  operands[3].type: REG = f5
  	  operands[3].access: READ
    Groups: HasPS 

f4  10 63 29 16  ps_sum1	f3, f3, f4, f5
    ID: 777 (ps_sum0)
    op_count: 4
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
  	  operands[3].type: REG = f5
  	  operands[3].access: READ
    Groups: HasPS 

f8  10 63 29 17  ps_sum1.	f3, f3, f4, f5
    ID: 777 (ps_sum0)
    op_count: 4
  	  operands[0].type: REG = f3
  	  operands[0].access: WRITE
  	  operands[1].type: REG = f3
  	  operands[1].access: READ
  	  operands[2].type: REG = f4
  	  operands[2].access: READ
  	  operands[3].type: REG = f5
  	  operands[3].access: READ
    Groups: HasPS

@Rot127
Copy link
Collaborator Author

Rot127 commented Jul 8, 2023

Rebased and squashed this PR onto the latest commit of #1949 (683a595).
Original commit history is here: https://github.com/rot127/capstone/tree/auto-sync-ppc-bak

@XVilka
Copy link
Contributor

XVilka commented Jul 8, 2023

@Rot127
Copy link
Collaborator Author

Rot127 commented Jul 8, 2023

Yes, I am going to fuzz it as well before starting with Rizin integration.

@XVilka XVilka mentioned this pull request Jul 11, 2023
24 tasks
XVilka referenced this pull request in qemu/qemu Jul 11, 2023
this are the changes from volumit
(https://github.com/volumit/qemu/commits/master) compacted into one
patch.

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
@XVilka
Copy link
Contributor

XVilka commented Jul 20, 2023

Please rebase on top of latest next

@XVilka

This comment was marked as resolved.

@Rot127
Copy link
Collaborator Author

Rot127 commented Aug 10, 2023

Finally got those bindings fixed. @kabeor @aquynh Feel free to take a look.

@XVilka
Copy link
Contributor

XVilka commented Aug 18, 2023

@aquynh @kabeor ping

@Rot127
Copy link
Collaborator Author

Rot127 commented Aug 21, 2023

@aquynh @kabeor Do you guys have already a time in mind when you can look at it?

@kabeor
Copy link
Member

kabeor commented Aug 22, 2023

@Rot127 I will start to review the code this weekend.

@XVilka
Copy link
Contributor

XVilka commented Aug 27, 2023

@Rot127 I will start to review the code this weekend.

Have you had a chance to look?

@XVilka
Copy link
Contributor

XVilka commented Aug 28, 2023

Would be nice to get this finally merged. It will reduce the amount of work and will make reviewing Aarch64 and Alpha PRs much easier.

@kabeor
Copy link
Member

kabeor commented Aug 28, 2023

Yeah I am reviewing the code, still need time.

@XVilka
Copy link
Contributor

XVilka commented Sep 1, 2023

Any updates?

@XVilka
Copy link
Contributor

XVilka commented Sep 4, 2023

@kabeor @aquynh ping

@kabeor
Copy link
Member

kabeor commented Sep 5, 2023

Every thing looks great! Merged.

@kabeor kabeor merged commit 5261e84 into capstone-engine:next Sep 5, 2023
11 checks passed
@XVilka
Copy link
Contributor

XVilka commented Sep 5, 2023

Don't worry about red CI - it's a GitHub/network issue. Could be restarted later today:

Warning: Failed to download action 'https://api.github.com/repos/actions/checkout/tarball/f43a0e5ff2bd294095638e18286ca9a3d1956744'. Error: Response status code does not indicate success: 503 (Service Unavailable).
Warning: Back off 11.502 seconds before retry.
Warning: Failed to download action 'https://api.github.com/repos/actions/checkout/tarball/f43a0e5ff2bd294095638e18286ca9a3d1956744'. Error: Response status code does not indicate success: 503 (Service Unavailable).
Warning: Back off 27.394 seconds before retry.

https://www.githubstatus.com/incidents/c8zjb9351hlc

CS_AC_INVALID = 0, ///< Uninitialized/invalid access type.
CS_AC_READ = 1 << 0, ///< Operand read from memory or register.
CS_AC_WRITE = 1 << 1, ///< Operand write to memory or register.
CS_AC_READ_WRTE =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo wrte -> write

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment