cmd/compile: adopt strong aux typing for some s390x rules

Convert the remaining lowering rules to strongly-typed versions.

Passes toolstash-check.
Change-Id: I583786806d55376f5463addab8fec32cb59fa7a6
Reviewed-on: https://go-review.googlesource.com/c/go/+/230939
Reviewed-by: Michael Munday <mike.munday@ibm.com>
Run-TryBot: Michael Munday <mike.munday@ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Ruixin Bao 2020-04-29 16:09:12 -07:00 committed by Michael Munday
parent c76befe0f4
commit 1d9801223e
2 changed files with 300 additions and 85 deletions

View File

@ -22,7 +22,7 @@
(Div32F ...) => (FDIVS ...) (Div32F ...) => (FDIVS ...)
(Div64F ...) => (FDIV ...) (Div64F ...) => (FDIV ...)
(Div64 ...) -> (DIVD ...) (Div64 x y) => (DIVD x y)
(Div64u ...) => (DIVDU ...) (Div64u ...) => (DIVDU ...)
// DIVW/DIVWU has a 64-bit dividend and a 32-bit divisor, // DIVW/DIVWU has a 64-bit dividend and a 32-bit divisor,
// so a sign/zero extension of the dividend is required. // so a sign/zero extension of the dividend is required.
@ -37,7 +37,7 @@
(Hmul32 x y) => (SRDconst [32] (MULLD (MOVWreg x) (MOVWreg y))) (Hmul32 x y) => (SRDconst [32] (MULLD (MOVWreg x) (MOVWreg y)))
(Hmul32u x y) => (SRDconst [32] (MULLD (MOVWZreg x) (MOVWZreg y))) (Hmul32u x y) => (SRDconst [32] (MULLD (MOVWZreg x) (MOVWZreg y)))
(Mod64 ...) -> (MODD ...) (Mod64 x y) => (MODD x y)
(Mod64u ...) => (MODDU ...) (Mod64u ...) => (MODDU ...)
// MODW/MODWU has a 64-bit dividend and a 32-bit divisor, // MODW/MODWU has a 64-bit dividend and a 32-bit divisor,
// so a sign/zero extension of the dividend is required. // so a sign/zero extension of the dividend is required.
@ -76,9 +76,9 @@
(Not x) => (XORWconst [1] x) (Not x) => (XORWconst [1] x)
// Lowering pointer arithmetic // Lowering pointer arithmetic
(OffPtr [off] ptr:(SP)) -> (MOVDaddr [off] ptr) (OffPtr [off] ptr:(SP)) => (MOVDaddr [int32(off)] ptr)
(OffPtr [off] ptr) && is32Bit(off) -> (ADDconst [off] ptr) (OffPtr [off] ptr) && is32Bit(off) => (ADDconst [int32(off)] ptr)
(OffPtr [off] ptr) -> (ADD (MOVDconst [off]) ptr) (OffPtr [off] ptr) => (ADD (MOVDconst [off]) ptr)
// TODO: optimize these cases? // TODO: optimize these cases?
(Ctz64NonZero ...) => (Ctz64 ...) (Ctz64NonZero ...) => (Ctz64 ...)
@ -146,11 +146,11 @@
// The SYNC instruction (fast-BCR-serialization) prevents store-load // The SYNC instruction (fast-BCR-serialization) prevents store-load
// reordering. Other sequences of memory operations (load-load, // reordering. Other sequences of memory operations (load-load,
// store-store and load-store) are already guaranteed not to be reordered. // store-store and load-store) are already guaranteed not to be reordered.
(AtomicLoad(8|32|Acq32|64|Ptr) ...) -> (MOV(BZ|WZ|WZ|D|D)atomicload ...) (AtomicLoad(8|32|Acq32|64|Ptr) ptr mem) => (MOV(BZ|WZ|WZ|D|D)atomicload ptr mem)
(AtomicStore(8|32|64|PtrNoWB) ptr val mem) => (SYNC (MOV(B|W|D|D)atomicstore ptr val mem)) (AtomicStore(8|32|64|PtrNoWB) ptr val mem) => (SYNC (MOV(B|W|D|D)atomicstore ptr val mem))
// Store-release doesn't require store-load ordering. // Store-release doesn't require store-load ordering.
(AtomicStoreRel32 ...) -> (MOVWatomicstore ...) (AtomicStoreRel32 ptr val mem) => (MOVWatomicstore ptr val mem)
// Atomic adds. // Atomic adds.
(AtomicAdd32 ptr val mem) => (AddTupleFirst32 val (LAA ptr val mem)) (AtomicAdd32 ptr val mem) => (AddTupleFirst32 val (LAA ptr val mem))
@ -161,12 +161,12 @@
(Select1 (AddTupleFirst64 _ tuple)) => (Select1 tuple) (Select1 (AddTupleFirst64 _ tuple)) => (Select1 tuple)
// Atomic exchanges. // Atomic exchanges.
(AtomicExchange32 ...) -> (LoweredAtomicExchange32 ...) (AtomicExchange32 ptr val mem) => (LoweredAtomicExchange32 ptr val mem)
(AtomicExchange64 ...) -> (LoweredAtomicExchange64 ...) (AtomicExchange64 ptr val mem) => (LoweredAtomicExchange64 ptr val mem)
// Atomic compare and swap. // Atomic compare and swap.
(AtomicCompareAndSwap32 ...) -> (LoweredAtomicCas32 ...) (AtomicCompareAndSwap32 ptr old new_ mem) => (LoweredAtomicCas32 ptr old new_ mem)
(AtomicCompareAndSwap64 ...) -> (LoweredAtomicCas64 ...) (AtomicCompareAndSwap64 ptr old new_ mem) => (LoweredAtomicCas64 ptr old new_ mem)
// Atomic and: *(*uint8)(ptr) &= val // Atomic and: *(*uint8)(ptr) &= val
// //
@ -342,13 +342,13 @@
// Lowering stores // Lowering stores
// These more-specific FP versions of Store pattern should come first. // These more-specific FP versions of Store pattern should come first.
(Store {t} ptr val mem) && t.(*types.Type).Size() == 8 && is64BitFloat(val.Type) -> (FMOVDstore ptr val mem) (Store {t} ptr val mem) && t.Size() == 8 && is64BitFloat(val.Type) => (FMOVDstore ptr val mem)
(Store {t} ptr val mem) && t.(*types.Type).Size() == 4 && is32BitFloat(val.Type) -> (FMOVSstore ptr val mem) (Store {t} ptr val mem) && t.Size() == 4 && is32BitFloat(val.Type) => (FMOVSstore ptr val mem)
(Store {t} ptr val mem) && t.(*types.Type).Size() == 8 -> (MOVDstore ptr val mem) (Store {t} ptr val mem) && t.Size() == 8 => (MOVDstore ptr val mem)
(Store {t} ptr val mem) && t.(*types.Type).Size() == 4 -> (MOVWstore ptr val mem) (Store {t} ptr val mem) && t.Size() == 4 => (MOVWstore ptr val mem)
(Store {t} ptr val mem) && t.(*types.Type).Size() == 2 -> (MOVHstore ptr val mem) (Store {t} ptr val mem) && t.Size() == 2 => (MOVHstore ptr val mem)
(Store {t} ptr val mem) && t.(*types.Type).Size() == 1 -> (MOVBstore ptr val mem) (Store {t} ptr val mem) && t.Size() == 1 => (MOVBstore ptr val mem)
// Lowering moves // Lowering moves
@ -420,10 +420,10 @@
(LoweredZero [s%256] destptr (ADDconst <destptr.Type> destptr [(int32(s)/256)*256]) mem) (LoweredZero [s%256] destptr (ADDconst <destptr.Type> destptr [(int32(s)/256)*256]) mem)
// Lowering constants // Lowering constants
(Const(64|32|16|8) ...) -> (MOVDconst ...) (Const(64|32|16|8) [val]) => (MOVDconst [int64(val)])
(Const(32|64)F ...) => (FMOV(S|D)const ...) (Const(32|64)F ...) => (FMOV(S|D)const ...)
(ConstNil) => (MOVDconst [0]) (ConstNil) => (MOVDconst [0])
(ConstBool ...) -> (MOVDconst ...) (ConstBool [b]) => (MOVDconst [b2i(b)])
// Lowering calls // Lowering calls
(StaticCall ...) => (CALLstatic ...) (StaticCall ...) => (CALLstatic ...)
@ -439,8 +439,8 @@
(GetClosurePtr ...) => (LoweredGetClosurePtr ...) (GetClosurePtr ...) => (LoweredGetClosurePtr ...)
(GetCallerSP ...) => (LoweredGetCallerSP ...) (GetCallerSP ...) => (LoweredGetCallerSP ...)
(GetCallerPC ...) => (LoweredGetCallerPC ...) (GetCallerPC ...) => (LoweredGetCallerPC ...)
(Addr ...) -> (MOVDaddr ...) (Addr {sym} base) => (MOVDaddr {sym} base)
(LocalAddr {sym} base _) -> (MOVDaddr {sym} base) (LocalAddr {sym} base _) => (MOVDaddr {sym} base)
(ITab (Load ptr mem)) => (MOVDload ptr mem) (ITab (Load ptr mem)) => (MOVDload ptr mem)
// block rewrites // block rewrites

View File

@ -28,8 +28,7 @@ func rewriteValueS390X(v *Value) bool {
v.Op = OpS390XADD v.Op = OpS390XADD
return true return true
case OpAddr: case OpAddr:
v.Op = OpS390XMOVDaddr return rewriteValueS390X_OpAddr(v)
return true
case OpAnd16: case OpAnd16:
v.Op = OpS390XANDW v.Op = OpS390XANDW
return true return true
@ -52,32 +51,23 @@ func rewriteValueS390X(v *Value) bool {
case OpAtomicAnd8: case OpAtomicAnd8:
return rewriteValueS390X_OpAtomicAnd8(v) return rewriteValueS390X_OpAtomicAnd8(v)
case OpAtomicCompareAndSwap32: case OpAtomicCompareAndSwap32:
v.Op = OpS390XLoweredAtomicCas32 return rewriteValueS390X_OpAtomicCompareAndSwap32(v)
return true
case OpAtomicCompareAndSwap64: case OpAtomicCompareAndSwap64:
v.Op = OpS390XLoweredAtomicCas64 return rewriteValueS390X_OpAtomicCompareAndSwap64(v)
return true
case OpAtomicExchange32: case OpAtomicExchange32:
v.Op = OpS390XLoweredAtomicExchange32 return rewriteValueS390X_OpAtomicExchange32(v)
return true
case OpAtomicExchange64: case OpAtomicExchange64:
v.Op = OpS390XLoweredAtomicExchange64 return rewriteValueS390X_OpAtomicExchange64(v)
return true
case OpAtomicLoad32: case OpAtomicLoad32:
v.Op = OpS390XMOVWZatomicload return rewriteValueS390X_OpAtomicLoad32(v)
return true
case OpAtomicLoad64: case OpAtomicLoad64:
v.Op = OpS390XMOVDatomicload return rewriteValueS390X_OpAtomicLoad64(v)
return true
case OpAtomicLoad8: case OpAtomicLoad8:
v.Op = OpS390XMOVBZatomicload return rewriteValueS390X_OpAtomicLoad8(v)
return true
case OpAtomicLoadAcq32: case OpAtomicLoadAcq32:
v.Op = OpS390XMOVWZatomicload return rewriteValueS390X_OpAtomicLoadAcq32(v)
return true
case OpAtomicLoadPtr: case OpAtomicLoadPtr:
v.Op = OpS390XMOVDatomicload return rewriteValueS390X_OpAtomicLoadPtr(v)
return true
case OpAtomicOr8: case OpAtomicOr8:
return rewriteValueS390X_OpAtomicOr8(v) return rewriteValueS390X_OpAtomicOr8(v)
case OpAtomicStore32: case OpAtomicStore32:
@ -89,8 +79,7 @@ func rewriteValueS390X(v *Value) bool {
case OpAtomicStorePtrNoWB: case OpAtomicStorePtrNoWB:
return rewriteValueS390X_OpAtomicStorePtrNoWB(v) return rewriteValueS390X_OpAtomicStorePtrNoWB(v)
case OpAtomicStoreRel32: case OpAtomicStoreRel32:
v.Op = OpS390XMOVWatomicstore return rewriteValueS390X_OpAtomicStoreRel32(v)
return true
case OpAvg64u: case OpAvg64u:
return rewriteValueS390X_OpAvg64u(v) return rewriteValueS390X_OpAvg64u(v)
case OpBitLen64: case OpBitLen64:
@ -119,26 +108,21 @@ func rewriteValueS390X(v *Value) bool {
v.Op = OpS390XNOTW v.Op = OpS390XNOTW
return true return true
case OpConst16: case OpConst16:
v.Op = OpS390XMOVDconst return rewriteValueS390X_OpConst16(v)
return true
case OpConst32: case OpConst32:
v.Op = OpS390XMOVDconst return rewriteValueS390X_OpConst32(v)
return true
case OpConst32F: case OpConst32F:
v.Op = OpS390XFMOVSconst v.Op = OpS390XFMOVSconst
return true return true
case OpConst64: case OpConst64:
v.Op = OpS390XMOVDconst return rewriteValueS390X_OpConst64(v)
return true
case OpConst64F: case OpConst64F:
v.Op = OpS390XFMOVDconst v.Op = OpS390XFMOVDconst
return true return true
case OpConst8: case OpConst8:
v.Op = OpS390XMOVDconst return rewriteValueS390X_OpConst8(v)
return true
case OpConstBool: case OpConstBool:
v.Op = OpS390XMOVDconst return rewriteValueS390X_OpConstBool(v)
return true
case OpConstNil: case OpConstNil:
return rewriteValueS390X_OpConstNil(v) return rewriteValueS390X_OpConstNil(v)
case OpCtz32: case OpCtz32:
@ -220,8 +204,7 @@ func rewriteValueS390X(v *Value) bool {
case OpDiv32u: case OpDiv32u:
return rewriteValueS390X_OpDiv32u(v) return rewriteValueS390X_OpDiv32u(v)
case OpDiv64: case OpDiv64:
v.Op = OpS390XDIVD return rewriteValueS390X_OpDiv64(v)
return true
case OpDiv64F: case OpDiv64F:
v.Op = OpS390XFDIV v.Op = OpS390XFDIV
return true return true
@ -370,8 +353,7 @@ func rewriteValueS390X(v *Value) bool {
case OpMod32u: case OpMod32u:
return rewriteValueS390X_OpMod32u(v) return rewriteValueS390X_OpMod32u(v)
case OpMod64: case OpMod64:
v.Op = OpS390XMODD return rewriteValueS390X_OpMod64(v)
return true
case OpMod64u: case OpMod64u:
v.Op = OpS390XMODDU v.Op = OpS390XMODDU
return true return true
@ -945,6 +927,19 @@ func rewriteValueS390X_OpAdd64F(v *Value) bool {
return true return true
} }
} }
func rewriteValueS390X_OpAddr(v *Value) bool {
v_0 := v.Args[0]
// match: (Addr {sym} base)
// result: (MOVDaddr {sym} base)
for {
sym := auxToSym(v.Aux)
base := v_0
v.reset(OpS390XMOVDaddr)
v.Aux = symToAux(sym)
v.AddArg(base)
return true
}
}
func rewriteValueS390X_OpAtomicAdd32(v *Value) bool { func rewriteValueS390X_OpAtomicAdd32(v *Value) bool {
v_2 := v.Args[2] v_2 := v.Args[2]
v_1 := v.Args[1] v_1 := v.Args[1]
@ -1010,6 +1005,135 @@ func rewriteValueS390X_OpAtomicAnd8(v *Value) bool {
return true return true
} }
} }
func rewriteValueS390X_OpAtomicCompareAndSwap32(v *Value) bool {
v_3 := v.Args[3]
v_2 := v.Args[2]
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (AtomicCompareAndSwap32 ptr old new_ mem)
// result: (LoweredAtomicCas32 ptr old new_ mem)
for {
ptr := v_0
old := v_1
new_ := v_2
mem := v_3
v.reset(OpS390XLoweredAtomicCas32)
v.AddArg4(ptr, old, new_, mem)
return true
}
}
func rewriteValueS390X_OpAtomicCompareAndSwap64(v *Value) bool {
v_3 := v.Args[3]
v_2 := v.Args[2]
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (AtomicCompareAndSwap64 ptr old new_ mem)
// result: (LoweredAtomicCas64 ptr old new_ mem)
for {
ptr := v_0
old := v_1
new_ := v_2
mem := v_3
v.reset(OpS390XLoweredAtomicCas64)
v.AddArg4(ptr, old, new_, mem)
return true
}
}
func rewriteValueS390X_OpAtomicExchange32(v *Value) bool {
v_2 := v.Args[2]
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (AtomicExchange32 ptr val mem)
// result: (LoweredAtomicExchange32 ptr val mem)
for {
ptr := v_0
val := v_1
mem := v_2
v.reset(OpS390XLoweredAtomicExchange32)
v.AddArg3(ptr, val, mem)
return true
}
}
func rewriteValueS390X_OpAtomicExchange64(v *Value) bool {
v_2 := v.Args[2]
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (AtomicExchange64 ptr val mem)
// result: (LoweredAtomicExchange64 ptr val mem)
for {
ptr := v_0
val := v_1
mem := v_2
v.reset(OpS390XLoweredAtomicExchange64)
v.AddArg3(ptr, val, mem)
return true
}
}
func rewriteValueS390X_OpAtomicLoad32(v *Value) bool {
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (AtomicLoad32 ptr mem)
// result: (MOVWZatomicload ptr mem)
for {
ptr := v_0
mem := v_1
v.reset(OpS390XMOVWZatomicload)
v.AddArg2(ptr, mem)
return true
}
}
func rewriteValueS390X_OpAtomicLoad64(v *Value) bool {
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (AtomicLoad64 ptr mem)
// result: (MOVDatomicload ptr mem)
for {
ptr := v_0
mem := v_1
v.reset(OpS390XMOVDatomicload)
v.AddArg2(ptr, mem)
return true
}
}
func rewriteValueS390X_OpAtomicLoad8(v *Value) bool {
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (AtomicLoad8 ptr mem)
// result: (MOVBZatomicload ptr mem)
for {
ptr := v_0
mem := v_1
v.reset(OpS390XMOVBZatomicload)
v.AddArg2(ptr, mem)
return true
}
}
func rewriteValueS390X_OpAtomicLoadAcq32(v *Value) bool {
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (AtomicLoadAcq32 ptr mem)
// result: (MOVWZatomicload ptr mem)
for {
ptr := v_0
mem := v_1
v.reset(OpS390XMOVWZatomicload)
v.AddArg2(ptr, mem)
return true
}
}
func rewriteValueS390X_OpAtomicLoadPtr(v *Value) bool {
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (AtomicLoadPtr ptr mem)
// result: (MOVDatomicload ptr mem)
for {
ptr := v_0
mem := v_1
v.reset(OpS390XMOVDatomicload)
v.AddArg2(ptr, mem)
return true
}
}
func rewriteValueS390X_OpAtomicOr8(v *Value) bool { func rewriteValueS390X_OpAtomicOr8(v *Value) bool {
v_2 := v.Args[2] v_2 := v.Args[2]
v_1 := v.Args[1] v_1 := v.Args[1]
@ -1108,6 +1232,21 @@ func rewriteValueS390X_OpAtomicStorePtrNoWB(v *Value) bool {
return true return true
} }
} }
func rewriteValueS390X_OpAtomicStoreRel32(v *Value) bool {
v_2 := v.Args[2]
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (AtomicStoreRel32 ptr val mem)
// result: (MOVWatomicstore ptr val mem)
for {
ptr := v_0
val := v_1
mem := v_2
v.reset(OpS390XMOVWatomicstore)
v.AddArg3(ptr, val, mem)
return true
}
}
func rewriteValueS390X_OpAvg64u(v *Value) bool { func rewriteValueS390X_OpAvg64u(v *Value) bool {
v_1 := v.Args[1] v_1 := v.Args[1]
v_0 := v.Args[0] v_0 := v.Args[0]
@ -1157,6 +1296,56 @@ func rewriteValueS390X_OpCeil(v *Value) bool {
return true return true
} }
} }
func rewriteValueS390X_OpConst16(v *Value) bool {
// match: (Const16 [val])
// result: (MOVDconst [int64(val)])
for {
val := auxIntToInt16(v.AuxInt)
v.reset(OpS390XMOVDconst)
v.AuxInt = int64ToAuxInt(int64(val))
return true
}
}
func rewriteValueS390X_OpConst32(v *Value) bool {
// match: (Const32 [val])
// result: (MOVDconst [int64(val)])
for {
val := auxIntToInt32(v.AuxInt)
v.reset(OpS390XMOVDconst)
v.AuxInt = int64ToAuxInt(int64(val))
return true
}
}
func rewriteValueS390X_OpConst64(v *Value) bool {
// match: (Const64 [val])
// result: (MOVDconst [int64(val)])
for {
val := auxIntToInt64(v.AuxInt)
v.reset(OpS390XMOVDconst)
v.AuxInt = int64ToAuxInt(int64(val))
return true
}
}
func rewriteValueS390X_OpConst8(v *Value) bool {
// match: (Const8 [val])
// result: (MOVDconst [int64(val)])
for {
val := auxIntToInt8(v.AuxInt)
v.reset(OpS390XMOVDconst)
v.AuxInt = int64ToAuxInt(int64(val))
return true
}
}
func rewriteValueS390X_OpConstBool(v *Value) bool {
// match: (ConstBool [b])
// result: (MOVDconst [b2i(b)])
for {
b := auxIntToBool(v.AuxInt)
v.reset(OpS390XMOVDconst)
v.AuxInt = int64ToAuxInt(b2i(b))
return true
}
}
func rewriteValueS390X_OpConstNil(v *Value) bool { func rewriteValueS390X_OpConstNil(v *Value) bool {
// match: (ConstNil) // match: (ConstNil)
// result: (MOVDconst [0]) // result: (MOVDconst [0])
@ -1290,6 +1479,19 @@ func rewriteValueS390X_OpDiv32u(v *Value) bool {
return true return true
} }
} }
func rewriteValueS390X_OpDiv64(v *Value) bool {
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (Div64 x y)
// result: (DIVD x y)
for {
x := v_0
y := v_1
v.reset(OpS390XDIVD)
v.AddArg2(x, y)
return true
}
}
func rewriteValueS390X_OpDiv8(v *Value) bool { func rewriteValueS390X_OpDiv8(v *Value) bool {
v_1 := v.Args[1] v_1 := v.Args[1]
v_0 := v.Args[0] v_0 := v.Args[0]
@ -2276,10 +2478,10 @@ func rewriteValueS390X_OpLocalAddr(v *Value) bool {
// match: (LocalAddr {sym} base _) // match: (LocalAddr {sym} base _)
// result: (MOVDaddr {sym} base) // result: (MOVDaddr {sym} base)
for { for {
sym := v.Aux sym := auxToSym(v.Aux)
base := v_0 base := v_0
v.reset(OpS390XMOVDaddr) v.reset(OpS390XMOVDaddr)
v.Aux = sym v.Aux = symToAux(sym)
v.AddArg(base) v.AddArg(base)
return true return true
} }
@ -2980,6 +3182,19 @@ func rewriteValueS390X_OpMod32u(v *Value) bool {
return true return true
} }
} }
func rewriteValueS390X_OpMod64(v *Value) bool {
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (Mod64 x y)
// result: (MODD x y)
for {
x := v_0
y := v_1
v.reset(OpS390XMODD)
v.AddArg2(x, y)
return true
}
}
func rewriteValueS390X_OpMod8(v *Value) bool { func rewriteValueS390X_OpMod8(v *Value) bool {
v_1 := v.Args[1] v_1 := v.Args[1]
v_0 := v.Args[0] v_0 := v.Args[0]
@ -3541,40 +3756,40 @@ func rewriteValueS390X_OpOffPtr(v *Value) bool {
b := v.Block b := v.Block
typ := &b.Func.Config.Types typ := &b.Func.Config.Types
// match: (OffPtr [off] ptr:(SP)) // match: (OffPtr [off] ptr:(SP))
// result: (MOVDaddr [off] ptr) // result: (MOVDaddr [int32(off)] ptr)
for { for {
off := v.AuxInt off := auxIntToInt64(v.AuxInt)
ptr := v_0 ptr := v_0
if ptr.Op != OpSP { if ptr.Op != OpSP {
break break
} }
v.reset(OpS390XMOVDaddr) v.reset(OpS390XMOVDaddr)
v.AuxInt = off v.AuxInt = int32ToAuxInt(int32(off))
v.AddArg(ptr) v.AddArg(ptr)
return true return true
} }
// match: (OffPtr [off] ptr) // match: (OffPtr [off] ptr)
// cond: is32Bit(off) // cond: is32Bit(off)
// result: (ADDconst [off] ptr) // result: (ADDconst [int32(off)] ptr)
for { for {
off := v.AuxInt off := auxIntToInt64(v.AuxInt)
ptr := v_0 ptr := v_0
if !(is32Bit(off)) { if !(is32Bit(off)) {
break break
} }
v.reset(OpS390XADDconst) v.reset(OpS390XADDconst)
v.AuxInt = off v.AuxInt = int32ToAuxInt(int32(off))
v.AddArg(ptr) v.AddArg(ptr)
return true return true
} }
// match: (OffPtr [off] ptr) // match: (OffPtr [off] ptr)
// result: (ADD (MOVDconst [off]) ptr) // result: (ADD (MOVDconst [off]) ptr)
for { for {
off := v.AuxInt off := auxIntToInt64(v.AuxInt)
ptr := v_0 ptr := v_0
v.reset(OpS390XADD) v.reset(OpS390XADD)
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64) v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = off v0.AuxInt = int64ToAuxInt(off)
v.AddArg2(v0, ptr) v.AddArg2(v0, ptr)
return true return true
} }
@ -18708,14 +18923,14 @@ func rewriteValueS390X_OpStore(v *Value) bool {
v_1 := v.Args[1] v_1 := v.Args[1]
v_0 := v.Args[0] v_0 := v.Args[0]
// match: (Store {t} ptr val mem) // match: (Store {t} ptr val mem)
// cond: t.(*types.Type).Size() == 8 && is64BitFloat(val.Type) // cond: t.Size() == 8 && is64BitFloat(val.Type)
// result: (FMOVDstore ptr val mem) // result: (FMOVDstore ptr val mem)
for { for {
t := v.Aux t := auxToType(v.Aux)
ptr := v_0 ptr := v_0
val := v_1 val := v_1
mem := v_2 mem := v_2
if !(t.(*types.Type).Size() == 8 && is64BitFloat(val.Type)) { if !(t.Size() == 8 && is64BitFloat(val.Type)) {
break break
} }
v.reset(OpS390XFMOVDstore) v.reset(OpS390XFMOVDstore)
@ -18723,14 +18938,14 @@ func rewriteValueS390X_OpStore(v *Value) bool {
return true return true
} }
// match: (Store {t} ptr val mem) // match: (Store {t} ptr val mem)
// cond: t.(*types.Type).Size() == 4 && is32BitFloat(val.Type) // cond: t.Size() == 4 && is32BitFloat(val.Type)
// result: (FMOVSstore ptr val mem) // result: (FMOVSstore ptr val mem)
for { for {
t := v.Aux t := auxToType(v.Aux)
ptr := v_0 ptr := v_0
val := v_1 val := v_1
mem := v_2 mem := v_2
if !(t.(*types.Type).Size() == 4 && is32BitFloat(val.Type)) { if !(t.Size() == 4 && is32BitFloat(val.Type)) {
break break
} }
v.reset(OpS390XFMOVSstore) v.reset(OpS390XFMOVSstore)
@ -18738,14 +18953,14 @@ func rewriteValueS390X_OpStore(v *Value) bool {
return true return true
} }
// match: (Store {t} ptr val mem) // match: (Store {t} ptr val mem)
// cond: t.(*types.Type).Size() == 8 // cond: t.Size() == 8
// result: (MOVDstore ptr val mem) // result: (MOVDstore ptr val mem)
for { for {
t := v.Aux t := auxToType(v.Aux)
ptr := v_0 ptr := v_0
val := v_1 val := v_1
mem := v_2 mem := v_2
if !(t.(*types.Type).Size() == 8) { if !(t.Size() == 8) {
break break
} }
v.reset(OpS390XMOVDstore) v.reset(OpS390XMOVDstore)
@ -18753,14 +18968,14 @@ func rewriteValueS390X_OpStore(v *Value) bool {
return true return true
} }
// match: (Store {t} ptr val mem) // match: (Store {t} ptr val mem)
// cond: t.(*types.Type).Size() == 4 // cond: t.Size() == 4
// result: (MOVWstore ptr val mem) // result: (MOVWstore ptr val mem)
for { for {
t := v.Aux t := auxToType(v.Aux)
ptr := v_0 ptr := v_0
val := v_1 val := v_1
mem := v_2 mem := v_2
if !(t.(*types.Type).Size() == 4) { if !(t.Size() == 4) {
break break
} }
v.reset(OpS390XMOVWstore) v.reset(OpS390XMOVWstore)
@ -18768,14 +18983,14 @@ func rewriteValueS390X_OpStore(v *Value) bool {
return true return true
} }
// match: (Store {t} ptr val mem) // match: (Store {t} ptr val mem)
// cond: t.(*types.Type).Size() == 2 // cond: t.Size() == 2
// result: (MOVHstore ptr val mem) // result: (MOVHstore ptr val mem)
for { for {
t := v.Aux t := auxToType(v.Aux)
ptr := v_0 ptr := v_0
val := v_1 val := v_1
mem := v_2 mem := v_2
if !(t.(*types.Type).Size() == 2) { if !(t.Size() == 2) {
break break
} }
v.reset(OpS390XMOVHstore) v.reset(OpS390XMOVHstore)
@ -18783,14 +18998,14 @@ func rewriteValueS390X_OpStore(v *Value) bool {
return true return true
} }
// match: (Store {t} ptr val mem) // match: (Store {t} ptr val mem)
// cond: t.(*types.Type).Size() == 1 // cond: t.Size() == 1
// result: (MOVBstore ptr val mem) // result: (MOVBstore ptr val mem)
for { for {
t := v.Aux t := auxToType(v.Aux)
ptr := v_0 ptr := v_0
val := v_1 val := v_1
mem := v_2 mem := v_2
if !(t.(*types.Type).Size() == 1) { if !(t.Size() == 1) {
break break
} }
v.reset(OpS390XMOVBstore) v.reset(OpS390XMOVBstore)