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

cmd/objdump: amd64 popcnt disassembled as rep popcnt #19986

Closed
rasky opened this issue Apr 15, 2017 · 3 comments
Closed

cmd/objdump: amd64 popcnt disassembled as rep popcnt #19986

rasky opened this issue Apr 15, 2017 · 3 comments

Comments

@rasky
Copy link
Member

rasky commented Apr 15, 2017

	return uint(bits.OnesCount16(val))
  0x4286bda		0fb635f27c3800		MOVZX 0x387cf2(IP), SI
  0x4286be1		4084f6			TESTL SI, SI
  0x4286be4		0f84f8000000		JE 0x4286ce2
  0x4286bea		0fb7f1			MOVZX CX, SI
  0x4286bed		f30fb8f6		REP POPCNT SI, SI
@randall77
Copy link
Contributor

I think this is intentional. Those opcodes really are encoded with a REP prefix.
A lot of the SSE instructions are in the same boat (e.g. SQRTSS).
We even have tests that make sure the "REP" is there.

@rsc, any reason why we do this?

@rsc
Copy link
Contributor

rsc commented Apr 20, 2017

If the REP is implied by the opcode, then it shouldn't be printed. Tests requiring it are likely just buggy tests.

@randall77
Copy link
Contributor

Dup of #17410. It's been fixed in the x repo, it just needs to be pulled into master. I'm going to leave this issue open until that happens.

@golang golang locked and limited conversation to collaborators Apr 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants