1
0
mirror of https://github.com/golang/go synced 2024-09-29 19:34:38 -06:00

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
// license that can be found in the LICENSE file.
(Add(Ptr|32|16|8) x y) -> (ADD x y)
(Add(32|64)F x y) -> (ADD(F|D) x y)
(Add(Ptr|32|16|8) ...) -> (ADD ...)
(Add(32|64)F ...) -> (ADD(F|D) ...)
(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))
(Add32withcarry <t> x y c) -> (ADD c (ADD <t> x y))
(Sub(Ptr|32|16|8) x y) -> (SUB x y)
(Sub(32|64)F x y) -> (SUB(F|D) x y)
(Sub(Ptr|32|16|8) ...) -> (SUB ...)
(Sub(32|64)F ...) -> (SUB(F|D) ...)
(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)
(Sub32withcarry <t> x y c) -> (SUB (SUB <t> x y) c)
(Mul(32|16|8) x y) -> (MUL x y)
(Mul(32|64)F x y) -> (MUL(F|D) x y)
(Mul(32|16|8) ...) -> (MUL ...)
(Mul(32|64)F ...) -> (MUL(F|D) ...)
(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))
(Div32u x y) -> (Select1 (DIVU x y))
@ -28,7 +28,7 @@
(Div16u x y) -> (Select1 (DIVU (ZeroExt16to32 x) (ZeroExt16to32 y)))
(Div8 x y) -> (Select1 (DIV (SignExt8to32 x) (SignExt8to32 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))
(Mod32u x y) -> (Select0 (DIVU x y))
@ -40,9 +40,9 @@
// (x + y) / 2 with x>=y -> (x - y) / 2 + y
(Avg32u <t> x y) -> (ADD (SRLconst <t> (SUB <t> x y) [1]) y)
(And(32|16|8) x y) -> (AND x y)
(Or(32|16|8) x y) -> (OR x y)
(Xor(32|16|8) x y) -> (XOR x y)
(And(32|16|8) ...) -> (AND ...)
(Or(32|16|8) ...) -> (OR ...)
(Xor(32|16|8) ...) -> (XOR ...)
// constant shifts
// 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])))
// unary ops
(Neg(32|16|8) x) -> (NEG x)
(Neg(32|64)F x) -> (NEG(F|D) x)
(Neg(32|16|8) ...) -> (NEG ...)
(Neg(32|64)F ...) -> (NEG(F|D) ...)
(Com(32|16|8) x) -> (NORconst [0] x)
(Sqrt x) -> (SQRTD x)
(Sqrt ...) -> (SQRTD ...)
// TODO: optimize this case?
(Ctz32NonZero x) -> (Ctz32 x)
(Ctz32NonZero ...) -> (Ctz32 ...)
// count trailing zero
// 32 - CLZ(x&-x - 1)
@ -133,44 +133,44 @@
(BitLen32 <t> x) -> (SUB (MOVWconst [32]) (CLZ <t> x))
// boolean ops -- booleans are represented with 0=false, 1=true
(AndB x y) -> (AND x y)
(OrB x y) -> (OR x y)
(AndB ...) -> (AND ...)
(OrB ...) -> (OR ...)
(EqB x y) -> (XORconst [1] (XOR <typ.Bool> x y))
(NeqB x y) -> (XOR x y)
(NeqB ...) -> (XOR ...)
(Not x) -> (XORconst [1] x)
// constants
(Const(32|16|8) [val]) -> (MOVWconst [val])
(Const(32|64)F [val]) -> (MOV(F|D)const [val])
(Const(32|16|8) ...) -> (MOVWconst ...)
(Const(32|64)F ...) -> (MOV(F|D)const ...)
(ConstNil) -> (MOVWconst [0])
(ConstBool [b]) -> (MOVWconst [b])
(ConstBool ...) -> (MOVWconst ...)
// truncations
// Because we ignore high parts of registers, truncates are just copies.
(Trunc16to8 x) -> x
(Trunc32to8 x) -> x
(Trunc32to16 x) -> x
(Trunc16to8 ...) -> (Copy ...)
(Trunc32to8 ...) -> (Copy ...)
(Trunc32to16 ...) -> (Copy ...)
// Zero-/Sign-extensions
(ZeroExt8to16 x) -> (MOVBUreg x)
(ZeroExt8to32 x) -> (MOVBUreg x)
(ZeroExt16to32 x) -> (MOVHUreg x)
(ZeroExt8to16 ...) -> (MOVBUreg ...)
(ZeroExt8to32 ...) -> (MOVBUreg ...)
(ZeroExt16to32 ...) -> (MOVHUreg ...)
(SignExt8to16 x) -> (MOVBreg x)
(SignExt8to32 x) -> (MOVBreg x)
(SignExt16to32 x) -> (MOVHreg x)
(SignExt8to16 ...) -> (MOVBreg ...)
(SignExt8to32 ...) -> (MOVBreg ...)
(SignExt16to32 ...) -> (MOVHreg ...)
(Signmask x) -> (SRAconst x [31])
(Zeromask x) -> (NEG (SGTU x (MOVWconst [0])))
(Slicemask <t> x) -> (SRAconst (NEG <t> x) [31])
// float <-> int conversion
(Cvt32to(32|64)F x) -> (MOVW(F|D) x)
(Cvt(32|64)Fto32 x) -> (TRUNC(F|D)W x)
(Cvt32Fto64F x) -> (MOVFD x)
(Cvt64Fto32F x) -> (MOVDF x)
(Cvt32to(32|64)F ...) -> (MOVW(F|D) ...)
(Cvt(32|64)Fto32 ...) -> (TRUNC(F|D)W ...)
(Cvt32Fto64F ...) -> (MOVFD ...)
(Cvt64Fto32F ...) -> (MOVDF ...)
(Round(32|64)F x) -> x
(Round(32|64)F ...) -> (Copy ...)
// comparisons
(Eq8 x y) -> (SGTUconst [1] (XOR (ZeroExt8to32 x) (ZeroExt8to32 y)))
@ -205,12 +205,12 @@
(Greater8 x y) -> (SGT (SignExt8to32 x) (SignExt8to32 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))
(Greater8U x y) -> (SGTU (ZeroExt8to32 x) (ZeroExt8to32 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)))
(Geq16 x y) -> (XORconst [1] (SGT (SignExt16to32 y) (SignExt16to32 x)))
@ -224,7 +224,7 @@
(OffPtr [off] ptr:(SP)) -> (MOVWaddr [off] ptr)
(OffPtr [off] ptr) -> (ADDconst [off] ptr)
(Addr {sym} base) -> (MOVWaddr {sym} base)
(Addr ...) -> (MOVWaddr ...)
(LocalAddr {sym} base _) -> (MOVWaddr {sym} base)
// loads
@ -346,21 +346,21 @@
mem)
// calls
(StaticCall [argwid] {target} mem) -> (CALLstatic [argwid] {target} mem)
(ClosureCall [argwid] entry closure mem) -> (CALLclosure [argwid] entry closure mem)
(InterCall [argwid] entry mem) -> (CALLinter [argwid] entry mem)
(StaticCall ...) -> (CALLstatic ...)
(ClosureCall ...) -> (CALLclosure ...)
(InterCall ...) -> (CALLinter ...)
// atomic intrinsics
(AtomicLoad(8|32) ptr mem) -> (LoweredAtomicLoad(8|32) ptr mem)
(AtomicLoadPtr ptr mem) -> (LoweredAtomicLoad32 ptr mem)
(AtomicLoad(8|32) ...) -> (LoweredAtomicLoad(8|32) ...)
(AtomicLoadPtr ...) -> (LoweredAtomicLoad32 ...)
(AtomicStore(8|32) ptr val mem) -> (LoweredAtomicStore(8|32) ptr val mem)
(AtomicStorePtrNoWB ptr val mem) -> (LoweredAtomicStore32 ptr val mem)
(AtomicStore(8|32) ...) -> (LoweredAtomicStore(8|32) ...)
(AtomicStorePtrNoWB ...) -> (LoweredAtomicStore32 ...)
(AtomicExchange32 ptr val mem) -> (LoweredAtomicExchange ptr val mem)
(AtomicAdd32 ptr val mem) -> (LoweredAtomicAdd ptr val mem)
(AtomicExchange32 ...) -> (LoweredAtomicExchange ...)
(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 mem) && !config.BigEndian ->
@ -401,20 +401,20 @@
// checks
(NilCheck ptr mem) -> (LoweredNilCheck ptr mem)
(NilCheck ...) -> (LoweredNilCheck ...)
(IsNonNil ptr) -> (SGTU ptr (MOVWconst [0]))
(IsInBounds idx len) -> (SGTU len idx)
(IsSliceInBounds idx len) -> (XORconst [1] (SGTU idx len))
// pseudo-ops
(GetClosurePtr) -> (LoweredGetClosurePtr)
(GetCallerSP) -> (LoweredGetCallerSP)
(GetCallerPC) -> (LoweredGetCallerPC)
(GetClosurePtr ...) -> (LoweredGetClosurePtr ...)
(GetCallerSP ...) -> (LoweredGetCallerSP ...)
(GetCallerPC ...) -> (LoweredGetCallerPC ...)
(If cond yes no) -> (NE cond yes no)
// 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) == 1 -> (LoweredPanicBoundsB [kind] x y mem)

File diff suppressed because it is too large Load Diff