diff options
| author | Matthew Dempsky <mdempsky@google.com> | 2013-01-18 16:33:25 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2013-01-18 16:33:25 -0500 |
| commit | 41ec481a53b2592111e1278670b3361ef98c352d (patch) | |
| tree | 70bfa49c8c725abc517d300879306c96501e0752 /test/fixedbugs/bug385_64.go | |
| parent | dfdfba14b98591a45186a9e9182b71e7df816e2c (diff) | |
| download | go-41ec481a53b2592111e1278670b3361ef98c352d.tar.xz | |
cmd/6c: Improve peep hole optimization of rotate and shift instructions.
Update #4629.
$ cat shift2.c
unsigned int
shift(unsigned int x, unsigned int y)
{
x = (x << 3);
y = (y << 5);
x = (x << 7);
y = (y << 9);
return x ^ y;
}
## BEFORE
$ go tool 6c -S shift2.c
(shift2.c:2) TEXT shift+0(SB),$0-8
(shift2.c:4) MOVL x+0(FP),!!AX
(shift2.c:4) SALL $3,!!AX
(shift2.c:4) MOVL AX,!!DX
(shift2.c:5) MOVL y+4(FP),!!AX
(shift2.c:5) SALL $5,!!AX
(shift2.c:5) MOVL AX,!!CX
(shift2.c:6) MOVL DX,!!AX
(shift2.c:6) SALL $7,!!AX
(shift2.c:6) MOVL AX,!!DX
(shift2.c:7) MOVL CX,!!AX
(shift2.c:7) SALL $9,!!AX
(shift2.c:7) MOVL AX,!!CX
(shift2.c:8) MOVL DX,!!AX
(shift2.c:8) XORL CX,!!AX
(shift2.c:8) RET ,!!
(shift2.c:8) RET ,!!
(shift2.c:8) END ,!!
## AFTER
$ go tool 6c -S shift2.c
(shift2.c:2) TEXT shift+0(SB),$0-8
(shift2.c:4) MOVL x+0(FP),!!AX
(shift2.c:4) SALL $3,!!AX
(shift2.c:5) MOVL y+4(FP),!!CX
(shift2.c:5) SALL $5,!!CX
(shift2.c:6) SALL $7,!!AX
(shift2.c:7) SALL $9,!!CX
(shift2.c:8) XORL CX,!!AX
(shift2.c:8) RET ,!!
(shift2.c:8) RET ,!!
(shift2.c:8) END ,!!
R=rsc, minux.ma, dave, nigeltao
CC=golang-dev
https://golang.org/cl/7066055
Diffstat (limited to 'test/fixedbugs/bug385_64.go')
0 files changed, 0 insertions, 0 deletions
