1
0
mirror of https://github.com/golang/go synced 2024-11-19 05:54:44 -07:00

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
This commit is contained in:
Rui Ueyama 2014-08-05 21:10:07 -07:00
parent 0da4b2dbc2
commit 24db881689

View File

@ -3066,6 +3066,7 @@ found:
break;
case Zclr:
ctxt->rexflag &= ~Pw;
*ctxt->andptr++ = op;
asmand(ctxt, &p->to, &p->to);
break;