Skip to content

LLVM disassembler can not decode POPCNT with REX2 prefix correctly #95412

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

Closed
KanRobert opened this issue Jun 13, 2024 · 1 comment
Closed

LLVM disassembler can not decode POPCNT with REX2 prefix correctly #95412

KanRobert opened this issue Jun 13, 2024 · 1 comment
Assignees
Labels
backend:X86 mc Machine (object) code

Comments

@KanRobert
Copy link
Contributor

bash$ cat 1.s
popcntl %r16d, %r17d

bash$ llvm-mc --show-encoding 1.s
.text
popcntl %r16d, %r17d # encoding: [0xf3,0xd5,0xd0,0xb8,0xc8]

bash$ cat 1.txt
0xf3,0xd5,0xd0,0xb8,0xc8

bash$ llvm-mc --disassemble 1.txt
.text
rep popcntl %r16d, %r17d

Expect no rep prefix b/c 0xf3 is part of opcode here.

@KanRobert KanRobert added backend:X86 mc Machine (object) code labels Jun 13, 2024
@KanRobert KanRobert self-assigned this Jun 13, 2024
@llvmbot
Copy link
Member

llvmbot commented Jun 13, 2024

@llvm/issue-subscribers-backend-x86

Author: Shengchen Kan (KanRobert)

bash$ cat 1.s popcntl %r16d, %r17d

bash$ llvm-mc --show-encoding 1.s
.text
popcntl %r16d, %r17d # encoding: [0xf3,0xd5,0xd0,0xb8,0xc8]

bash$ cat 1.txt
0xf3,0xd5,0xd0,0xb8,0xc8

bash$ llvm-mc --disassemble 1.txt
.text
rep popcntl %r16d, %r17d

Expect no rep prefix b/c 0xf3 is part of opcode here.

EthanLuisMcDonough pushed a commit to EthanLuisMcDonough/llvm-project that referenced this issue Aug 13, 2024
EthanLuisMcDonough pushed a commit to EthanLuisMcDonough/llvm-project that referenced this issue Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:X86 mc Machine (object) code
Projects
None yet
Development

No branches or pull requests

2 participants