mirror of
https://github.com/golang/go.git
synced 2025-05-28 10:51:22 +00:00
[dev.ssa] cmd/compile/internal/ssa/gen: Fix *64 strength reduction
*64 is <<6, not <<5. Change-Id: I2eb7e113d5003b2c77fbd3abc3defc4d98976a5e Reviewed-on: https://go-review.googlesource.com/12323 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
3dcc424be7
commit
c1593da817
@ -112,7 +112,7 @@
|
||||
// strength reduction
|
||||
// TODO: do this a lot more generically
|
||||
(MULQconst [8] x) -> (SHLQconst [3] x)
|
||||
(MULQconst [64] x) -> (SHLQconst [5] x)
|
||||
(MULQconst [64] x) -> (SHLQconst [6] x)
|
||||
|
||||
// fold add/shift into leaq
|
||||
(ADDQ x (SHLQconst [3] y)) -> (LEAQ8 x y)
|
||||
|
@ -1225,22 +1225,22 @@ func rewriteValueAMD64(v *Value, config *Config) bool {
|
||||
;
|
||||
// match: (MULQconst [64] x)
|
||||
// cond:
|
||||
// result: (SHLQconst [5] x)
|
||||
// result: (SHLQconst [6] x)
|
||||
{
|
||||
if v.AuxInt != 64 {
|
||||
goto end75c0c250c703f89e6c43d718dd5ea3c0
|
||||
goto end3e36a587d1e7c193048d489a0429692c
|
||||
}
|
||||
x := v.Args[0]
|
||||
v.Op = OpAMD64SHLQconst
|
||||
v.AuxInt = 0
|
||||
v.Aux = nil
|
||||
v.resetArgs()
|
||||
v.AuxInt = 5
|
||||
v.AuxInt = 6
|
||||
v.AddArg(x)
|
||||
return true
|
||||
}
|
||||
goto end75c0c250c703f89e6c43d718dd5ea3c0
|
||||
end75c0c250c703f89e6c43d718dd5ea3c0:
|
||||
goto end3e36a587d1e7c193048d489a0429692c
|
||||
end3e36a587d1e7c193048d489a0429692c:
|
||||
;
|
||||
case OpMove:
|
||||
// match: (Move [size] dst src mem)
|
||||
|
Loading…
x
Reference in New Issue
Block a user