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

[PPC] mtocrf, mfocrf misses fxm immediate #1903

Closed
Rot127 opened this issue Jul 24, 2022 · 2 comments
Closed

[PPC] mtocrf, mfocrf misses fxm immediate #1903

Rot127 opened this issue Jul 24, 2022 · 2 comments

Comments

@Rot127
Copy link
Collaborator

Rot127 commented Jul 24, 2022

Brief

The PPC instruction mtocrf should have two operands: register RS and immediate fxm. But Capstone only decodes the register.

Reproduce

> ./cstool -d ppc64be 7c120120
 0  7c 12 01 20  mtocrf	0x20, r0
	ID: 796 (mtocrf)

# missing immediate: 0x20

	op_count: 1
		operands[0].type: REG = r0

Additional info

> git log -i -n 1
commit 0494e94bab2faac6f5356a43bcbc00c0eae42639 (HEAD -> next, origin/next)
Merge: eea28905 16937b1d
...
Date:   Sat Jul 23 23:53:08 2022 +0800
> ./cstool -v
cstool for Capstone Disassembler, v5.0.0
@Rot127
Copy link
Collaborator Author

Rot127 commented Jul 30, 2022

Same applies for mfocrf

./cstool -d ppc64 2680707d
 0  26 80 70 7d  mfocrf	r11, 8
	ID: 718 (mfocrf)
	op_count: 1
		operands[0].type: REG = r11

@Rot127 Rot127 changed the title [PPC] mtocrf misses fxm immediate [PPC] mtocrf, mfocrf misses fxm immediate Jul 30, 2022
@Rot127
Copy link
Collaborator Author

Rot127 commented Jan 14, 2024

This is fixed in v6:

> ./cstool -d ppc64be 7c120120
 0  7c 12 01 20  mtocrf	0x20, r0
	ID: 608 (mtocrf)
	op_count: 2
		operands[0].type: REG = cr2
		operands[0].access: WRITE
		operands[1].type: REG = r0
		operands[1].access: READ

> ./cstool -d ppc64 2680707d
 0  26 80 70 7d  mfocrf	r11, 8
	ID: 583 (mfocrf)
	op_count: 2
		operands[0].type: REG = r11
		operands[0].access: WRITE
		operands[1].type: REG = cr4
		operands[1].access: READ

@Rot127 Rot127 closed this as completed Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant