1
0
mirror of https://github.com/golang/go synced 2024-11-23 20:00:04 -07:00

cmd/compile: use ellipses in ARM rules

Passes toolstash-check -all.

Change-Id: I390789ca5bfe45967ed156590f2690c91d416187
Reviewed-on: https://go-review.googlesource.com/c/go/+/217005
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-22 16:34:26 -08:00
parent 7c0f540b00
commit 5749c0eb5b
2 changed files with 226 additions and 1209 deletions

View File

@ -2,20 +2,20 @@
// 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)
(Add32carry x y) -> (ADDS x y)
(Add32withcarry x y c) -> (ADC x y c)
(Add(Ptr|32|16|8) ...) -> (ADD ...)
(Add(32|64)F ...) -> (ADD(F|D) ...)
(Add32carry ...) -> (ADDS ...)
(Add32withcarry ...) -> (ADC ...)
(Sub(Ptr|32|16|8) x y) -> (SUB x y)
(Sub(32|64)F x y) -> (SUB(F|D) x y)
(Sub32carry x y) -> (SUBS x y)
(Sub32withcarry x y c) -> (SBC x y c)
(Sub(Ptr|32|16|8) ...) -> (SUB ...)
(Sub(32|64)F ...) -> (SUB(F|D) ...)
(Sub32carry ...) -> (SUBS ...)
(Sub32withcarry ...) -> (SBC ...)
(Mul(32|16|8) x y) -> (MUL x y)
(Mul(32|64)F x y) -> (MUL(F|D) x y)
(Hmul(32|32u) x y) -> (HMU(L|LU) x y)
(Mul32uhilo x y) -> (MULLU x y)
(Mul(32|16|8) ...) -> (MUL ...)
(Mul(32|64)F ...) -> (MUL(F|D) ...)
(Hmul(32|32u) ...) -> (HMU(L|LU) ...)
(Mul32uhilo ...) -> (MULLU ...)
(Div32 x y) ->
(SUB (XOR <typ.UInt32> // negate the result if one operand is negative
@ -28,7 +28,7 @@
(Div16u x y) -> (Div32u (ZeroExt16to32 x) (ZeroExt16to32 y))
(Div8 x y) -> (Div32 (SignExt8to32 x) (SignExt8to32 y))
(Div8u x y) -> (Div32u (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) ->
(SUB (XOR <typ.UInt32> // negate the result if x is negative
@ -45,23 +45,23 @@
// (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 ...)
// unary ops
(Neg(32|16|8) x) -> (RSBconst [0] x)
(Neg(32|64)F x) -> (NEG(F|D) x)
(Neg(32|64)F ...) -> (NEG(F|D) ...)
(Com(32|16|8) x) -> (MVN x)
(Com(32|16|8) ...) -> (MVN ...)
(Sqrt x) -> (SQRTD x)
(Abs x) -> (ABSD x)
(Sqrt ...) -> (SQRTD ...)
(Abs ...) -> (ABSD ...)
// TODO: optimize this for ARMv5 and ARMv6
(Ctz32NonZero x) -> (Ctz32 x)
(Ctz16NonZero x) -> (Ctz32 x)
(Ctz8NonZero x) -> (Ctz32 x)
(Ctz32NonZero ...) -> (Ctz32 ...)
(Ctz16NonZero ...) -> (Ctz32 ...)
(Ctz8NonZero ...) -> (Ctz32 ...)
// count trailing zero for ARMv5 and ARMv6
// 32 - CLZ(x&-x - 1)
@ -98,10 +98,10 @@
(Bswap32 x) && objabi.GOARM>=6 -> (REV 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)
// shifts
@ -169,46 +169,43 @@
(Rsh8x64 x (Const64 [c])) && uint64(c) >= 8 -> (SRAconst (SLLconst <typ.UInt32> x [24]) [31])
// constants
(Const8 [val]) -> (MOVWconst [val])
(Const16 [val]) -> (MOVWconst [val])
(Const32 [val]) -> (MOVWconst [val])
(Const32F [val]) -> (MOVFconst [val])
(Const64F [val]) -> (MOVDconst [val])
(Const(8|16|32) ...) -> (MOVWconst ...)
(Const(32F|64F) ...) -> (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) -> (SRAconst (RSBshiftRL <typ.Int32> x x [1]) [31]) // sign bit of uint32(x)>>1 - x
(Slicemask <t> x) -> (SRAconst (RSBconst <t> [0] x) [31])
// float <-> int conversion
(Cvt32to32F x) -> (MOVWF x)
(Cvt32to64F x) -> (MOVWD x)
(Cvt32Uto32F x) -> (MOVWUF x)
(Cvt32Uto64F x) -> (MOVWUD x)
(Cvt32Fto32 x) -> (MOVFW x)
(Cvt64Fto32 x) -> (MOVDW x)
(Cvt32Fto32U x) -> (MOVFWU x)
(Cvt64Fto32U x) -> (MOVDWU x)
(Cvt32Fto64F x) -> (MOVFD x)
(Cvt64Fto32F x) -> (MOVDF x)
(Cvt32to32F ...) -> (MOVWF ...)
(Cvt32to64F ...) -> (MOVWD ...)
(Cvt32Uto32F ...) -> (MOVWUF ...)
(Cvt32Uto64F ...) -> (MOVWUD ...)
(Cvt32Fto32 ...) -> (MOVFW ...)
(Cvt64Fto32 ...) -> (MOVDW ...)
(Cvt32Fto32U ...) -> (MOVFWU ...)
(Cvt64Fto32U ...) -> (MOVDWU ...)
(Cvt32Fto64F ...) -> (MOVFD ...)
(Cvt64Fto32F ...) -> (MOVDF ...)
(Round(32|64)F x) -> x
(Round(32|64)F ...) -> (Copy ...)
// fused-multiply-add
(FMA x y z) -> (FMULAD z x y)
@ -265,7 +262,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
@ -366,20 +363,20 @@
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 ...)
// checks
(NilCheck ptr mem) -> (LoweredNilCheck ptr mem)
(NilCheck ...) -> (LoweredNilCheck ...)
(IsNonNil ptr) -> (NotEqual (CMPconst [0] ptr))
(IsInBounds idx len) -> (LessThanU (CMP idx len))
(IsSliceInBounds idx len) -> (LessEqualU (CMP idx len))
// pseudo-ops
(GetClosurePtr) -> (LoweredGetClosurePtr)
(GetCallerSP) -> (LoweredGetCallerSP)
(GetCallerPC) -> (LoweredGetCallerPC)
(GetClosurePtr ...) -> (LoweredGetClosurePtr ...)
(GetCallerSP ...) -> (LoweredGetCallerSP ...)
(GetCallerPC ...) -> (LoweredGetCallerPC ...)
// Absorb pseudo-ops into blocks.
(If (Equal cc) yes no) -> (EQ cc yes no)
@ -408,7 +405,7 @@
(NE (CMPconst [0] (GreaterEqualU cc)) yes no) -> (UGE cc 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