Skip to content

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