summaryrefslogtreecommitdiff
path: root/src/liblink
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2014-08-05 21:10:07 -0700
committerRui Ueyama <ruiu@google.com>2014-08-05 21:10:07 -0700
commit9cc5176fe526ecaa8164811c9fb704783eba3936 (patch)
treefce387ccd7d8f8166802baecd705259a6a84ff06 /src/liblink
parent9273a938fa61bceffa2a2d3005f418955ea3a393 (diff)
downloadgo-9cc5176fe526ecaa8164811c9fb704783eba3936.tar.gz
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
Diffstat (limited to 'src/liblink')
-rw-r--r--src/liblink/asm6.c1
1 files changed, 1 insertions, 0 deletions
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;