]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix bit-test rules for highest bit
authorGiovanni Bajo <rasky@develer.com>
Tue, 20 Feb 2018 08:39:09 +0000 (09:39 +0100)
committerGiovanni Bajo <rasky@develer.com>
Tue, 27 Feb 2018 00:51:40 +0000 (00:51 +0000)
commit68def820088ac8a9d652be648fc14e3cd39a3421
tree11e178003aa34d889b40c2e4894f49da7bb7ffba
parent098208a0d92ecfcc6e03048d3f731153963f1f0d
cmd/compile: fix bit-test rules for highest bit

Bit-test rules failed to match when matching the highest bit
of a word because operands in SSA are signed int64. Fix
them by treating them as unsigned (and correctly handling
32-bit operands as well).

Tests will be added in next CL.

Change-Id: I491c4e88e7e2f87e9bb72bd0d9fa5d4025b90736
Reviewed-on: https://go-review.googlesource.com/94765
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/rewrite.go
src/cmd/compile/internal/ssa/rewriteAMD64.go