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

Very basic REP+MOVS support #104

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

klauspost
Copy link
Contributor

@klauspost klauspost commented Dec 31, 2019

Handcrafted support for REP+MOVS to assist with #99

I am not super into the generators, so some of the code is handcrafted to do a POC.

With this I am able to get correct registers and encoding:

	x := reg.RCX
	src, dst := reg.RSI, reg.RDI
	MOVQ(length, x)
	LEAQ(a, src)
	LEAQ(b, dst)
	REP(x)
	MOVSB(src, dst)

Obviously the remaining string instructions should also be added.

Handcrafted support for REP+MOVS

I am not super into the generators, so some of the code is handcrafted to do a POC.

With this I am able to get correct registers and encoding:

```
	x := reg.RCX
	src, dst := reg.RSI, reg.RDI
	XORQ(x, x)
	LEAQ(a, src)
	LEAQ(b, dst)
	REP(x)
	MOVSB(src, dst)
```
@mmcloughlin
Copy link
Owner

Thank you for the contribution, a POC is very useful! Lets continue discussion on the issue #99

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.

2 participants