]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: reorder rotate lowering rules in AMD64.rules
authorWayne Zuo <wdvxdr@golangcn.org>
Wed, 31 Aug 2022 01:06:41 +0000 (09:06 +0800)
committerGopher Robot <gobot@golang.org>
Thu, 1 Sep 2022 17:08:37 +0000 (17:08 +0000)
These rules should belong to lowering rules not optimizations.

Change-Id: I964d2c4b1d9bef0ede572978aff01cb11bf050ac
Reviewed-on: https://go-review.googlesource.com/c/go/+/426197
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Wayne Zuo <wdvxdr@golangcn.org>

src/cmd/compile/internal/ssa/gen/AMD64.rules

index e66718d70e0c17bde19d1616193ffbbae362c727..2b6001016d3f701cd0f7e3bf1ae600cdbdc67380 100644 (file)
 (PanicBounds [kind] x y mem) && boundsABI(kind) == 1 => (LoweredPanicBoundsB [kind] x y mem)
 (PanicBounds [kind] x y mem) && boundsABI(kind) == 2 => (LoweredPanicBoundsC [kind] x y mem)
 
+// lowering rotates
+(RotateLeft8  ...) => (ROLB ...)
+(RotateLeft16 ...) => (ROLW ...)
+(RotateLeft32 ...) => (ROLL ...)
+(RotateLeft64 ...) => (ROLQ ...)
+
 // ***************************
 // Above: lowering rules
 // Below: optimizations
 ((SHLL|SHRL|SARL|SHLXL|SHRXL|SARXL) x (ANDLconst [c] y)) && c & 31 == 31 => ((SHLL|SHRL|SARL|SHLXL|SHRXL|SARXL) x y)
 ((SHLL|SHRL|SARL|SHLXL|SHRXL|SARXL) x (NEGL <t> (ANDLconst [c] y))) && c & 31 == 31 => ((SHLL|SHRL|SARL|SHLXL|SHRXL|SARXL) x (NEGL <t> y))
 
-(RotateLeft8  ...) => (ROLB ...)
-(RotateLeft16 ...) => (ROLW ...)
-(RotateLeft32 ...) => (ROLL ...)
-(RotateLeft64 ...) => (ROLQ ...)
-
 // rotate left negative = rotate right
 (ROLQ x (NEG(Q|L) y)) => (RORQ x y)
 (ROLL x (NEG(Q|L) y)) => (RORL x y)