From 9cc5176fe526ecaa8164811c9fb704783eba3936 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Tue, 5 Aug 2014 21:10:07 -0700 Subject: 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://codereview.appspot.com/115580044 --- src/liblink/asm6.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/liblink') diff --git a/src/liblink/asm6.c b/src/liblink/asm6.c index 454b30239..3fc3e0128 100644 --- a/src/liblink/asm6.c +++ b/src/liblink/asm6.c @@ -3066,6 +3066,7 @@ found: break; case Zclr: + ctxt->rexflag &= ~Pw; *ctxt->andptr++ = op; asmand(ctxt, &p->to, &p->to); break; -- cgit v1.2.1