Commit 24db8816 authored by Rui Ueyama's avatar Rui Ueyama

liblink: shorter encoding for zeroing register

Encode MOV $0, %ax as XOR %eax, %eax instead of
XOR %rax, %rax. If an operand register does not
need REX.w bit (i.e. not one of R8-R15), it is
encoded in 2 bytes instead of 3 bytes.

LGTM=rsc
R=golang-codereviews, gobot, rsc
CC=golang-codereviews
https://golang.org/cl/115580044
parent 0da4b2db
......@@ -3066,6 +3066,7 @@ found:
break;
case Zclr:
ctxt->rexflag &= ~Pw;
*ctxt->andptr++ = op;
asmand(ctxt, &p->to, &p->to);
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment