Skip to content

[ARM] Fix VFP feature check#2090

Merged
aquynh merged 1 commit intocapstone-engine:v5from
Rot127:fix-arm-vfp-feature
Jul 18, 2023
Merged

[ARM] Fix VFP feature check#2090
aquynh merged 1 commit intocapstone-engine:v5from
Rot127:fix-arm-vfp-feature

Conversation

@Rot127
Copy link
Copy Markdown
Collaborator

@Rot127 Rot127 commented Jul 18, 2023

ARM VFP instructions could not be disassembled if arch != armv8. This happens because of a faulty feature check. The check assumes VFP is v8 only.

This is not the case as can be checked with LLVM:

echo "0x04,0x0b,0xb7,0xee,0x10,0xfa,0xf1,0xee,0x02,0x0b,0x31,0xee,0x42,0x0b,0x31,0xee,0xc8,0x1b,0xb0,0xee" | llvm-mc-16 --triple=armv7 --mattr=+vfp3 --disassemble
	.text
	vmov.f64	d0, #1.250000e+00
	vmrs	APSR_nzcv, fpscr
	vadd.f64	d0, d1, d2
	vsub.f64	d0, d1, d2
	vabs.f64	d1, d8

VFP instructions could only be disassembled if armv8 was set as arch.
This is because the predicate fails due to this feature check. This is incorrect as also armv7 can have VFP support.
@Rot127 Rot127 changed the base branch from next to v5 July 18, 2023 11:19
@XVilka XVilka mentioned this pull request Jul 18, 2023
24 tasks
@aquynh aquynh merged commit 270d16e into capstone-engine:v5 Jul 18, 2023
@aquynh
Copy link
Copy Markdown
Collaborator

aquynh commented Jul 18, 2023

merged, thanks!

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

Successfully merging this pull request may close these issues.

3 participants