cmd/compile: use ellipses in MIPS rules

Passes toolstash-check -all.

Change-Id: I14db0acb9b531029c613fa31bc076928651b6448
Reviewed-on: https://go-review.googlesource.com/c/go/+/217007
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
Josh Bleecher Snyder 2020-01-23 12:03:26 -08:00
parent 917c7a6fc9
commit 1bda9b001f
2 changed files with 217 additions and 1207 deletions

View File

@ -2,25 +2,25 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
(Add(Ptr|32|16|8) x y) -> (ADD x y) (Add(Ptr|32|16|8) ...) -> (ADD ...)
(Add(32|64)F x y) -> (ADD(F|D) x y) (Add(32|64)F ...) -> (ADD(F|D) ...)
(Select0 (Add32carry <t> x y)) -> (ADD <t.FieldType(0)> x y) (Select0 (Add32carry <t> x y)) -> (ADD <t.FieldType(0)> x y)
(Select1 (Add32carry <t> x y)) -> (SGTU <typ.Bool> x (ADD <t.FieldType(0)> x y)) (Select1 (Add32carry <t> x y)) -> (SGTU <typ.Bool> x (ADD <t.FieldType(0)> x y))
(Add32withcarry <t> x y c) -> (ADD c (ADD <t> x y)) (Add32withcarry <t> x y c) -> (ADD c (ADD <t> x y))
(Sub(Ptr|32|16|8) x y) -> (SUB x y) (Sub(Ptr|32|16|8) ...) -> (SUB ...)
(Sub(32|64)F x y) -> (SUB(F|D) x y) (Sub(32|64)F ...) -> (SUB(F|D) ...)
(Select0 (Sub32carry <t> x y)) -> (SUB <t.FieldType(0)> x y) (Select0 (Sub32carry <t> x y)) -> (SUB <t.FieldType(0)> x y)
(Select1 (Sub32carry <t> x y)) -> (SGTU <typ.Bool> (SUB <t.FieldType(0)> x y) x) (Select1 (Sub32carry <t> x y)) -> (SGTU <typ.Bool> (SUB <t.FieldType(0)> x y) x)
(Sub32withcarry <t> x y c) -> (SUB (SUB <t> x y) c) (Sub32withcarry <t> x y c) -> (SUB (SUB <t> x y) c)
(Mul(32|16|8) x y) -> (MUL x y) (Mul(32|16|8) ...) -> (MUL ...)
(Mul(32|64)F x y) -> (MUL(F|D) x y) (Mul(32|64)F ...) -> (MUL(F|D) ...)
(Hmul(32|32u) x y) -> (Select0 (MUL(T|TU) x y)) (Hmul(32|32u) x y) -> (Select0 (MUL(T|TU) x y))
(Mul32uhilo x y) -> (MULTU x y) (Mul32uhilo ...) -> (MULTU ...)
(Div32 x y) -> (Select1 (DIV x y)) (Div32 x y) -> (Select1 (DIV x y))
(Div32u x y) -> (Select1 (DIVU x y)) (Div32u x y) -> (Select1 (DIVU x y))
@ -28,7 +28,7 @@
(Div16u x y) -> (Select1 (DIVU (ZeroExt16to32 x) (ZeroExt16to32 y))) (Div16u x y) -> (Select1 (DIVU (ZeroExt16to32 x) (ZeroExt16to32 y)))
(Div8 x y) -> (Select1 (DIV (SignExt8to32 x) (SignExt8to32 y))) (Div8 x y) -> (Select1 (DIV (SignExt8to32 x) (SignExt8to32 y)))
(Div8u x y) -> (Select1 (DIVU (ZeroExt8to32 x) (ZeroExt8to32 y))) (Div8u x y) -> (Select1 (DIVU (ZeroExt8to32 x) (ZeroExt8to32 y)))
(Div(32|64)F x y) -> (DIV(F|D) x y) (Div(32|64)F ...) -> (DIV(F|D) ...)
(Mod32 x y) -> (Select0 (DIV x y)) (Mod32 x y) -> (Select0 (DIV x y))
(Mod32u x y) -> (Select0 (DIVU x y)) (Mod32u x y) -> (Select0 (DIVU x y))
@ -40,9 +40,9 @@
// (x + y) / 2 with x>=y -> (x - y) / 2 + y // (x + y) / 2 with x>=y -> (x - y) / 2 + y
(Avg32u <t> x y) -> (ADD (SRLconst <t> (SUB <t> x y) [1]) y) (Avg32u <t> x y) -> (ADD (SRLconst <t> (SUB <t> x y) [1]) y)
(And(32|16|8) x y) -> (AND x y) (And(32|16|8) ...) -> (AND ...)
(Or(32|16|8) x y) -> (OR x y) (Or(32|16|8) ...) -> (OR ...)
(Xor(32|16|8) x y) -> (XOR x y) (Xor(32|16|8) ...) -> (XOR ...)
// constant shifts // constant shifts
// generic opt rewrites all constant shifts to shift by Const64 // generic opt rewrites all constant shifts to shift by Const64
@ -115,15 +115,15 @@
(RotateLeft64 <t> x (MOVWconst [c])) -> (Or64 (Lsh64x32 <t> x (MOVWconst [c&63])) (Rsh64Ux32 <t> x (MOVWconst [-c&63]))) (RotateLeft64 <t> x (MOVWconst [c])) -> (Or64 (Lsh64x32 <t> x (MOVWconst [c&63])) (Rsh64Ux32 <t> x (MOVWconst [-c&63])))
// unary ops // unary ops
(Neg(32|16|8) x) -> (NEG x) (Neg(32|16|8) ...) -> (NEG ...)
(Neg(32|64)F x) -> (NEG(F|D) x) (Neg(32|64)F ...) -> (NEG(F|D) ...)
(Com(32|16|8) x) -> (NORconst [0] x) (Com(32|16|8) x) -> (NORconst [0] x)
(Sqrt x) -> (SQRTD x) (Sqrt ...) -> (SQRTD ...)
// TODO: optimize this case? // TODO: optimize this case?
(Ctz32NonZero x) -> (Ctz32 x) (Ctz32NonZero ...) -> (Ctz32 ...)
// count trailing zero // count trailing zero
// 32 - CLZ(x&-x - 1) // 32 - CLZ(x&-x - 1)
@ -133,44 +133,44 @@
(BitLen32 <t> x) -> (SUB (MOVWconst [32]) (CLZ <t> x)) (BitLen32 <t> x) -> (SUB (MOVWconst [32]) (CLZ <t> x))
// boolean ops -- booleans are represented with 0=false, 1=true // boolean ops -- booleans are represented with 0=false, 1=true
(AndB x y) -> (AND x y) (AndB ...) -> (AND ...)
(OrB x y) -> (OR x y) (OrB ...) -> (OR ...)
(EqB x y) -> (XORconst [1] (XOR <typ.Bool> x y)) (EqB x y) -> (XORconst [1] (XOR <typ.Bool> x y))
(NeqB x y) -> (XOR x y) (NeqB ...) -> (XOR ...)
(Not x) -> (XORconst [1] x) (Not x) -> (XORconst [1] x)
// constants // constants
(Const(32|16|8) [val]) -> (MOVWconst [val]) (Const(32|16|8) ...) -> (MOVWconst ...)
(Const(32|64)F [val]) -> (MOV(F|D)const [val]) (Const(32|64)F ...) -> (MOV(F|D)const ...)
(ConstNil) -> (MOVWconst [0]) (ConstNil) -> (MOVWconst [0])
(ConstBool [b]) -> (MOVWconst [b]) (ConstBool ...) -> (MOVWconst ...)
// truncations // truncations
// Because we ignore high parts of registers, truncates are just copies. // Because we ignore high parts of registers, truncates are just copies.
(Trunc16to8 x) -> x (Trunc16to8 ...) -> (Copy ...)
(Trunc32to8 x) -> x (Trunc32to8 ...) -> (Copy ...)
(Trunc32to16 x) -> x (Trunc32to16 ...) -> (Copy ...)
// Zero-/Sign-extensions // Zero-/Sign-extensions
(ZeroExt8to16 x) -> (MOVBUreg x) (ZeroExt8to16 ...) -> (MOVBUreg ...)
(ZeroExt8to32 x) -> (MOVBUreg x) (ZeroExt8to32 ...) -> (MOVBUreg ...)
(ZeroExt16to32 x) -> (MOVHUreg x) (ZeroExt16to32 ...) -> (MOVHUreg ...)
(SignExt8to16 x) -> (MOVBreg x) (SignExt8to16 ...) -> (MOVBreg ...)
(SignExt8to32 x) -> (MOVBreg x) (SignExt8to32 ...) -> (MOVBreg ...)
(SignExt16to32 x) -> (MOVHreg x) (SignExt16to32 ...) -> (MOVHreg ...)
(Signmask x) -> (SRAconst x [31]) (Signmask x) -> (SRAconst x [31])
(Zeromask x) -> (NEG (SGTU x (MOVWconst [0]))) (Zeromask x) -> (NEG (SGTU x (MOVWconst [0])))
(Slicemask <t> x) -> (SRAconst (NEG <t> x) [31]) (Slicemask <t> x) -> (SRAconst (NEG <t> x) [31])
// float <-> int conversion // float <-> int conversion
(Cvt32to(32|64)F x) -> (MOVW(F|D) x) (Cvt32to(32|64)F ...) -> (MOVW(F|D) ...)
(Cvt(32|64)Fto32 x) -> (TRUNC(F|D)W x) (Cvt(32|64)Fto32 ...) -> (TRUNC(F|D)W ...)
(Cvt32Fto64F x) -> (MOVFD x) (Cvt32Fto64F ...) -> (MOVFD ...)
(Cvt64Fto32F x) -> (MOVDF x) (Cvt64Fto32F ...) -> (MOVDF ...)
(Round(32|64)F x) -> x (Round(32|64)F ...) -> (Copy ...)
// comparisons // comparisons
(Eq8 x y) -> (SGTUconst [1] (XOR (ZeroExt8to32 x) (ZeroExt8to32 y))) (Eq8 x y) -> (SGTUconst [1] (XOR (ZeroExt8to32 x) (ZeroExt8to32 y)))
@ -205,12 +205,12 @@
(Greater8 x y) -> (SGT (SignExt8to32 x) (SignExt8to32 y)) (Greater8 x y) -> (SGT (SignExt8to32 x) (SignExt8to32 y))
(Greater16 x y) -> (SGT (SignExt16to32 x) (SignExt16to32 y)) (Greater16 x y) -> (SGT (SignExt16to32 x) (SignExt16to32 y))
(Greater32 x y) -> (SGT x y) (Greater32 ...) -> (SGT ...)
(Greater(32|64)F x y) -> (FPFlagTrue (CMPGT(F|D) x y)) (Greater(32|64)F x y) -> (FPFlagTrue (CMPGT(F|D) x y))
(Greater8U x y) -> (SGTU (ZeroExt8to32 x) (ZeroExt8to32 y)) (Greater8U x y) -> (SGTU (ZeroExt8to32 x) (ZeroExt8to32 y))
(Greater16U x y) -> (SGTU (ZeroExt16to32 x) (ZeroExt16to32 y)) (Greater16U x y) -> (SGTU (ZeroExt16to32 x) (ZeroExt16to32 y))
(Greater32U x y) -> (SGTU x y) (Greater32U ...) -> (SGTU ...)
(Geq8 x y) -> (XORconst [1] (SGT (SignExt8to32 y) (SignExt8to32 x))) (Geq8 x y) -> (XORconst [1] (SGT (SignExt8to32 y) (SignExt8to32 x)))
(Geq16 x y) -> (XORconst [1] (SGT (SignExt16to32 y) (SignExt16to32 x))) (Geq16 x y) -> (XORconst [1] (SGT (SignExt16to32 y) (SignExt16to32 x)))
@ -224,7 +224,7 @@
(OffPtr [off] ptr:(SP)) -> (MOVWaddr [off] ptr) (OffPtr [off] ptr:(SP)) -> (MOVWaddr [off] ptr)
(OffPtr [off] ptr) -> (ADDconst [off] ptr) (OffPtr [off] ptr) -> (ADDconst [off] ptr)
(Addr {sym} base) -> (MOVWaddr {sym} base) (Addr ...) -> (MOVWaddr ...)
(LocalAddr {sym} base _) -> (MOVWaddr {sym} base) (LocalAddr {sym} base _) -> (MOVWaddr {sym} base)
// loads // loads
@ -346,21 +346,21 @@
mem) mem)
// calls // calls
(StaticCall [argwid] {target} mem) -> (CALLstatic [argwid] {target} mem) (StaticCall ...) -> (CALLstatic ...)
(ClosureCall [argwid] entry closure mem) -> (CALLclosure [argwid] entry closure mem) (ClosureCall ...) -> (CALLclosure ...)
(InterCall [argwid] entry mem) -> (CALLinter [argwid] entry mem) (InterCall ...) -> (CALLinter ...)
// atomic intrinsics // atomic intrinsics
(AtomicLoad(8|32) ptr mem) -> (LoweredAtomicLoad(8|32) ptr mem) (AtomicLoad(8|32) ...) -> (LoweredAtomicLoad(8|32) ...)
(AtomicLoadPtr ptr mem) -> (LoweredAtomicLoad32 ptr mem) (AtomicLoadPtr ...) -> (LoweredAtomicLoad32 ...)
(AtomicStore(8|32) ptr val mem) -> (LoweredAtomicStore(8|32) ptr val mem) (AtomicStore(8|32) ...) -> (LoweredAtomicStore(8|32) ...)
(AtomicStorePtrNoWB ptr val mem) -> (LoweredAtomicStore32 ptr val mem) (AtomicStorePtrNoWB ...) -> (LoweredAtomicStore32 ...)
(AtomicExchange32 ptr val mem) -> (LoweredAtomicExchange ptr val mem) (AtomicExchange32 ...) -> (LoweredAtomicExchange ...)
(AtomicAdd32 ptr val mem) -> (LoweredAtomicAdd ptr val mem) (AtomicAdd32 ...) -> (LoweredAtomicAdd ...)
(AtomicCompareAndSwap32 ptr old new_ mem) -> (LoweredAtomicCas ptr old new_ mem) (AtomicCompareAndSwap32 ...) -> (LoweredAtomicCas ...)
// AtomicOr8(ptr,val) -> LoweredAtomicOr(ptr&^3,uint32(val) << ((ptr & 3) * 8)) // AtomicOr8(ptr,val) -> LoweredAtomicOr(ptr&^3,uint32(val) << ((ptr & 3) * 8))
(AtomicOr8 ptr val mem) && !config.BigEndian -> (AtomicOr8 ptr val mem) && !config.BigEndian ->
@ -401,20 +401,20 @@
// checks // checks
(NilCheck ptr mem) -> (LoweredNilCheck ptr mem) (NilCheck ...) -> (LoweredNilCheck ...)
(IsNonNil ptr) -> (SGTU ptr (MOVWconst [0])) (IsNonNil ptr) -> (SGTU ptr (MOVWconst [0]))
(IsInBounds idx len) -> (SGTU len idx) (IsInBounds idx len) -> (SGTU len idx)
(IsSliceInBounds idx len) -> (XORconst [1] (SGTU idx len)) (IsSliceInBounds idx len) -> (XORconst [1] (SGTU idx len))
// pseudo-ops // pseudo-ops
(GetClosurePtr) -> (LoweredGetClosurePtr) (GetClosurePtr ...) -> (LoweredGetClosurePtr ...)
(GetCallerSP) -> (LoweredGetCallerSP) (GetCallerSP ...) -> (LoweredGetCallerSP ...)
(GetCallerPC) -> (LoweredGetCallerPC) (GetCallerPC ...) -> (LoweredGetCallerPC ...)
(If cond yes no) -> (NE cond yes no) (If cond yes no) -> (NE cond yes no)
// Write barrier. // Write barrier.
(WB {fn} destptr srcptr mem) -> (LoweredWB {fn} destptr srcptr mem) (WB ...) -> (LoweredWB ...)
(PanicBounds [kind] x y mem) && boundsABI(kind) == 0 -> (LoweredPanicBoundsA [kind] x y mem) (PanicBounds [kind] x y mem) && boundsABI(kind) == 0 -> (LoweredPanicBoundsA [kind] x y mem)
(PanicBounds [kind] x y mem) && boundsABI(kind) == 1 -> (LoweredPanicBoundsB [kind] x y mem) (PanicBounds [kind] x y mem) && boundsABI(kind) == 1 -> (LoweredPanicBoundsB [kind] x y mem)

File diff suppressed because it is too large Load Diff