diff options
| author | Rui Ueyama <ruiu@google.com> | 2014-08-05 21:10:07 -0700 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2014-08-05 21:10:07 -0700 |
| commit | 24db88168997d650e8274dd2e84e8a56bf8d95b9 (patch) | |
| tree | 1dff31db015c39616430e6351a2121cc96fd953e /src/liblink/asm6.c | |
| parent | 0da4b2dbc20e6d8a01bb44516257fda56e713523 (diff) | |
| download | go-24db88168997d650e8274dd2e84e8a56bf8d95b9.tar.xz | |
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
Diffstat (limited to 'src/liblink/asm6.c')
| -rw-r--r-- | src/liblink/asm6.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/liblink/asm6.c b/src/liblink/asm6.c index 454b30239a..3fc3e01286 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; |
