// Unsigned shifts need to return 0 if shift amount is >= width of shifted value.
// result = shift >= 64 ? 0 : arg << shift
-(Lsh(64|32|16|8)x64 <t> x y) -> (MOVDGE <t> (SL(D|W|W|W) <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
-(Lsh(64|32|16|8)x32 <t> x y) -> (MOVDGE <t> (SL(D|W|W|W) <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
-(Lsh(64|32|16|8)x16 <t> x y) -> (MOVDGE <t> (SL(D|W|W|W) <t> x y) (MOVDconst [0]) (CMPWUconst (MOVHZreg y) [64]))
-(Lsh(64|32|16|8)x8 <t> x y) -> (MOVDGE <t> (SL(D|W|W|W) <t> x y) (MOVDconst [0]) (CMPWUconst (MOVBZreg y) [64]))
+(Lsh(64|32|16|8)x64 <t> x y) -> (LOCGR {s390x.GreaterOrEqual} <t> (SL(D|W|W|W) <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
+(Lsh(64|32|16|8)x32 <t> x y) -> (LOCGR {s390x.GreaterOrEqual} <t> (SL(D|W|W|W) <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
+(Lsh(64|32|16|8)x16 <t> x y) -> (LOCGR {s390x.GreaterOrEqual} <t> (SL(D|W|W|W) <t> x y) (MOVDconst [0]) (CMPWUconst (MOVHZreg y) [64]))
+(Lsh(64|32|16|8)x8 <t> x y) -> (LOCGR {s390x.GreaterOrEqual} <t> (SL(D|W|W|W) <t> x y) (MOVDconst [0]) (CMPWUconst (MOVBZreg y) [64]))
-(Rsh(64|32)Ux64 <t> x y) -> (MOVDGE <t> (SR(D|W) <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
-(Rsh(64|32)Ux32 <t> x y) -> (MOVDGE <t> (SR(D|W) <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
-(Rsh(64|32)Ux16 <t> x y) -> (MOVDGE <t> (SR(D|W) <t> x y) (MOVDconst [0]) (CMPWUconst (MOVHZreg y) [64]))
-(Rsh(64|32)Ux8 <t> x y) -> (MOVDGE <t> (SR(D|W) <t> x y) (MOVDconst [0]) (CMPWUconst (MOVBZreg y) [64]))
+(Rsh(64|32)Ux64 <t> x y) -> (LOCGR {s390x.GreaterOrEqual} <t> (SR(D|W) <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
+(Rsh(64|32)Ux32 <t> x y) -> (LOCGR {s390x.GreaterOrEqual} <t> (SR(D|W) <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
+(Rsh(64|32)Ux16 <t> x y) -> (LOCGR {s390x.GreaterOrEqual} <t> (SR(D|W) <t> x y) (MOVDconst [0]) (CMPWUconst (MOVHZreg y) [64]))
+(Rsh(64|32)Ux8 <t> x y) -> (LOCGR {s390x.GreaterOrEqual} <t> (SR(D|W) <t> x y) (MOVDconst [0]) (CMPWUconst (MOVBZreg y) [64]))
-(Rsh(16|8)Ux64 <t> x y) -> (MOVDGE <t> (SRW <t> (MOV(H|B)Zreg x) y) (MOVDconst [0]) (CMPUconst y [64]))
-(Rsh(16|8)Ux32 <t> x y) -> (MOVDGE <t> (SRW <t> (MOV(H|B)Zreg x) y) (MOVDconst [0]) (CMPWUconst y [64]))
-(Rsh(16|8)Ux16 <t> x y) -> (MOVDGE <t> (SRW <t> (MOV(H|B)Zreg x) y) (MOVDconst [0]) (CMPWUconst (MOVHZreg y) [64]))
-(Rsh(16|8)Ux8 <t> x y) -> (MOVDGE <t> (SRW <t> (MOV(H|B)Zreg x) y) (MOVDconst [0]) (CMPWUconst (MOVBZreg y) [64]))
+(Rsh(16|8)Ux64 <t> x y) -> (LOCGR {s390x.GreaterOrEqual} <t> (SRW <t> (MOV(H|B)Zreg x) y) (MOVDconst [0]) (CMPUconst y [64]))
+(Rsh(16|8)Ux32 <t> x y) -> (LOCGR {s390x.GreaterOrEqual} <t> (SRW <t> (MOV(H|B)Zreg x) y) (MOVDconst [0]) (CMPWUconst y [64]))
+(Rsh(16|8)Ux16 <t> x y) -> (LOCGR {s390x.GreaterOrEqual} <t> (SRW <t> (MOV(H|B)Zreg x) y) (MOVDconst [0]) (CMPWUconst (MOVHZreg y) [64]))
+(Rsh(16|8)Ux8 <t> x y) -> (LOCGR {s390x.GreaterOrEqual} <t> (SRW <t> (MOV(H|B)Zreg x) y) (MOVDconst [0]) (CMPWUconst (MOVBZreg y) [64]))
// Signed right shift needs to return 0/-1 if shift amount is >= width of shifted value.
// We implement this by setting the shift value to 63 (all ones) if the shift value is more than 63.
// result = arg >> (shift >= 64 ? 63 : shift)
-(Rsh(64|32)x64 x y) -> (SRA(D|W) x (MOVDGE <y.Type> y (MOVDconst <y.Type> [63]) (CMPUconst y [64])))
-(Rsh(64|32)x32 x y) -> (SRA(D|W) x (MOVDGE <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst y [64])))
-(Rsh(64|32)x16 x y) -> (SRA(D|W) x (MOVDGE <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst (MOVHZreg y) [64])))
-(Rsh(64|32)x8 x y) -> (SRA(D|W) x (MOVDGE <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst (MOVBZreg y) [64])))
+(Rsh(64|32)x64 x y) -> (SRA(D|W) x (LOCGR {s390x.GreaterOrEqual} <y.Type> y (MOVDconst <y.Type> [63]) (CMPUconst y [64])))
+(Rsh(64|32)x32 x y) -> (SRA(D|W) x (LOCGR {s390x.GreaterOrEqual} <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst y [64])))
+(Rsh(64|32)x16 x y) -> (SRA(D|W) x (LOCGR {s390x.GreaterOrEqual} <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst (MOVHZreg y) [64])))
+(Rsh(64|32)x8 x y) -> (SRA(D|W) x (LOCGR {s390x.GreaterOrEqual} <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst (MOVBZreg y) [64])))
-(Rsh(16|8)x64 x y) -> (SRAW (MOV(H|B)reg x) (MOVDGE <y.Type> y (MOVDconst <y.Type> [63]) (CMPUconst y [64])))
-(Rsh(16|8)x32 x y) -> (SRAW (MOV(H|B)reg x) (MOVDGE <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst y [64])))
-(Rsh(16|8)x16 x y) -> (SRAW (MOV(H|B)reg x) (MOVDGE <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst (MOVHZreg y) [64])))
-(Rsh(16|8)x8 x y) -> (SRAW (MOV(H|B)reg x) (MOVDGE <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst (MOVBZreg y) [64])))
+(Rsh(16|8)x64 x y) -> (SRAW (MOV(H|B)reg x) (LOCGR {s390x.GreaterOrEqual} <y.Type> y (MOVDconst <y.Type> [63]) (CMPUconst y [64])))
+(Rsh(16|8)x32 x y) -> (SRAW (MOV(H|B)reg x) (LOCGR {s390x.GreaterOrEqual} <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst y [64])))
+(Rsh(16|8)x16 x y) -> (SRAW (MOV(H|B)reg x) (LOCGR {s390x.GreaterOrEqual} <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst (MOVHZreg y) [64])))
+(Rsh(16|8)x8 x y) -> (SRAW (MOV(H|B)reg x) (LOCGR {s390x.GreaterOrEqual} <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst (MOVBZreg y) [64])))
// Lowering rotates
(RotateLeft8 <t> x (MOVDconst [c])) -> (Or8 (Lsh8x64 <t> x (MOVDconst [c&7])) (Rsh8Ux64 <t> x (MOVDconst [-c&7])))
(RotateLeft64 x y) -> (RLLG x y)
// Lowering comparisons
-(Less64 x y) -> (MOVDLT (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
-(Less32 x y) -> (MOVDLT (MOVDconst [0]) (MOVDconst [1]) (CMPW x y))
-(Less(16|8) x y) -> (MOVDLT (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOV(H|B)reg x) (MOV(H|B)reg y)))
-(Less64U x y) -> (MOVDLT (MOVDconst [0]) (MOVDconst [1]) (CMPU x y))
-(Less32U x y) -> (MOVDLT (MOVDconst [0]) (MOVDconst [1]) (CMPWU x y))
-(Less(16|8)U x y) -> (MOVDLT (MOVDconst [0]) (MOVDconst [1]) (CMPWU (MOV(H|B)Zreg x) (MOV(H|B)Zreg y)))
-// Use SETG with reversed operands to dodge NaN case.
-(Less64F x y) -> (MOVDGTnoinv (MOVDconst [0]) (MOVDconst [1]) (FCMP y x))
-(Less32F x y) -> (MOVDGTnoinv (MOVDconst [0]) (MOVDconst [1]) (FCMPS y x))
-
-(Leq64 x y) -> (MOVDLE (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
-(Leq32 x y) -> (MOVDLE (MOVDconst [0]) (MOVDconst [1]) (CMPW x y))
-(Leq(16|8) x y) -> (MOVDLE (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOV(H|B)reg x) (MOV(H|B)reg y)))
-(Leq64U x y) -> (MOVDLE (MOVDconst [0]) (MOVDconst [1]) (CMPU x y))
-(Leq32U x y) -> (MOVDLE (MOVDconst [0]) (MOVDconst [1]) (CMPWU x y))
-(Leq(16|8)U x y) -> (MOVDLE (MOVDconst [0]) (MOVDconst [1]) (CMPWU (MOV(H|B)Zreg x) (MOV(H|B)Zreg y)))
-// Use SETGE with reversed operands to dodge NaN case.
-(Leq64F x y) -> (MOVDGEnoinv (MOVDconst [0]) (MOVDconst [1]) (FCMP y x))
-(Leq32F x y) -> (MOVDGEnoinv (MOVDconst [0]) (MOVDconst [1]) (FCMPS y x))
-
-(Greater64 x y) -> (MOVDGT (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
-(Greater32 x y) -> (MOVDGT (MOVDconst [0]) (MOVDconst [1]) (CMPW x y))
-(Greater(16|8) x y) -> (MOVDGT (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOV(H|B)reg x) (MOV(H|B)reg y)))
-(Greater64U x y) -> (MOVDGT (MOVDconst [0]) (MOVDconst [1]) (CMPU x y))
-(Greater32U x y) -> (MOVDGT (MOVDconst [0]) (MOVDconst [1]) (CMPWU x y))
-(Greater(16|8)U x y) -> (MOVDGT (MOVDconst [0]) (MOVDconst [1]) (CMPWU (MOV(H|B)Zreg x) (MOV(H|B)Zreg y)))
-(Greater64F x y) -> (MOVDGTnoinv (MOVDconst [0]) (MOVDconst [1]) (FCMP x y))
-(Greater32F x y) -> (MOVDGTnoinv (MOVDconst [0]) (MOVDconst [1]) (FCMPS x y))
-
-(Geq64 x y) -> (MOVDGE (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
-(Geq32 x y) -> (MOVDGE (MOVDconst [0]) (MOVDconst [1]) (CMPW x y))
-(Geq(16|8) x y) -> (MOVDGE (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOV(H|B)reg x) (MOV(H|B)reg y)))
-(Geq64U x y) -> (MOVDGE (MOVDconst [0]) (MOVDconst [1]) (CMPU x y))
-(Geq32U x y) -> (MOVDGE (MOVDconst [0]) (MOVDconst [1]) (CMPWU x y))
-(Geq(16|8)U x y) -> (MOVDGE (MOVDconst [0]) (MOVDconst [1]) (CMPWU (MOV(H|B)Zreg x) (MOV(H|B)Zreg y)))
-(Geq64F x y) -> (MOVDGEnoinv (MOVDconst [0]) (MOVDconst [1]) (FCMP x y))
-(Geq32F x y) -> (MOVDGEnoinv (MOVDconst [0]) (MOVDconst [1]) (FCMPS x y))
-
-(Eq(64|Ptr) x y) -> (MOVDEQ (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
-(Eq32 x y) -> (MOVDEQ (MOVDconst [0]) (MOVDconst [1]) (CMPW x y))
-(Eq(16|8|B) x y) -> (MOVDEQ (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOV(H|B|B)reg x) (MOV(H|B|B)reg y)))
-(Eq64F x y) -> (MOVDEQ (MOVDconst [0]) (MOVDconst [1]) (FCMP x y))
-(Eq32F x y) -> (MOVDEQ (MOVDconst [0]) (MOVDconst [1]) (FCMPS x y))
-
-(Neq(64|Ptr) x y) -> (MOVDNE (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
-(Neq32 x y) -> (MOVDNE (MOVDconst [0]) (MOVDconst [1]) (CMPW x y))
-(Neq(16|8|B) x y) -> (MOVDNE (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOV(H|B|B)reg x) (MOV(H|B|B)reg y)))
-(Neq64F x y) -> (MOVDNE (MOVDconst [0]) (MOVDconst [1]) (FCMP x y))
-(Neq32F x y) -> (MOVDNE (MOVDconst [0]) (MOVDconst [1]) (FCMPS x y))
+(Less64 x y) -> (LOCGR {s390x.Less} (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
+(Less32 x y) -> (LOCGR {s390x.Less} (MOVDconst [0]) (MOVDconst [1]) (CMPW x y))
+(Less(16|8) x y) -> (LOCGR {s390x.Less} (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOV(H|B)reg x) (MOV(H|B)reg y)))
+(Less64U x y) -> (LOCGR {s390x.Less} (MOVDconst [0]) (MOVDconst [1]) (CMPU x y))
+(Less32U x y) -> (LOCGR {s390x.Less} (MOVDconst [0]) (MOVDconst [1]) (CMPWU x y))
+(Less(16|8)U x y) -> (LOCGR {s390x.Less} (MOVDconst [0]) (MOVDconst [1]) (CMPWU (MOV(H|B)Zreg x) (MOV(H|B)Zreg y)))
+(Less64F x y) -> (LOCGR {s390x.Less} (MOVDconst [0]) (MOVDconst [1]) (FCMP x y))
+(Less32F x y) -> (LOCGR {s390x.Less} (MOVDconst [0]) (MOVDconst [1]) (FCMPS x y))
+
+(Leq64 x y) -> (LOCGR {s390x.LessOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
+(Leq32 x y) -> (LOCGR {s390x.LessOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPW x y))
+(Leq(16|8) x y) -> (LOCGR {s390x.LessOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOV(H|B)reg x) (MOV(H|B)reg y)))
+(Leq64U x y) -> (LOCGR {s390x.LessOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPU x y))
+(Leq32U x y) -> (LOCGR {s390x.LessOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPWU x y))
+(Leq(16|8)U x y) -> (LOCGR {s390x.LessOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPWU (MOV(H|B)Zreg x) (MOV(H|B)Zreg y)))
+(Leq64F x y) -> (LOCGR {s390x.LessOrEqual} (MOVDconst [0]) (MOVDconst [1]) (FCMP x y))
+(Leq32F x y) -> (LOCGR {s390x.LessOrEqual} (MOVDconst [0]) (MOVDconst [1]) (FCMPS x y))
+
+(Greater64 x y) -> (LOCGR {s390x.Greater} (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
+(Greater32 x y) -> (LOCGR {s390x.Greater} (MOVDconst [0]) (MOVDconst [1]) (CMPW x y))
+(Greater(16|8) x y) -> (LOCGR {s390x.Greater} (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOV(H|B)reg x) (MOV(H|B)reg y)))
+(Greater64U x y) -> (LOCGR {s390x.Greater} (MOVDconst [0]) (MOVDconst [1]) (CMPU x y))
+(Greater32U x y) -> (LOCGR {s390x.Greater} (MOVDconst [0]) (MOVDconst [1]) (CMPWU x y))
+(Greater(16|8)U x y) -> (LOCGR {s390x.Greater} (MOVDconst [0]) (MOVDconst [1]) (CMPWU (MOV(H|B)Zreg x) (MOV(H|B)Zreg y)))
+(Greater64F x y) -> (LOCGR {s390x.Greater} (MOVDconst [0]) (MOVDconst [1]) (FCMP x y))
+(Greater32F x y) -> (LOCGR {s390x.Greater} (MOVDconst [0]) (MOVDconst [1]) (FCMPS x y))
+
+(Geq64 x y) -> (LOCGR {s390x.GreaterOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
+(Geq32 x y) -> (LOCGR {s390x.GreaterOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPW x y))
+(Geq(16|8) x y) -> (LOCGR {s390x.GreaterOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOV(H|B)reg x) (MOV(H|B)reg y)))
+(Geq64U x y) -> (LOCGR {s390x.GreaterOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPU x y))
+(Geq32U x y) -> (LOCGR {s390x.GreaterOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPWU x y))
+(Geq(16|8)U x y) -> (LOCGR {s390x.GreaterOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPWU (MOV(H|B)Zreg x) (MOV(H|B)Zreg y)))
+(Geq64F x y) -> (LOCGR {s390x.GreaterOrEqual} (MOVDconst [0]) (MOVDconst [1]) (FCMP x y))
+(Geq32F x y) -> (LOCGR {s390x.GreaterOrEqual} (MOVDconst [0]) (MOVDconst [1]) (FCMPS x y))
+
+(Eq(64|Ptr) x y) -> (LOCGR {s390x.Equal} (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
+(Eq32 x y) -> (LOCGR {s390x.Equal} (MOVDconst [0]) (MOVDconst [1]) (CMPW x y))
+(Eq(16|8|B) x y) -> (LOCGR {s390x.Equal} (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOV(H|B|B)reg x) (MOV(H|B|B)reg y)))
+(Eq64F x y) -> (LOCGR {s390x.Equal} (MOVDconst [0]) (MOVDconst [1]) (FCMP x y))
+(Eq32F x y) -> (LOCGR {s390x.Equal} (MOVDconst [0]) (MOVDconst [1]) (FCMPS x y))
+
+(Neq(64|Ptr) x y) -> (LOCGR {s390x.NotEqual} (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
+(Neq32 x y) -> (LOCGR {s390x.NotEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPW x y))
+(Neq(16|8|B) x y) -> (LOCGR {s390x.NotEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOV(H|B|B)reg x) (MOV(H|B|B)reg y)))
+(Neq64F x y) -> (LOCGR {s390x.NotEqual} (MOVDconst [0]) (MOVDconst [1]) (FCMP x y))
+(Neq32F x y) -> (LOCGR {s390x.NotEqual} (MOVDconst [0]) (MOVDconst [1]) (FCMPS x y))
// Lowering loads
(Load <t> ptr mem) && (is64BitInt(t) || isPtr(t)) -> (MOVDload ptr mem)
(InterCall [argwid] entry mem) -> (CALLinter [argwid] entry mem)
// Miscellaneous
-(IsNonNil p) -> (MOVDNE (MOVDconst [0]) (MOVDconst [1]) (CMPconst p [0]))
-(IsInBounds idx len) -> (MOVDLT (MOVDconst [0]) (MOVDconst [1]) (CMPU idx len))
-(IsSliceInBounds idx len) -> (MOVDLE (MOVDconst [0]) (MOVDconst [1]) (CMPU idx len))
+(IsNonNil p) -> (LOCGR {s390x.NotEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPconst p [0]))
+(IsInBounds idx len) -> (LOCGR {s390x.Less} (MOVDconst [0]) (MOVDconst [1]) (CMPU idx len))
+(IsSliceInBounds idx len) -> (LOCGR {s390x.LessOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPU idx len))
(NilCheck ptr mem) -> (LoweredNilCheck ptr mem)
(GetG mem) -> (LoweredGetG mem)
(GetClosurePtr) -> (LoweredGetClosurePtr)
(ITab (Load ptr mem)) -> (MOVDload ptr mem)
// block rewrites
-(If (MOVDLT (MOVDconst [0]) (MOVDconst [1]) cmp) yes no) -> (LT cmp yes no)
-(If (MOVDLE (MOVDconst [0]) (MOVDconst [1]) cmp) yes no) -> (LE cmp yes no)
-(If (MOVDGT (MOVDconst [0]) (MOVDconst [1]) cmp) yes no) -> (GT cmp yes no)
-(If (MOVDGE (MOVDconst [0]) (MOVDconst [1]) cmp) yes no) -> (GE cmp yes no)
-(If (MOVDEQ (MOVDconst [0]) (MOVDconst [1]) cmp) yes no) -> (EQ cmp yes no)
-(If (MOVDNE (MOVDconst [0]) (MOVDconst [1]) cmp) yes no) -> (NE cmp yes no)
-
-// Special case for floating point - LF/LEF not generated.
-(If (MOVDGTnoinv (MOVDconst [0]) (MOVDconst [1]) cmp) yes no) -> (GTF cmp yes no)
-(If (MOVDGEnoinv (MOVDconst [0]) (MOVDconst [1]) cmp) yes no) -> (GEF cmp yes no)
-
-(If cond yes no) -> (NE (CMPWconst [0] (MOVBZreg <typ.Bool> cond)) yes no)
+(If cond yes no) -> (BRC {s390x.NotEqual} (CMPWconst [0] (MOVBZreg <typ.Bool> cond)) yes no)
// Write barrier.
(WB {fn} destptr srcptr mem) -> (LoweredWB {fn} destptr srcptr mem)
// Remove zero extension of conditional move.
// Note: only for MOVBZreg for now since it is added as part of 'if' statement lowering.
-(MOVBZreg x:(MOVD(LT|LE|GT|GE|EQ|NE|GTnoinv|GEnoinv) (MOVDconst [c]) (MOVDconst [d]) _))
+(MOVBZreg x:(LOCGR (MOVDconst [c]) (MOVDconst [d]) _))
&& int64(uint8(c)) == c
&& int64(uint8(d)) == d
&& (!x.Type.IsSigned() || x.Type.Size() > 1)
-> x
// Fold boolean tests into blocks.
-(NE (CMPWconst [0] (MOVDLT (MOVDconst [0]) (MOVDconst [1]) cmp)) yes no) -> (LT cmp yes no)
-(NE (CMPWconst [0] (MOVDLE (MOVDconst [0]) (MOVDconst [1]) cmp)) yes no) -> (LE cmp yes no)
-(NE (CMPWconst [0] (MOVDGT (MOVDconst [0]) (MOVDconst [1]) cmp)) yes no) -> (GT cmp yes no)
-(NE (CMPWconst [0] (MOVDGE (MOVDconst [0]) (MOVDconst [1]) cmp)) yes no) -> (GE cmp yes no)
-(NE (CMPWconst [0] (MOVDEQ (MOVDconst [0]) (MOVDconst [1]) cmp)) yes no) -> (EQ cmp yes no)
-(NE (CMPWconst [0] (MOVDNE (MOVDconst [0]) (MOVDconst [1]) cmp)) yes no) -> (NE cmp yes no)
-(NE (CMPWconst [0] (MOVDGTnoinv (MOVDconst [0]) (MOVDconst [1]) cmp)) yes no) -> (GTF cmp yes no)
-(NE (CMPWconst [0] (MOVDGEnoinv (MOVDconst [0]) (MOVDconst [1]) cmp)) yes no) -> (GEF cmp yes no)
+(BRC {c} (CMPWconst [0] (LOCGR {d} (MOVDconst [0]) (MOVDconst [x]) cmp)) yes no)
+ && x != 0
+ && c.(s390x.CCMask) == s390x.Equal
+ -> (BRC {d} cmp no yes)
+(BRC {c} (CMPWconst [0] (LOCGR {d} (MOVDconst [0]) (MOVDconst [x]) cmp)) yes no)
+ && x != 0
+ && c.(s390x.CCMask) == s390x.NotEqual
+ -> (BRC {d} cmp yes no)
// Fold constants into instructions.
(ADD x (MOVDconst [c])) && is32Bit(c) -> (ADDconst [c] x)
(MOVDaddridx [c] {s} x (ADDconst [d] y)) && is20Bit(c+d) && y.Op != OpSB -> (MOVDaddridx [c+d] {s} x y)
// reverse ordering of compare instruction
-(MOVDLT x y (InvertFlags cmp)) -> (MOVDGT x y cmp)
-(MOVDGT x y (InvertFlags cmp)) -> (MOVDLT x y cmp)
-(MOVDLE x y (InvertFlags cmp)) -> (MOVDGE x y cmp)
-(MOVDGE x y (InvertFlags cmp)) -> (MOVDLE x y cmp)
-(MOVDEQ x y (InvertFlags cmp)) -> (MOVDEQ x y cmp)
-(MOVDNE x y (InvertFlags cmp)) -> (MOVDNE x y cmp)
+(LOCGR {c} x y (InvertFlags cmp)) -> (LOCGR {c.(s390x.CCMask).ReverseComparison()} x y cmp)
// replace load from same location as preceding store with copy
(MOVDload [off] {sym} ptr1 (MOVDstore [off] {sym} ptr2 x _)) && isSamePtr(ptr1, ptr2) -> x
(MOVDaddridx [off1+off2] {mergeSym(sym1,sym2)} x y)
// Absorb InvertFlags into branches.
-((LT|GT|LE|GE|EQ|NE) (InvertFlags cmp) yes no) -> ((GT|LT|GE|LE|EQ|NE) cmp yes no)
+(BRC {c} (InvertFlags cmp) yes no) -> (BRC {c.(s390x.CCMask).ReverseComparison()} cmp yes no)
// Constant comparisons.
(CMPconst (MOVDconst [x]) [y]) && x==y -> (FlagEQ)
(CMP(W|W|WU|WU)const (MOV(W|WZ|W|WZ)reg x) [c]) -> (CMP(W|W|WU|WU)const x [c])
// Absorb flag constants into branches.
-(EQ (FlagEQ) yes no) -> (First nil yes no)
-(EQ (FlagLT) yes no) -> (First nil no yes)
-(EQ (FlagGT) yes no) -> (First nil no yes)
-
-(NE (FlagEQ) yes no) -> (First nil no yes)
-(NE (FlagLT) yes no) -> (First nil yes no)
-(NE (FlagGT) yes no) -> (First nil yes no)
-
-(LT (FlagEQ) yes no) -> (First nil no yes)
-(LT (FlagLT) yes no) -> (First nil yes no)
-(LT (FlagGT) yes no) -> (First nil no yes)
-
-(LE (FlagEQ) yes no) -> (First nil yes no)
-(LE (FlagLT) yes no) -> (First nil yes no)
-(LE (FlagGT) yes no) -> (First nil no yes)
-
-(GT (FlagEQ) yes no) -> (First nil no yes)
-(GT (FlagLT) yes no) -> (First nil no yes)
-(GT (FlagGT) yes no) -> (First nil yes no)
+(BRC {c} (FlagEQ) yes no) && c.(s390x.CCMask) & s390x.Equal != 0 -> (First nil yes no)
+(BRC {c} (FlagLT) yes no) && c.(s390x.CCMask) & s390x.Less != 0 -> (First nil yes no)
+(BRC {c} (FlagGT) yes no) && c.(s390x.CCMask) & s390x.Greater != 0 -> (First nil yes no)
+(BRC {c} (FlagOV) yes no) && c.(s390x.CCMask) & s390x.Unordered != 0 -> (First nil yes no)
-(GE (FlagEQ) yes no) -> (First nil yes no)
-(GE (FlagLT) yes no) -> (First nil no yes)
-(GE (FlagGT) yes no) -> (First nil yes no)
+(BRC {c} (FlagEQ) yes no) && c.(s390x.CCMask) & s390x.Equal == 0 -> (First nil no yes)
+(BRC {c} (FlagLT) yes no) && c.(s390x.CCMask) & s390x.Less == 0 -> (First nil no yes)
+(BRC {c} (FlagGT) yes no) && c.(s390x.CCMask) & s390x.Greater == 0 -> (First nil no yes)
+(BRC {c} (FlagOV) yes no) && c.(s390x.CCMask) & s390x.Unordered == 0 -> (First nil no yes)
// Absorb flag constants into SETxx ops.
-(MOVDEQ _ x (FlagEQ)) -> x
-(MOVDEQ y _ (FlagLT)) -> y
-(MOVDEQ y _ (FlagGT)) -> y
-
-(MOVDNE y _ (FlagEQ)) -> y
-(MOVDNE _ x (FlagLT)) -> x
-(MOVDNE _ x (FlagGT)) -> x
-
-(MOVDLT y _ (FlagEQ)) -> y
-(MOVDLT _ x (FlagLT)) -> x
-(MOVDLT y _ (FlagGT)) -> y
-
-(MOVDLE _ x (FlagEQ)) -> x
-(MOVDLE _ x (FlagLT)) -> x
-(MOVDLE y _ (FlagGT)) -> y
-
-(MOVDGT y _ (FlagEQ)) -> y
-(MOVDGT y _ (FlagLT)) -> y
-(MOVDGT _ x (FlagGT)) -> x
-
-(MOVDGE _ x (FlagEQ)) -> x
-(MOVDGE y _ (FlagLT)) -> y
-(MOVDGE _ x (FlagGT)) -> x
+(LOCGR {c} _ x (FlagEQ)) && c.(s390x.CCMask) & s390x.Equal != 0 -> x
+(LOCGR {c} _ x (FlagLT)) && c.(s390x.CCMask) & s390x.Less != 0 -> x
+(LOCGR {c} _ x (FlagGT)) && c.(s390x.CCMask) & s390x.Greater != 0 -> x
+(LOCGR {c} _ x (FlagOV)) && c.(s390x.CCMask) & s390x.Unordered != 0 -> x
+
+(LOCGR {c} x _ (FlagEQ)) && c.(s390x.CCMask) & s390x.Equal == 0 -> x
+(LOCGR {c} x _ (FlagLT)) && c.(s390x.CCMask) & s390x.Less == 0 -> x
+(LOCGR {c} x _ (FlagGT)) && c.(s390x.CCMask) & s390x.Greater == 0 -> x
+(LOCGR {c} x _ (FlagOV)) && c.(s390x.CCMask) & s390x.Unordered == 0 -> x
// Remove redundant *const ops
(ADDconst [0] x) -> x
package ssa
import "cmd/compile/internal/types"
+import "cmd/internal/obj/s390x"
func rewriteValueS390X(v *Value) bool {
switch v.Op {
return rewriteValueS390X_OpS390XLEDBR_0(v)
case OpS390XLGDR:
return rewriteValueS390X_OpS390XLGDR_0(v)
+ case OpS390XLOCGR:
+ return rewriteValueS390X_OpS390XLOCGR_0(v)
case OpS390XLoweredRound32F:
return rewriteValueS390X_OpS390XLoweredRound32F_0(v)
case OpS390XLoweredRound64F:
case OpS390XMOVBZloadidx:
return rewriteValueS390X_OpS390XMOVBZloadidx_0(v)
case OpS390XMOVBZreg:
- return rewriteValueS390X_OpS390XMOVBZreg_0(v) || rewriteValueS390X_OpS390XMOVBZreg_10(v) || rewriteValueS390X_OpS390XMOVBZreg_20(v)
+ return rewriteValueS390X_OpS390XMOVBZreg_0(v) || rewriteValueS390X_OpS390XMOVBZreg_10(v)
case OpS390XMOVBload:
return rewriteValueS390X_OpS390XMOVBload_0(v)
case OpS390XMOVBloadidx:
return rewriteValueS390X_OpS390XMOVBstoreconst_0(v)
case OpS390XMOVBstoreidx:
return rewriteValueS390X_OpS390XMOVBstoreidx_0(v) || rewriteValueS390X_OpS390XMOVBstoreidx_10(v) || rewriteValueS390X_OpS390XMOVBstoreidx_20(v) || rewriteValueS390X_OpS390XMOVBstoreidx_30(v)
- case OpS390XMOVDEQ:
- return rewriteValueS390X_OpS390XMOVDEQ_0(v)
- case OpS390XMOVDGE:
- return rewriteValueS390X_OpS390XMOVDGE_0(v)
- case OpS390XMOVDGT:
- return rewriteValueS390X_OpS390XMOVDGT_0(v)
- case OpS390XMOVDLE:
- return rewriteValueS390X_OpS390XMOVDLE_0(v)
- case OpS390XMOVDLT:
- return rewriteValueS390X_OpS390XMOVDLT_0(v)
- case OpS390XMOVDNE:
- return rewriteValueS390X_OpS390XMOVDNE_0(v)
case OpS390XMOVDaddridx:
return rewriteValueS390X_OpS390XMOVDaddridx_0(v)
case OpS390XMOVDload:
b := v.Block
typ := &b.Func.Config.Types
// match: (Eq16 x y)
- // result: (MOVDEQ (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVHreg x) (MOVHreg y)))
+ // result: (LOCGR {s390x.Equal} (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVHreg x) (MOVHreg y)))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDEQ)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Equal
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Eq32 x y)
- // result: (MOVDEQ (MOVDconst [0]) (MOVDconst [1]) (CMPW x y))
+ // result: (LOCGR {s390x.Equal} (MOVDconst [0]) (MOVDconst [1]) (CMPW x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDEQ)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Equal
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Eq32F x y)
- // result: (MOVDEQ (MOVDconst [0]) (MOVDconst [1]) (FCMPS x y))
+ // result: (LOCGR {s390x.Equal} (MOVDconst [0]) (MOVDconst [1]) (FCMPS x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDEQ)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Equal
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Eq64 x y)
- // result: (MOVDEQ (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
+ // result: (LOCGR {s390x.Equal} (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDEQ)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Equal
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Eq64F x y)
- // result: (MOVDEQ (MOVDconst [0]) (MOVDconst [1]) (FCMP x y))
+ // result: (LOCGR {s390x.Equal} (MOVDconst [0]) (MOVDconst [1]) (FCMP x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDEQ)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Equal
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Eq8 x y)
- // result: (MOVDEQ (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVBreg x) (MOVBreg y)))
+ // result: (LOCGR {s390x.Equal} (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVBreg x) (MOVBreg y)))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDEQ)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Equal
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (EqB x y)
- // result: (MOVDEQ (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVBreg x) (MOVBreg y)))
+ // result: (LOCGR {s390x.Equal} (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVBreg x) (MOVBreg y)))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDEQ)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Equal
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (EqPtr x y)
- // result: (MOVDEQ (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
+ // result: (LOCGR {s390x.Equal} (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDEQ)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Equal
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Geq16 x y)
- // result: (MOVDGE (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVHreg x) (MOVHreg y)))
+ // result: (LOCGR {s390x.GreaterOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVHreg x) (MOVHreg y)))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Geq16U x y)
- // result: (MOVDGE (MOVDconst [0]) (MOVDconst [1]) (CMPWU (MOVHZreg x) (MOVHZreg y)))
+ // result: (LOCGR {s390x.GreaterOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPWU (MOVHZreg x) (MOVHZreg y)))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Geq32 x y)
- // result: (MOVDGE (MOVDconst [0]) (MOVDconst [1]) (CMPW x y))
+ // result: (LOCGR {s390x.GreaterOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPW x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Geq32F x y)
- // result: (MOVDGEnoinv (MOVDconst [0]) (MOVDconst [1]) (FCMPS x y))
+ // result: (LOCGR {s390x.GreaterOrEqual} (MOVDconst [0]) (MOVDconst [1]) (FCMPS x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGEnoinv)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Geq32U x y)
- // result: (MOVDGE (MOVDconst [0]) (MOVDconst [1]) (CMPWU x y))
+ // result: (LOCGR {s390x.GreaterOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPWU x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Geq64 x y)
- // result: (MOVDGE (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
+ // result: (LOCGR {s390x.GreaterOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Geq64F x y)
- // result: (MOVDGEnoinv (MOVDconst [0]) (MOVDconst [1]) (FCMP x y))
+ // result: (LOCGR {s390x.GreaterOrEqual} (MOVDconst [0]) (MOVDconst [1]) (FCMP x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGEnoinv)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Geq64U x y)
- // result: (MOVDGE (MOVDconst [0]) (MOVDconst [1]) (CMPU x y))
+ // result: (LOCGR {s390x.GreaterOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPU x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Geq8 x y)
- // result: (MOVDGE (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVBreg x) (MOVBreg y)))
+ // result: (LOCGR {s390x.GreaterOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVBreg x) (MOVBreg y)))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Geq8U x y)
- // result: (MOVDGE (MOVDconst [0]) (MOVDconst [1]) (CMPWU (MOVBZreg x) (MOVBZreg y)))
+ // result: (LOCGR {s390x.GreaterOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPWU (MOVBZreg x) (MOVBZreg y)))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Greater16 x y)
- // result: (MOVDGT (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVHreg x) (MOVHreg y)))
+ // result: (LOCGR {s390x.Greater} (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVHreg x) (MOVHreg y)))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGT)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Greater
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Greater16U x y)
- // result: (MOVDGT (MOVDconst [0]) (MOVDconst [1]) (CMPWU (MOVHZreg x) (MOVHZreg y)))
+ // result: (LOCGR {s390x.Greater} (MOVDconst [0]) (MOVDconst [1]) (CMPWU (MOVHZreg x) (MOVHZreg y)))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGT)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Greater
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Greater32 x y)
- // result: (MOVDGT (MOVDconst [0]) (MOVDconst [1]) (CMPW x y))
+ // result: (LOCGR {s390x.Greater} (MOVDconst [0]) (MOVDconst [1]) (CMPW x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGT)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Greater
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Greater32F x y)
- // result: (MOVDGTnoinv (MOVDconst [0]) (MOVDconst [1]) (FCMPS x y))
+ // result: (LOCGR {s390x.Greater} (MOVDconst [0]) (MOVDconst [1]) (FCMPS x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGTnoinv)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Greater
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Greater32U x y)
- // result: (MOVDGT (MOVDconst [0]) (MOVDconst [1]) (CMPWU x y))
+ // result: (LOCGR {s390x.Greater} (MOVDconst [0]) (MOVDconst [1]) (CMPWU x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGT)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Greater
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Greater64 x y)
- // result: (MOVDGT (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
+ // result: (LOCGR {s390x.Greater} (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGT)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Greater
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Greater64F x y)
- // result: (MOVDGTnoinv (MOVDconst [0]) (MOVDconst [1]) (FCMP x y))
+ // result: (LOCGR {s390x.Greater} (MOVDconst [0]) (MOVDconst [1]) (FCMP x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGTnoinv)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Greater
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Greater64U x y)
- // result: (MOVDGT (MOVDconst [0]) (MOVDconst [1]) (CMPU x y))
+ // result: (LOCGR {s390x.Greater} (MOVDconst [0]) (MOVDconst [1]) (CMPU x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGT)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Greater
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Greater8 x y)
- // result: (MOVDGT (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVBreg x) (MOVBreg y)))
+ // result: (LOCGR {s390x.Greater} (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVBreg x) (MOVBreg y)))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGT)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Greater
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Greater8U x y)
- // result: (MOVDGT (MOVDconst [0]) (MOVDconst [1]) (CMPWU (MOVBZreg x) (MOVBZreg y)))
+ // result: (LOCGR {s390x.Greater} (MOVDconst [0]) (MOVDconst [1]) (CMPWU (MOVBZreg x) (MOVBZreg y)))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGT)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Greater
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (IsInBounds idx len)
- // result: (MOVDLT (MOVDconst [0]) (MOVDconst [1]) (CMPU idx len))
+ // result: (LOCGR {s390x.Less} (MOVDconst [0]) (MOVDconst [1]) (CMPU idx len))
for {
len := v.Args[1]
idx := v.Args[0]
- v.reset(OpS390XMOVDLT)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Less
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (IsNonNil p)
- // result: (MOVDNE (MOVDconst [0]) (MOVDconst [1]) (CMPconst p [0]))
+ // result: (LOCGR {s390x.NotEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPconst p [0]))
for {
p := v.Args[0]
- v.reset(OpS390XMOVDNE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.NotEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (IsSliceInBounds idx len)
- // result: (MOVDLE (MOVDconst [0]) (MOVDconst [1]) (CMPU idx len))
+ // result: (LOCGR {s390x.LessOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPU idx len))
for {
len := v.Args[1]
idx := v.Args[0]
- v.reset(OpS390XMOVDLE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.LessOrEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Leq16 x y)
- // result: (MOVDLE (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVHreg x) (MOVHreg y)))
+ // result: (LOCGR {s390x.LessOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVHreg x) (MOVHreg y)))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDLE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.LessOrEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Leq16U x y)
- // result: (MOVDLE (MOVDconst [0]) (MOVDconst [1]) (CMPWU (MOVHZreg x) (MOVHZreg y)))
+ // result: (LOCGR {s390x.LessOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPWU (MOVHZreg x) (MOVHZreg y)))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDLE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.LessOrEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Leq32 x y)
- // result: (MOVDLE (MOVDconst [0]) (MOVDconst [1]) (CMPW x y))
+ // result: (LOCGR {s390x.LessOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPW x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDLE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.LessOrEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Leq32F x y)
- // result: (MOVDGEnoinv (MOVDconst [0]) (MOVDconst [1]) (FCMPS y x))
+ // result: (LOCGR {s390x.LessOrEqual} (MOVDconst [0]) (MOVDconst [1]) (FCMPS x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGEnoinv)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.LessOrEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
v1.AuxInt = 1
v.AddArg(v1)
v2 := b.NewValue0(v.Pos, OpS390XFCMPS, types.TypeFlags)
- v2.AddArg(y)
v2.AddArg(x)
+ v2.AddArg(y)
v.AddArg(v2)
return true
}
b := v.Block
typ := &b.Func.Config.Types
// match: (Leq32U x y)
- // result: (MOVDLE (MOVDconst [0]) (MOVDconst [1]) (CMPWU x y))
+ // result: (LOCGR {s390x.LessOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPWU x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDLE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.LessOrEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Leq64 x y)
- // result: (MOVDLE (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
+ // result: (LOCGR {s390x.LessOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDLE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.LessOrEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Leq64F x y)
- // result: (MOVDGEnoinv (MOVDconst [0]) (MOVDconst [1]) (FCMP y x))
+ // result: (LOCGR {s390x.LessOrEqual} (MOVDconst [0]) (MOVDconst [1]) (FCMP x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGEnoinv)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.LessOrEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
v1.AuxInt = 1
v.AddArg(v1)
v2 := b.NewValue0(v.Pos, OpS390XFCMP, types.TypeFlags)
- v2.AddArg(y)
v2.AddArg(x)
+ v2.AddArg(y)
v.AddArg(v2)
return true
}
b := v.Block
typ := &b.Func.Config.Types
// match: (Leq64U x y)
- // result: (MOVDLE (MOVDconst [0]) (MOVDconst [1]) (CMPU x y))
+ // result: (LOCGR {s390x.LessOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPU x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDLE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.LessOrEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Leq8 x y)
- // result: (MOVDLE (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVBreg x) (MOVBreg y)))
+ // result: (LOCGR {s390x.LessOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVBreg x) (MOVBreg y)))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDLE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.LessOrEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Leq8U x y)
- // result: (MOVDLE (MOVDconst [0]) (MOVDconst [1]) (CMPWU (MOVBZreg x) (MOVBZreg y)))
+ // result: (LOCGR {s390x.LessOrEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPWU (MOVBZreg x) (MOVBZreg y)))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDLE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.LessOrEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Less16 x y)
- // result: (MOVDLT (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVHreg x) (MOVHreg y)))
+ // result: (LOCGR {s390x.Less} (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVHreg x) (MOVHreg y)))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDLT)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Less
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Less16U x y)
- // result: (MOVDLT (MOVDconst [0]) (MOVDconst [1]) (CMPWU (MOVHZreg x) (MOVHZreg y)))
+ // result: (LOCGR {s390x.Less} (MOVDconst [0]) (MOVDconst [1]) (CMPWU (MOVHZreg x) (MOVHZreg y)))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDLT)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Less
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Less32 x y)
- // result: (MOVDLT (MOVDconst [0]) (MOVDconst [1]) (CMPW x y))
+ // result: (LOCGR {s390x.Less} (MOVDconst [0]) (MOVDconst [1]) (CMPW x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDLT)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Less
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Less32F x y)
- // result: (MOVDGTnoinv (MOVDconst [0]) (MOVDconst [1]) (FCMPS y x))
+ // result: (LOCGR {s390x.Less} (MOVDconst [0]) (MOVDconst [1]) (FCMPS x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGTnoinv)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Less
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
v1.AuxInt = 1
v.AddArg(v1)
v2 := b.NewValue0(v.Pos, OpS390XFCMPS, types.TypeFlags)
- v2.AddArg(y)
v2.AddArg(x)
+ v2.AddArg(y)
v.AddArg(v2)
return true
}
b := v.Block
typ := &b.Func.Config.Types
// match: (Less32U x y)
- // result: (MOVDLT (MOVDconst [0]) (MOVDconst [1]) (CMPWU x y))
+ // result: (LOCGR {s390x.Less} (MOVDconst [0]) (MOVDconst [1]) (CMPWU x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDLT)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Less
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Less64 x y)
- // result: (MOVDLT (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
+ // result: (LOCGR {s390x.Less} (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDLT)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Less
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Less64F x y)
- // result: (MOVDGTnoinv (MOVDconst [0]) (MOVDconst [1]) (FCMP y x))
+ // result: (LOCGR {s390x.Less} (MOVDconst [0]) (MOVDconst [1]) (FCMP x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGTnoinv)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Less
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
v1.AuxInt = 1
v.AddArg(v1)
v2 := b.NewValue0(v.Pos, OpS390XFCMP, types.TypeFlags)
- v2.AddArg(y)
v2.AddArg(x)
+ v2.AddArg(y)
v.AddArg(v2)
return true
}
b := v.Block
typ := &b.Func.Config.Types
// match: (Less64U x y)
- // result: (MOVDLT (MOVDconst [0]) (MOVDconst [1]) (CMPU x y))
+ // result: (LOCGR {s390x.Less} (MOVDconst [0]) (MOVDconst [1]) (CMPU x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDLT)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Less
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Less8 x y)
- // result: (MOVDLT (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVBreg x) (MOVBreg y)))
+ // result: (LOCGR {s390x.Less} (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVBreg x) (MOVBreg y)))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDLT)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Less
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Less8U x y)
- // result: (MOVDLT (MOVDconst [0]) (MOVDconst [1]) (CMPWU (MOVBZreg x) (MOVBZreg y)))
+ // result: (LOCGR {s390x.Less} (MOVDconst [0]) (MOVDconst [1]) (CMPWU (MOVBZreg x) (MOVBZreg y)))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDLT)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.Less
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
return true
}
// match: (Lsh16x16 <t> x y)
- // result: (MOVDGE <t> (SLW <t> x y) (MOVDconst [0]) (CMPWUconst (MOVHZreg y) [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SLW <t> x y) (MOVDconst [0]) (CMPWUconst (MOVHZreg y) [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSLW, t)
v0.AddArg(x)
v0.AddArg(y)
return true
}
// match: (Lsh16x32 <t> x y)
- // result: (MOVDGE <t> (SLW <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SLW <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSLW, t)
v0.AddArg(x)
v0.AddArg(y)
return true
}
// match: (Lsh16x64 <t> x y)
- // result: (MOVDGE <t> (SLW <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SLW <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSLW, t)
v0.AddArg(x)
v0.AddArg(y)
return true
}
// match: (Lsh16x8 <t> x y)
- // result: (MOVDGE <t> (SLW <t> x y) (MOVDconst [0]) (CMPWUconst (MOVBZreg y) [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SLW <t> x y) (MOVDconst [0]) (CMPWUconst (MOVBZreg y) [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSLW, t)
v0.AddArg(x)
v0.AddArg(y)
return true
}
// match: (Lsh32x16 <t> x y)
- // result: (MOVDGE <t> (SLW <t> x y) (MOVDconst [0]) (CMPWUconst (MOVHZreg y) [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SLW <t> x y) (MOVDconst [0]) (CMPWUconst (MOVHZreg y) [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSLW, t)
v0.AddArg(x)
v0.AddArg(y)
return true
}
// match: (Lsh32x32 <t> x y)
- // result: (MOVDGE <t> (SLW <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SLW <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSLW, t)
v0.AddArg(x)
v0.AddArg(y)
return true
}
// match: (Lsh32x64 <t> x y)
- // result: (MOVDGE <t> (SLW <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SLW <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSLW, t)
v0.AddArg(x)
v0.AddArg(y)
return true
}
// match: (Lsh32x8 <t> x y)
- // result: (MOVDGE <t> (SLW <t> x y) (MOVDconst [0]) (CMPWUconst (MOVBZreg y) [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SLW <t> x y) (MOVDconst [0]) (CMPWUconst (MOVBZreg y) [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSLW, t)
v0.AddArg(x)
v0.AddArg(y)
return true
}
// match: (Lsh64x16 <t> x y)
- // result: (MOVDGE <t> (SLD <t> x y) (MOVDconst [0]) (CMPWUconst (MOVHZreg y) [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SLD <t> x y) (MOVDconst [0]) (CMPWUconst (MOVHZreg y) [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSLD, t)
v0.AddArg(x)
v0.AddArg(y)
return true
}
// match: (Lsh64x32 <t> x y)
- // result: (MOVDGE <t> (SLD <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SLD <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSLD, t)
v0.AddArg(x)
v0.AddArg(y)
return true
}
// match: (Lsh64x64 <t> x y)
- // result: (MOVDGE <t> (SLD <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SLD <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSLD, t)
v0.AddArg(x)
v0.AddArg(y)
return true
}
// match: (Lsh64x8 <t> x y)
- // result: (MOVDGE <t> (SLD <t> x y) (MOVDconst [0]) (CMPWUconst (MOVBZreg y) [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SLD <t> x y) (MOVDconst [0]) (CMPWUconst (MOVBZreg y) [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSLD, t)
v0.AddArg(x)
v0.AddArg(y)
return true
}
// match: (Lsh8x16 <t> x y)
- // result: (MOVDGE <t> (SLW <t> x y) (MOVDconst [0]) (CMPWUconst (MOVHZreg y) [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SLW <t> x y) (MOVDconst [0]) (CMPWUconst (MOVHZreg y) [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSLW, t)
v0.AddArg(x)
v0.AddArg(y)
return true
}
// match: (Lsh8x32 <t> x y)
- // result: (MOVDGE <t> (SLW <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SLW <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSLW, t)
v0.AddArg(x)
v0.AddArg(y)
return true
}
// match: (Lsh8x64 <t> x y)
- // result: (MOVDGE <t> (SLW <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SLW <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSLW, t)
v0.AddArg(x)
v0.AddArg(y)
return true
}
// match: (Lsh8x8 <t> x y)
- // result: (MOVDGE <t> (SLW <t> x y) (MOVDconst [0]) (CMPWUconst (MOVBZreg y) [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SLW <t> x y) (MOVDconst [0]) (CMPWUconst (MOVBZreg y) [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSLW, t)
v0.AddArg(x)
v0.AddArg(y)
b := v.Block
typ := &b.Func.Config.Types
// match: (Neq16 x y)
- // result: (MOVDNE (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVHreg x) (MOVHreg y)))
+ // result: (LOCGR {s390x.NotEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVHreg x) (MOVHreg y)))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDNE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.NotEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Neq32 x y)
- // result: (MOVDNE (MOVDconst [0]) (MOVDconst [1]) (CMPW x y))
+ // result: (LOCGR {s390x.NotEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPW x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDNE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.NotEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Neq32F x y)
- // result: (MOVDNE (MOVDconst [0]) (MOVDconst [1]) (FCMPS x y))
+ // result: (LOCGR {s390x.NotEqual} (MOVDconst [0]) (MOVDconst [1]) (FCMPS x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDNE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.NotEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Neq64 x y)
- // result: (MOVDNE (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
+ // result: (LOCGR {s390x.NotEqual} (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDNE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.NotEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Neq64F x y)
- // result: (MOVDNE (MOVDconst [0]) (MOVDconst [1]) (FCMP x y))
+ // result: (LOCGR {s390x.NotEqual} (MOVDconst [0]) (MOVDconst [1]) (FCMP x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDNE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.NotEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (Neq8 x y)
- // result: (MOVDNE (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVBreg x) (MOVBreg y)))
+ // result: (LOCGR {s390x.NotEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVBreg x) (MOVBreg y)))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDNE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.NotEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (NeqB x y)
- // result: (MOVDNE (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVBreg x) (MOVBreg y)))
+ // result: (LOCGR {s390x.NotEqual} (MOVDconst [0]) (MOVDconst [1]) (CMPW (MOVBreg x) (MOVBreg y)))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDNE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.NotEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
b := v.Block
typ := &b.Func.Config.Types
// match: (NeqPtr x y)
- // result: (MOVDNE (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
+ // result: (LOCGR {s390x.NotEqual} (MOVDconst [0]) (MOVDconst [1]) (CMP x y))
for {
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDNE)
+ v.reset(OpS390XLOCGR)
+ v.Aux = s390x.NotEqual
v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64)
v0.AuxInt = 0
v.AddArg(v0)
return true
}
// match: (Rsh16Ux16 <t> x y)
- // result: (MOVDGE <t> (SRW <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPWUconst (MOVHZreg y) [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SRW <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPWUconst (MOVHZreg y) [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSRW, t)
v1 := b.NewValue0(v.Pos, OpS390XMOVHZreg, typ.UInt64)
v1.AddArg(x)
return true
}
// match: (Rsh16Ux32 <t> x y)
- // result: (MOVDGE <t> (SRW <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPWUconst y [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SRW <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPWUconst y [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSRW, t)
v1 := b.NewValue0(v.Pos, OpS390XMOVHZreg, typ.UInt64)
v1.AddArg(x)
return true
}
// match: (Rsh16Ux64 <t> x y)
- // result: (MOVDGE <t> (SRW <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPUconst y [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SRW <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPUconst y [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSRW, t)
v1 := b.NewValue0(v.Pos, OpS390XMOVHZreg, typ.UInt64)
v1.AddArg(x)
return true
}
// match: (Rsh16Ux8 <t> x y)
- // result: (MOVDGE <t> (SRW <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPWUconst (MOVBZreg y) [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SRW <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPWUconst (MOVBZreg y) [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSRW, t)
v1 := b.NewValue0(v.Pos, OpS390XMOVHZreg, typ.UInt64)
v1.AddArg(x)
return true
}
// match: (Rsh16x16 x y)
- // result: (SRAW (MOVHreg x) (MOVDGE <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst (MOVHZreg y) [64])))
+ // result: (SRAW (MOVHreg x) (LOCGR {s390x.GreaterOrEqual} <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst (MOVHZreg y) [64])))
for {
y := v.Args[1]
x := v.Args[0]
v0 := b.NewValue0(v.Pos, OpS390XMOVHreg, typ.Int64)
v0.AddArg(x)
v.AddArg(v0)
- v1 := b.NewValue0(v.Pos, OpS390XMOVDGE, y.Type)
+ v1 := b.NewValue0(v.Pos, OpS390XLOCGR, y.Type)
+ v1.Aux = s390x.GreaterOrEqual
v1.AddArg(y)
v2 := b.NewValue0(v.Pos, OpS390XMOVDconst, y.Type)
v2.AuxInt = 63
return true
}
// match: (Rsh16x32 x y)
- // result: (SRAW (MOVHreg x) (MOVDGE <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst y [64])))
+ // result: (SRAW (MOVHreg x) (LOCGR {s390x.GreaterOrEqual} <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst y [64])))
for {
y := v.Args[1]
x := v.Args[0]
v0 := b.NewValue0(v.Pos, OpS390XMOVHreg, typ.Int64)
v0.AddArg(x)
v.AddArg(v0)
- v1 := b.NewValue0(v.Pos, OpS390XMOVDGE, y.Type)
+ v1 := b.NewValue0(v.Pos, OpS390XLOCGR, y.Type)
+ v1.Aux = s390x.GreaterOrEqual
v1.AddArg(y)
v2 := b.NewValue0(v.Pos, OpS390XMOVDconst, y.Type)
v2.AuxInt = 63
return true
}
// match: (Rsh16x64 x y)
- // result: (SRAW (MOVHreg x) (MOVDGE <y.Type> y (MOVDconst <y.Type> [63]) (CMPUconst y [64])))
+ // result: (SRAW (MOVHreg x) (LOCGR {s390x.GreaterOrEqual} <y.Type> y (MOVDconst <y.Type> [63]) (CMPUconst y [64])))
for {
y := v.Args[1]
x := v.Args[0]
v0 := b.NewValue0(v.Pos, OpS390XMOVHreg, typ.Int64)
v0.AddArg(x)
v.AddArg(v0)
- v1 := b.NewValue0(v.Pos, OpS390XMOVDGE, y.Type)
+ v1 := b.NewValue0(v.Pos, OpS390XLOCGR, y.Type)
+ v1.Aux = s390x.GreaterOrEqual
v1.AddArg(y)
v2 := b.NewValue0(v.Pos, OpS390XMOVDconst, y.Type)
v2.AuxInt = 63
return true
}
// match: (Rsh16x8 x y)
- // result: (SRAW (MOVHreg x) (MOVDGE <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst (MOVBZreg y) [64])))
+ // result: (SRAW (MOVHreg x) (LOCGR {s390x.GreaterOrEqual} <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst (MOVBZreg y) [64])))
for {
y := v.Args[1]
x := v.Args[0]
v0 := b.NewValue0(v.Pos, OpS390XMOVHreg, typ.Int64)
v0.AddArg(x)
v.AddArg(v0)
- v1 := b.NewValue0(v.Pos, OpS390XMOVDGE, y.Type)
+ v1 := b.NewValue0(v.Pos, OpS390XLOCGR, y.Type)
+ v1.Aux = s390x.GreaterOrEqual
v1.AddArg(y)
v2 := b.NewValue0(v.Pos, OpS390XMOVDconst, y.Type)
v2.AuxInt = 63
return true
}
// match: (Rsh32Ux16 <t> x y)
- // result: (MOVDGE <t> (SRW <t> x y) (MOVDconst [0]) (CMPWUconst (MOVHZreg y) [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SRW <t> x y) (MOVDconst [0]) (CMPWUconst (MOVHZreg y) [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSRW, t)
v0.AddArg(x)
v0.AddArg(y)
return true
}
// match: (Rsh32Ux32 <t> x y)
- // result: (MOVDGE <t> (SRW <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SRW <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSRW, t)
v0.AddArg(x)
v0.AddArg(y)
return true
}
// match: (Rsh32Ux64 <t> x y)
- // result: (MOVDGE <t> (SRW <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SRW <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSRW, t)
v0.AddArg(x)
v0.AddArg(y)
return true
}
// match: (Rsh32Ux8 <t> x y)
- // result: (MOVDGE <t> (SRW <t> x y) (MOVDconst [0]) (CMPWUconst (MOVBZreg y) [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SRW <t> x y) (MOVDconst [0]) (CMPWUconst (MOVBZreg y) [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSRW, t)
v0.AddArg(x)
v0.AddArg(y)
return true
}
// match: (Rsh32x16 x y)
- // result: (SRAW x (MOVDGE <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst (MOVHZreg y) [64])))
+ // result: (SRAW x (LOCGR {s390x.GreaterOrEqual} <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst (MOVHZreg y) [64])))
for {
y := v.Args[1]
x := v.Args[0]
v.reset(OpS390XSRAW)
v.AddArg(x)
- v0 := b.NewValue0(v.Pos, OpS390XMOVDGE, y.Type)
+ v0 := b.NewValue0(v.Pos, OpS390XLOCGR, y.Type)
+ v0.Aux = s390x.GreaterOrEqual
v0.AddArg(y)
v1 := b.NewValue0(v.Pos, OpS390XMOVDconst, y.Type)
v1.AuxInt = 63
return true
}
// match: (Rsh32x32 x y)
- // result: (SRAW x (MOVDGE <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst y [64])))
+ // result: (SRAW x (LOCGR {s390x.GreaterOrEqual} <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst y [64])))
for {
y := v.Args[1]
x := v.Args[0]
v.reset(OpS390XSRAW)
v.AddArg(x)
- v0 := b.NewValue0(v.Pos, OpS390XMOVDGE, y.Type)
+ v0 := b.NewValue0(v.Pos, OpS390XLOCGR, y.Type)
+ v0.Aux = s390x.GreaterOrEqual
v0.AddArg(y)
v1 := b.NewValue0(v.Pos, OpS390XMOVDconst, y.Type)
v1.AuxInt = 63
return true
}
// match: (Rsh32x64 x y)
- // result: (SRAW x (MOVDGE <y.Type> y (MOVDconst <y.Type> [63]) (CMPUconst y [64])))
+ // result: (SRAW x (LOCGR {s390x.GreaterOrEqual} <y.Type> y (MOVDconst <y.Type> [63]) (CMPUconst y [64])))
for {
y := v.Args[1]
x := v.Args[0]
v.reset(OpS390XSRAW)
v.AddArg(x)
- v0 := b.NewValue0(v.Pos, OpS390XMOVDGE, y.Type)
+ v0 := b.NewValue0(v.Pos, OpS390XLOCGR, y.Type)
+ v0.Aux = s390x.GreaterOrEqual
v0.AddArg(y)
v1 := b.NewValue0(v.Pos, OpS390XMOVDconst, y.Type)
v1.AuxInt = 63
return true
}
// match: (Rsh32x8 x y)
- // result: (SRAW x (MOVDGE <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst (MOVBZreg y) [64])))
+ // result: (SRAW x (LOCGR {s390x.GreaterOrEqual} <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst (MOVBZreg y) [64])))
for {
y := v.Args[1]
x := v.Args[0]
v.reset(OpS390XSRAW)
v.AddArg(x)
- v0 := b.NewValue0(v.Pos, OpS390XMOVDGE, y.Type)
+ v0 := b.NewValue0(v.Pos, OpS390XLOCGR, y.Type)
+ v0.Aux = s390x.GreaterOrEqual
v0.AddArg(y)
v1 := b.NewValue0(v.Pos, OpS390XMOVDconst, y.Type)
v1.AuxInt = 63
return true
}
// match: (Rsh64Ux16 <t> x y)
- // result: (MOVDGE <t> (SRD <t> x y) (MOVDconst [0]) (CMPWUconst (MOVHZreg y) [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SRD <t> x y) (MOVDconst [0]) (CMPWUconst (MOVHZreg y) [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSRD, t)
v0.AddArg(x)
v0.AddArg(y)
return true
}
// match: (Rsh64Ux32 <t> x y)
- // result: (MOVDGE <t> (SRD <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SRD <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSRD, t)
v0.AddArg(x)
v0.AddArg(y)
return true
}
// match: (Rsh64Ux64 <t> x y)
- // result: (MOVDGE <t> (SRD <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SRD <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSRD, t)
v0.AddArg(x)
v0.AddArg(y)
return true
}
// match: (Rsh64Ux8 <t> x y)
- // result: (MOVDGE <t> (SRD <t> x y) (MOVDconst [0]) (CMPWUconst (MOVBZreg y) [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SRD <t> x y) (MOVDconst [0]) (CMPWUconst (MOVBZreg y) [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSRD, t)
v0.AddArg(x)
v0.AddArg(y)
return true
}
// match: (Rsh64x16 x y)
- // result: (SRAD x (MOVDGE <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst (MOVHZreg y) [64])))
+ // result: (SRAD x (LOCGR {s390x.GreaterOrEqual} <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst (MOVHZreg y) [64])))
for {
y := v.Args[1]
x := v.Args[0]
v.reset(OpS390XSRAD)
v.AddArg(x)
- v0 := b.NewValue0(v.Pos, OpS390XMOVDGE, y.Type)
+ v0 := b.NewValue0(v.Pos, OpS390XLOCGR, y.Type)
+ v0.Aux = s390x.GreaterOrEqual
v0.AddArg(y)
v1 := b.NewValue0(v.Pos, OpS390XMOVDconst, y.Type)
v1.AuxInt = 63
return true
}
// match: (Rsh64x32 x y)
- // result: (SRAD x (MOVDGE <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst y [64])))
+ // result: (SRAD x (LOCGR {s390x.GreaterOrEqual} <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst y [64])))
for {
y := v.Args[1]
x := v.Args[0]
v.reset(OpS390XSRAD)
v.AddArg(x)
- v0 := b.NewValue0(v.Pos, OpS390XMOVDGE, y.Type)
+ v0 := b.NewValue0(v.Pos, OpS390XLOCGR, y.Type)
+ v0.Aux = s390x.GreaterOrEqual
v0.AddArg(y)
v1 := b.NewValue0(v.Pos, OpS390XMOVDconst, y.Type)
v1.AuxInt = 63
return true
}
// match: (Rsh64x64 x y)
- // result: (SRAD x (MOVDGE <y.Type> y (MOVDconst <y.Type> [63]) (CMPUconst y [64])))
+ // result: (SRAD x (LOCGR {s390x.GreaterOrEqual} <y.Type> y (MOVDconst <y.Type> [63]) (CMPUconst y [64])))
for {
y := v.Args[1]
x := v.Args[0]
v.reset(OpS390XSRAD)
v.AddArg(x)
- v0 := b.NewValue0(v.Pos, OpS390XMOVDGE, y.Type)
+ v0 := b.NewValue0(v.Pos, OpS390XLOCGR, y.Type)
+ v0.Aux = s390x.GreaterOrEqual
v0.AddArg(y)
v1 := b.NewValue0(v.Pos, OpS390XMOVDconst, y.Type)
v1.AuxInt = 63
return true
}
// match: (Rsh64x8 x y)
- // result: (SRAD x (MOVDGE <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst (MOVBZreg y) [64])))
+ // result: (SRAD x (LOCGR {s390x.GreaterOrEqual} <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst (MOVBZreg y) [64])))
for {
y := v.Args[1]
x := v.Args[0]
v.reset(OpS390XSRAD)
v.AddArg(x)
- v0 := b.NewValue0(v.Pos, OpS390XMOVDGE, y.Type)
+ v0 := b.NewValue0(v.Pos, OpS390XLOCGR, y.Type)
+ v0.Aux = s390x.GreaterOrEqual
v0.AddArg(y)
v1 := b.NewValue0(v.Pos, OpS390XMOVDconst, y.Type)
v1.AuxInt = 63
return true
}
// match: (Rsh8Ux16 <t> x y)
- // result: (MOVDGE <t> (SRW <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPWUconst (MOVHZreg y) [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SRW <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPWUconst (MOVHZreg y) [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSRW, t)
v1 := b.NewValue0(v.Pos, OpS390XMOVBZreg, typ.UInt64)
v1.AddArg(x)
return true
}
// match: (Rsh8Ux32 <t> x y)
- // result: (MOVDGE <t> (SRW <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPWUconst y [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SRW <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPWUconst y [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSRW, t)
v1 := b.NewValue0(v.Pos, OpS390XMOVBZreg, typ.UInt64)
v1.AddArg(x)
return true
}
// match: (Rsh8Ux64 <t> x y)
- // result: (MOVDGE <t> (SRW <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPUconst y [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SRW <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPUconst y [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSRW, t)
v1 := b.NewValue0(v.Pos, OpS390XMOVBZreg, typ.UInt64)
v1.AddArg(x)
return true
}
// match: (Rsh8Ux8 <t> x y)
- // result: (MOVDGE <t> (SRW <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPWUconst (MOVBZreg y) [64]))
+ // result: (LOCGR {s390x.GreaterOrEqual} <t> (SRW <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPWUconst (MOVBZreg y) [64]))
for {
t := v.Type
y := v.Args[1]
x := v.Args[0]
- v.reset(OpS390XMOVDGE)
+ v.reset(OpS390XLOCGR)
v.Type = t
+ v.Aux = s390x.GreaterOrEqual
v0 := b.NewValue0(v.Pos, OpS390XSRW, t)
v1 := b.NewValue0(v.Pos, OpS390XMOVBZreg, typ.UInt64)
v1.AddArg(x)
return true
}
// match: (Rsh8x16 x y)
- // result: (SRAW (MOVBreg x) (MOVDGE <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst (MOVHZreg y) [64])))
+ // result: (SRAW (MOVBreg x) (LOCGR {s390x.GreaterOrEqual} <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst (MOVHZreg y) [64])))
for {
y := v.Args[1]
x := v.Args[0]
v0 := b.NewValue0(v.Pos, OpS390XMOVBreg, typ.Int64)
v0.AddArg(x)
v.AddArg(v0)
- v1 := b.NewValue0(v.Pos, OpS390XMOVDGE, y.Type)
+ v1 := b.NewValue0(v.Pos, OpS390XLOCGR, y.Type)
+ v1.Aux = s390x.GreaterOrEqual
v1.AddArg(y)
v2 := b.NewValue0(v.Pos, OpS390XMOVDconst, y.Type)
v2.AuxInt = 63
return true
}
// match: (Rsh8x32 x y)
- // result: (SRAW (MOVBreg x) (MOVDGE <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst y [64])))
+ // result: (SRAW (MOVBreg x) (LOCGR {s390x.GreaterOrEqual} <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst y [64])))
for {
y := v.Args[1]
x := v.Args[0]
v0 := b.NewValue0(v.Pos, OpS390XMOVBreg, typ.Int64)
v0.AddArg(x)
v.AddArg(v0)
- v1 := b.NewValue0(v.Pos, OpS390XMOVDGE, y.Type)
+ v1 := b.NewValue0(v.Pos, OpS390XLOCGR, y.Type)
+ v1.Aux = s390x.GreaterOrEqual
v1.AddArg(y)
v2 := b.NewValue0(v.Pos, OpS390XMOVDconst, y.Type)
v2.AuxInt = 63
return true
}
// match: (Rsh8x64 x y)
- // result: (SRAW (MOVBreg x) (MOVDGE <y.Type> y (MOVDconst <y.Type> [63]) (CMPUconst y [64])))
+ // result: (SRAW (MOVBreg x) (LOCGR {s390x.GreaterOrEqual} <y.Type> y (MOVDconst <y.Type> [63]) (CMPUconst y [64])))
for {
y := v.Args[1]
x := v.Args[0]
v0 := b.NewValue0(v.Pos, OpS390XMOVBreg, typ.Int64)
v0.AddArg(x)
v.AddArg(v0)
- v1 := b.NewValue0(v.Pos, OpS390XMOVDGE, y.Type)
+ v1 := b.NewValue0(v.Pos, OpS390XLOCGR, y.Type)
+ v1.Aux = s390x.GreaterOrEqual
v1.AddArg(y)
v2 := b.NewValue0(v.Pos, OpS390XMOVDconst, y.Type)
v2.AuxInt = 63
return true
}
// match: (Rsh8x8 x y)
- // result: (SRAW (MOVBreg x) (MOVDGE <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst (MOVBZreg y) [64])))
+ // result: (SRAW (MOVBreg x) (LOCGR {s390x.GreaterOrEqual} <y.Type> y (MOVDconst <y.Type> [63]) (CMPWUconst (MOVBZreg y) [64])))
for {
y := v.Args[1]
x := v.Args[0]
v0 := b.NewValue0(v.Pos, OpS390XMOVBreg, typ.Int64)
v0.AddArg(x)
v.AddArg(v0)
- v1 := b.NewValue0(v.Pos, OpS390XMOVDGE, y.Type)
+ v1 := b.NewValue0(v.Pos, OpS390XLOCGR, y.Type)
+ v1.Aux = s390x.GreaterOrEqual
v1.AddArg(y)
v2 := b.NewValue0(v.Pos, OpS390XMOVDconst, y.Type)
v2.AuxInt = 63
}
return false
}
+func rewriteValueS390X_OpS390XLOCGR_0(v *Value) bool {
+ // match: (LOCGR {c} x y (InvertFlags cmp))
+ // result: (LOCGR {c.(s390x.CCMask).ReverseComparison()} x y cmp)
+ for {
+ c := v.Aux
+ _ = v.Args[2]
+ x := v.Args[0]
+ y := v.Args[1]
+ v_2 := v.Args[2]
+ if v_2.Op != OpS390XInvertFlags {
+ break
+ }
+ cmp := v_2.Args[0]
+ v.reset(OpS390XLOCGR)
+ v.Aux = c.(s390x.CCMask).ReverseComparison()
+ v.AddArg(x)
+ v.AddArg(y)
+ v.AddArg(cmp)
+ return true
+ }
+ // match: (LOCGR {c} _ x (FlagEQ))
+ // cond: c.(s390x.CCMask) & s390x.Equal != 0
+ // result: x
+ for {
+ c := v.Aux
+ _ = v.Args[2]
+ x := v.Args[1]
+ v_2 := v.Args[2]
+ if v_2.Op != OpS390XFlagEQ || !(c.(s390x.CCMask)&s390x.Equal != 0) {
+ break
+ }
+ v.reset(OpCopy)
+ v.Type = x.Type
+ v.AddArg(x)
+ return true
+ }
+ // match: (LOCGR {c} _ x (FlagLT))
+ // cond: c.(s390x.CCMask) & s390x.Less != 0
+ // result: x
+ for {
+ c := v.Aux
+ _ = v.Args[2]
+ x := v.Args[1]
+ v_2 := v.Args[2]
+ if v_2.Op != OpS390XFlagLT || !(c.(s390x.CCMask)&s390x.Less != 0) {
+ break
+ }
+ v.reset(OpCopy)
+ v.Type = x.Type
+ v.AddArg(x)
+ return true
+ }
+ // match: (LOCGR {c} _ x (FlagGT))
+ // cond: c.(s390x.CCMask) & s390x.Greater != 0
+ // result: x
+ for {
+ c := v.Aux
+ _ = v.Args[2]
+ x := v.Args[1]
+ v_2 := v.Args[2]
+ if v_2.Op != OpS390XFlagGT || !(c.(s390x.CCMask)&s390x.Greater != 0) {
+ break
+ }
+ v.reset(OpCopy)
+ v.Type = x.Type
+ v.AddArg(x)
+ return true
+ }
+ // match: (LOCGR {c} _ x (FlagOV))
+ // cond: c.(s390x.CCMask) & s390x.Unordered != 0
+ // result: x
+ for {
+ c := v.Aux
+ _ = v.Args[2]
+ x := v.Args[1]
+ v_2 := v.Args[2]
+ if v_2.Op != OpS390XFlagOV || !(c.(s390x.CCMask)&s390x.Unordered != 0) {
+ break
+ }
+ v.reset(OpCopy)
+ v.Type = x.Type
+ v.AddArg(x)
+ return true
+ }
+ // match: (LOCGR {c} x _ (FlagEQ))
+ // cond: c.(s390x.CCMask) & s390x.Equal == 0
+ // result: x
+ for {
+ c := v.Aux
+ _ = v.Args[2]
+ x := v.Args[0]
+ v_2 := v.Args[2]
+ if v_2.Op != OpS390XFlagEQ || !(c.(s390x.CCMask)&s390x.Equal == 0) {
+ break
+ }
+ v.reset(OpCopy)
+ v.Type = x.Type
+ v.AddArg(x)
+ return true
+ }
+ // match: (LOCGR {c} x _ (FlagLT))
+ // cond: c.(s390x.CCMask) & s390x.Less == 0
+ // result: x
+ for {
+ c := v.Aux
+ _ = v.Args[2]
+ x := v.Args[0]
+ v_2 := v.Args[2]
+ if v_2.Op != OpS390XFlagLT || !(c.(s390x.CCMask)&s390x.Less == 0) {
+ break
+ }
+ v.reset(OpCopy)
+ v.Type = x.Type
+ v.AddArg(x)
+ return true
+ }
+ // match: (LOCGR {c} x _ (FlagGT))
+ // cond: c.(s390x.CCMask) & s390x.Greater == 0
+ // result: x
+ for {
+ c := v.Aux
+ _ = v.Args[2]
+ x := v.Args[0]
+ v_2 := v.Args[2]
+ if v_2.Op != OpS390XFlagGT || !(c.(s390x.CCMask)&s390x.Greater == 0) {
+ break
+ }
+ v.reset(OpCopy)
+ v.Type = x.Type
+ v.AddArg(x)
+ return true
+ }
+ // match: (LOCGR {c} x _ (FlagOV))
+ // cond: c.(s390x.CCMask) & s390x.Unordered == 0
+ // result: x
+ for {
+ c := v.Aux
+ _ = v.Args[2]
+ x := v.Args[0]
+ v_2 := v.Args[2]
+ if v_2.Op != OpS390XFlagOV || !(c.(s390x.CCMask)&s390x.Unordered == 0) {
+ break
+ }
+ v.reset(OpCopy)
+ v.Type = x.Type
+ v.AddArg(x)
+ return true
+ }
+ return false
+}
func rewriteValueS390X_OpS390XLoweredRound32F_0(v *Value) bool {
// match: (LoweredRound32F x:(FMOVSconst))
// result: x
}
func rewriteValueS390X_OpS390XMOVBZreg_10(v *Value) bool {
b := v.Block
+ typ := &b.Func.Config.Types
// match: (MOVBZreg <t> x:(MOVBloadidx [o] {s} p i mem))
// cond: x.Uses == 1 && clobber(x)
// result: @x.Block (MOVBZloadidx <t> [o] {s} p i mem)
v.AuxInt = int64(uint8(c))
return true
}
- // match: (MOVBZreg x:(MOVDLT (MOVDconst [c]) (MOVDconst [d]) _))
- // cond: int64(uint8(c)) == c && int64(uint8(d)) == d && (!x.Type.IsSigned() || x.Type.Size() > 1)
- // result: x
- for {
- x := v.Args[0]
- if x.Op != OpS390XMOVDLT {
- break
- }
- _ = x.Args[2]
- x_0 := x.Args[0]
- if x_0.Op != OpS390XMOVDconst {
- break
- }
- c := x_0.AuxInt
- x_1 := x.Args[1]
- if x_1.Op != OpS390XMOVDconst {
- break
- }
- d := x_1.AuxInt
- if !(int64(uint8(c)) == c && int64(uint8(d)) == d && (!x.Type.IsSigned() || x.Type.Size() > 1)) {
- break
- }
- v.reset(OpCopy)
- v.Type = x.Type
- v.AddArg(x)
- return true
- }
- // match: (MOVBZreg x:(MOVDLE (MOVDconst [c]) (MOVDconst [d]) _))
- // cond: int64(uint8(c)) == c && int64(uint8(d)) == d && (!x.Type.IsSigned() || x.Type.Size() > 1)
- // result: x
- for {
- x := v.Args[0]
- if x.Op != OpS390XMOVDLE {
- break
- }
- _ = x.Args[2]
- x_0 := x.Args[0]
- if x_0.Op != OpS390XMOVDconst {
- break
- }
- c := x_0.AuxInt
- x_1 := x.Args[1]
- if x_1.Op != OpS390XMOVDconst {
- break
- }
- d := x_1.AuxInt
- if !(int64(uint8(c)) == c && int64(uint8(d)) == d && (!x.Type.IsSigned() || x.Type.Size() > 1)) {
- break
- }
- v.reset(OpCopy)
- v.Type = x.Type
- v.AddArg(x)
- return true
- }
- // match: (MOVBZreg x:(MOVDGT (MOVDconst [c]) (MOVDconst [d]) _))
- // cond: int64(uint8(c)) == c && int64(uint8(d)) == d && (!x.Type.IsSigned() || x.Type.Size() > 1)
- // result: x
- for {
- x := v.Args[0]
- if x.Op != OpS390XMOVDGT {
- break
- }
- _ = x.Args[2]
- x_0 := x.Args[0]
- if x_0.Op != OpS390XMOVDconst {
- break
- }
- c := x_0.AuxInt
- x_1 := x.Args[1]
- if x_1.Op != OpS390XMOVDconst {
- break
- }
- d := x_1.AuxInt
- if !(int64(uint8(c)) == c && int64(uint8(d)) == d && (!x.Type.IsSigned() || x.Type.Size() > 1)) {
- break
- }
- v.reset(OpCopy)
- v.Type = x.Type
- v.AddArg(x)
- return true
- }
- // match: (MOVBZreg x:(MOVDGE (MOVDconst [c]) (MOVDconst [d]) _))
- // cond: int64(uint8(c)) == c && int64(uint8(d)) == d && (!x.Type.IsSigned() || x.Type.Size() > 1)
- // result: x
- for {
- x := v.Args[0]
- if x.Op != OpS390XMOVDGE {
- break
- }
- _ = x.Args[2]
- x_0 := x.Args[0]
- if x_0.Op != OpS390XMOVDconst {
- break
- }
- c := x_0.AuxInt
- x_1 := x.Args[1]
- if x_1.Op != OpS390XMOVDconst {
- break
- }
- d := x_1.AuxInt
- if !(int64(uint8(c)) == c && int64(uint8(d)) == d && (!x.Type.IsSigned() || x.Type.Size() > 1)) {
- break
- }
- v.reset(OpCopy)
- v.Type = x.Type
- v.AddArg(x)
- return true
- }
- // match: (MOVBZreg x:(MOVDEQ (MOVDconst [c]) (MOVDconst [d]) _))
- // cond: int64(uint8(c)) == c && int64(uint8(d)) == d && (!x.Type.IsSigned() || x.Type.Size() > 1)
- // result: x
- for {
- x := v.Args[0]
- if x.Op != OpS390XMOVDEQ {
- break
- }
- _ = x.Args[2]
- x_0 := x.Args[0]
- if x_0.Op != OpS390XMOVDconst {
- break
- }
- c := x_0.AuxInt
- x_1 := x.Args[1]
- if x_1.Op != OpS390XMOVDconst {
- break
- }
- d := x_1.AuxInt
- if !(int64(uint8(c)) == c && int64(uint8(d)) == d && (!x.Type.IsSigned() || x.Type.Size() > 1)) {
- break
- }
- v.reset(OpCopy)
- v.Type = x.Type
- v.AddArg(x)
- return true
- }
- // match: (MOVBZreg x:(MOVDNE (MOVDconst [c]) (MOVDconst [d]) _))
- // cond: int64(uint8(c)) == c && int64(uint8(d)) == d && (!x.Type.IsSigned() || x.Type.Size() > 1)
- // result: x
- for {
- x := v.Args[0]
- if x.Op != OpS390XMOVDNE {
- break
- }
- _ = x.Args[2]
- x_0 := x.Args[0]
- if x_0.Op != OpS390XMOVDconst {
- break
- }
- c := x_0.AuxInt
- x_1 := x.Args[1]
- if x_1.Op != OpS390XMOVDconst {
- break
- }
- d := x_1.AuxInt
- if !(int64(uint8(c)) == c && int64(uint8(d)) == d && (!x.Type.IsSigned() || x.Type.Size() > 1)) {
- break
- }
- v.reset(OpCopy)
- v.Type = x.Type
- v.AddArg(x)
- return true
- }
- // match: (MOVBZreg x:(MOVDGTnoinv (MOVDconst [c]) (MOVDconst [d]) _))
- // cond: int64(uint8(c)) == c && int64(uint8(d)) == d && (!x.Type.IsSigned() || x.Type.Size() > 1)
- // result: x
- for {
- x := v.Args[0]
- if x.Op != OpS390XMOVDGTnoinv {
- break
- }
- _ = x.Args[2]
- x_0 := x.Args[0]
- if x_0.Op != OpS390XMOVDconst {
- break
- }
- c := x_0.AuxInt
- x_1 := x.Args[1]
- if x_1.Op != OpS390XMOVDconst {
- break
- }
- d := x_1.AuxInt
- if !(int64(uint8(c)) == c && int64(uint8(d)) == d && (!x.Type.IsSigned() || x.Type.Size() > 1)) {
- break
- }
- v.reset(OpCopy)
- v.Type = x.Type
- v.AddArg(x)
- return true
- }
- return false
-}
-func rewriteValueS390X_OpS390XMOVBZreg_20(v *Value) bool {
- b := v.Block
- typ := &b.Func.Config.Types
- // match: (MOVBZreg x:(MOVDGEnoinv (MOVDconst [c]) (MOVDconst [d]) _))
+ // match: (MOVBZreg x:(LOCGR (MOVDconst [c]) (MOVDconst [d]) _))
// cond: int64(uint8(c)) == c && int64(uint8(d)) == d && (!x.Type.IsSigned() || x.Type.Size() > 1)
// result: x
for {
x := v.Args[0]
- if x.Op != OpS390XMOVDGEnoinv {
+ if x.Op != OpS390XLOCGR {
break
}
_ = x.Args[2]
}
return false
}
-func rewriteValueS390X_OpS390XMOVDEQ_0(v *Value) bool {
- // match: (MOVDEQ x y (InvertFlags cmp))
- // result: (MOVDEQ x y cmp)
- for {
- _ = v.Args[2]
- x := v.Args[0]
- y := v.Args[1]
- v_2 := v.Args[2]
- if v_2.Op != OpS390XInvertFlags {
- break
- }
- cmp := v_2.Args[0]
- v.reset(OpS390XMOVDEQ)
- v.AddArg(x)
- v.AddArg(y)
- v.AddArg(cmp)
- return true
- }
- // match: (MOVDEQ _ x (FlagEQ))
- // result: x
- for {
- _ = v.Args[2]
- x := v.Args[1]
- v_2 := v.Args[2]
- if v_2.Op != OpS390XFlagEQ {
- break
- }
- v.reset(OpCopy)
- v.Type = x.Type
- v.AddArg(x)
- return true
- }
- // match: (MOVDEQ y _ (FlagLT))
- // result: y
- for {
- _ = v.Args[2]
- y := v.Args[0]
- v_2 := v.Args[2]
- if v_2.Op != OpS390XFlagLT {
- break
- }
- v.reset(OpCopy)
- v.Type = y.Type
- v.AddArg(y)
- return true
- }
- // match: (MOVDEQ y _ (FlagGT))
- // result: y
- for {
- _ = v.Args[2]
- y := v.Args[0]
- v_2 := v.Args[2]
- if v_2.Op != OpS390XFlagGT {
- break
- }
- v.reset(OpCopy)
- v.Type = y.Type
- v.AddArg(y)
- return true
- }
- return false
-}
-func rewriteValueS390X_OpS390XMOVDGE_0(v *Value) bool {
- // match: (MOVDGE x y (InvertFlags cmp))
- // result: (MOVDLE x y cmp)
- for {
- _ = v.Args[2]
- x := v.Args[0]
- y := v.Args[1]
- v_2 := v.Args[2]
- if v_2.Op != OpS390XInvertFlags {
- break
- }
- cmp := v_2.Args[0]
- v.reset(OpS390XMOVDLE)
- v.AddArg(x)
- v.AddArg(y)
- v.AddArg(cmp)
- return true
- }
- // match: (MOVDGE _ x (FlagEQ))
- // result: x
- for {
- _ = v.Args[2]
- x := v.Args[1]
- v_2 := v.Args[2]
- if v_2.Op != OpS390XFlagEQ {
- break
- }
- v.reset(OpCopy)
- v.Type = x.Type
- v.AddArg(x)
- return true
- }
- // match: (MOVDGE y _ (FlagLT))
- // result: y
- for {
- _ = v.Args[2]
- y := v.Args[0]
- v_2 := v.Args[2]
- if v_2.Op != OpS390XFlagLT {
- break
- }
- v.reset(OpCopy)
- v.Type = y.Type
- v.AddArg(y)
- return true
- }
- // match: (MOVDGE _ x (FlagGT))
- // result: x
- for {
- _ = v.Args[2]
- x := v.Args[1]
- v_2 := v.Args[2]
- if v_2.Op != OpS390XFlagGT {
- break
- }
- v.reset(OpCopy)
- v.Type = x.Type
- v.AddArg(x)
- return true
- }
- return false
-}
-func rewriteValueS390X_OpS390XMOVDGT_0(v *Value) bool {
- // match: (MOVDGT x y (InvertFlags cmp))
- // result: (MOVDLT x y cmp)
- for {
- _ = v.Args[2]
- x := v.Args[0]
- y := v.Args[1]
- v_2 := v.Args[2]
- if v_2.Op != OpS390XInvertFlags {
- break
- }
- cmp := v_2.Args[0]
- v.reset(OpS390XMOVDLT)
- v.AddArg(x)
- v.AddArg(y)
- v.AddArg(cmp)
- return true
- }
- // match: (MOVDGT y _ (FlagEQ))
- // result: y
- for {
- _ = v.Args[2]
- y := v.Args[0]
- v_2 := v.Args[2]
- if v_2.Op != OpS390XFlagEQ {
- break
- }
- v.reset(OpCopy)
- v.Type = y.Type
- v.AddArg(y)
- return true
- }
- // match: (MOVDGT y _ (FlagLT))
- // result: y
- for {
- _ = v.Args[2]
- y := v.Args[0]
- v_2 := v.Args[2]
- if v_2.Op != OpS390XFlagLT {
- break
- }
- v.reset(OpCopy)
- v.Type = y.Type
- v.AddArg(y)
- return true
- }
- // match: (MOVDGT _ x (FlagGT))
- // result: x
- for {
- _ = v.Args[2]
- x := v.Args[1]
- v_2 := v.Args[2]
- if v_2.Op != OpS390XFlagGT {
- break
- }
- v.reset(OpCopy)
- v.Type = x.Type
- v.AddArg(x)
- return true
- }
- return false
-}
-func rewriteValueS390X_OpS390XMOVDLE_0(v *Value) bool {
- // match: (MOVDLE x y (InvertFlags cmp))
- // result: (MOVDGE x y cmp)
- for {
- _ = v.Args[2]
- x := v.Args[0]
- y := v.Args[1]
- v_2 := v.Args[2]
- if v_2.Op != OpS390XInvertFlags {
- break
- }
- cmp := v_2.Args[0]
- v.reset(OpS390XMOVDGE)
- v.AddArg(x)
- v.AddArg(y)
- v.AddArg(cmp)
- return true
- }
- // match: (MOVDLE _ x (FlagEQ))
- // result: x
- for {
- _ = v.Args[2]
- x := v.Args[1]
- v_2 := v.Args[2]
- if v_2.Op != OpS390XFlagEQ {
- break
- }
- v.reset(OpCopy)
- v.Type = x.Type
- v.AddArg(x)
- return true
- }
- // match: (MOVDLE _ x (FlagLT))
- // result: x
- for {
- _ = v.Args[2]
- x := v.Args[1]
- v_2 := v.Args[2]
- if v_2.Op != OpS390XFlagLT {
- break
- }
- v.reset(OpCopy)
- v.Type = x.Type
- v.AddArg(x)
- return true
- }
- // match: (MOVDLE y _ (FlagGT))
- // result: y
- for {
- _ = v.Args[2]
- y := v.Args[0]
- v_2 := v.Args[2]
- if v_2.Op != OpS390XFlagGT {
- break
- }
- v.reset(OpCopy)
- v.Type = y.Type
- v.AddArg(y)
- return true
- }
- return false
-}
-func rewriteValueS390X_OpS390XMOVDLT_0(v *Value) bool {
- // match: (MOVDLT x y (InvertFlags cmp))
- // result: (MOVDGT x y cmp)
- for {
- _ = v.Args[2]
- x := v.Args[0]
- y := v.Args[1]
- v_2 := v.Args[2]
- if v_2.Op != OpS390XInvertFlags {
- break
- }
- cmp := v_2.Args[0]
- v.reset(OpS390XMOVDGT)
- v.AddArg(x)
- v.AddArg(y)
- v.AddArg(cmp)
- return true
- }
- // match: (MOVDLT y _ (FlagEQ))
- // result: y
- for {
- _ = v.Args[2]
- y := v.Args[0]
- v_2 := v.Args[2]
- if v_2.Op != OpS390XFlagEQ {
- break
- }
- v.reset(OpCopy)
- v.Type = y.Type
- v.AddArg(y)
- return true
- }
- // match: (MOVDLT _ x (FlagLT))
- // result: x
- for {
- _ = v.Args[2]
- x := v.Args[1]
- v_2 := v.Args[2]
- if v_2.Op != OpS390XFlagLT {
- break
- }
- v.reset(OpCopy)
- v.Type = x.Type
- v.AddArg(x)
- return true
- }
- // match: (MOVDLT y _ (FlagGT))
- // result: y
- for {
- _ = v.Args[2]
- y := v.Args[0]
- v_2 := v.Args[2]
- if v_2.Op != OpS390XFlagGT {
- break
- }
- v.reset(OpCopy)
- v.Type = y.Type
- v.AddArg(y)
- return true
- }
- return false
-}
-func rewriteValueS390X_OpS390XMOVDNE_0(v *Value) bool {
- // match: (MOVDNE x y (InvertFlags cmp))
- // result: (MOVDNE x y cmp)
- for {
- _ = v.Args[2]
- x := v.Args[0]
- y := v.Args[1]
- v_2 := v.Args[2]
- if v_2.Op != OpS390XInvertFlags {
- break
- }
- cmp := v_2.Args[0]
- v.reset(OpS390XMOVDNE)
- v.AddArg(x)
- v.AddArg(y)
- v.AddArg(cmp)
- return true
- }
- // match: (MOVDNE y _ (FlagEQ))
- // result: y
- for {
- _ = v.Args[2]
- y := v.Args[0]
- v_2 := v.Args[2]
- if v_2.Op != OpS390XFlagEQ {
- break
- }
- v.reset(OpCopy)
- v.Type = y.Type
- v.AddArg(y)
- return true
- }
- // match: (MOVDNE _ x (FlagLT))
- // result: x
- for {
- _ = v.Args[2]
- x := v.Args[1]
- v_2 := v.Args[2]
- if v_2.Op != OpS390XFlagLT {
- break
- }
- v.reset(OpCopy)
- v.Type = x.Type
- v.AddArg(x)
- return true
- }
- // match: (MOVDNE _ x (FlagGT))
- // result: x
- for {
- _ = v.Args[2]
- x := v.Args[1]
- v_2 := v.Args[2]
- if v_2.Op != OpS390XFlagGT {
- break
- }
- v.reset(OpCopy)
- v.Type = x.Type
- v.AddArg(x)
- return true
- }
- return false
-}
func rewriteValueS390X_OpS390XMOVDaddridx_0(v *Value) bool {
// match: (MOVDaddridx [c] {s} (ADDconst [d] x) y)
// cond: is20Bit(c+d) && x.Op != OpSB
typ := &config.Types
v := b.Control
switch b.Kind {
- case BlockS390XEQ:
- // match: (EQ (InvertFlags cmp) yes no)
- // result: (EQ cmp yes no)
- for v.Op == OpS390XInvertFlags {
- cmp := v.Args[0]
- b.Kind = BlockS390XEQ
- b.SetControl(cmp)
- b.Aux = nil
- return true
- }
- // match: (EQ (FlagEQ) yes no)
- // result: (First nil yes no)
- for v.Op == OpS390XFlagEQ {
- b.Kind = BlockFirst
- b.SetControl(nil)
- b.Aux = nil
- return true
- }
- // match: (EQ (FlagLT) yes no)
- // result: (First nil no yes)
- for v.Op == OpS390XFlagLT {
- b.Kind = BlockFirst
- b.SetControl(nil)
- b.Aux = nil
- b.swapSuccessors()
- return true
- }
- // match: (EQ (FlagGT) yes no)
- // result: (First nil no yes)
- for v.Op == OpS390XFlagGT {
- b.Kind = BlockFirst
- b.SetControl(nil)
- b.Aux = nil
- b.swapSuccessors()
- return true
- }
- case BlockS390XGE:
- // match: (GE (InvertFlags cmp) yes no)
- // result: (LE cmp yes no)
- for v.Op == OpS390XInvertFlags {
- cmp := v.Args[0]
- b.Kind = BlockS390XLE
- b.SetControl(cmp)
- b.Aux = nil
- return true
- }
- // match: (GE (FlagEQ) yes no)
- // result: (First nil yes no)
- for v.Op == OpS390XFlagEQ {
- b.Kind = BlockFirst
- b.SetControl(nil)
- b.Aux = nil
- return true
- }
- // match: (GE (FlagLT) yes no)
- // result: (First nil no yes)
- for v.Op == OpS390XFlagLT {
- b.Kind = BlockFirst
- b.SetControl(nil)
- b.Aux = nil
- b.swapSuccessors()
- return true
- }
- // match: (GE (FlagGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpS390XFlagGT {
- b.Kind = BlockFirst
- b.SetControl(nil)
- b.Aux = nil
- return true
- }
- case BlockS390XGT:
- // match: (GT (InvertFlags cmp) yes no)
- // result: (LT cmp yes no)
- for v.Op == OpS390XInvertFlags {
- cmp := v.Args[0]
- b.Kind = BlockS390XLT
- b.SetControl(cmp)
- b.Aux = nil
- return true
- }
- // match: (GT (FlagEQ) yes no)
- // result: (First nil no yes)
- for v.Op == OpS390XFlagEQ {
- b.Kind = BlockFirst
- b.SetControl(nil)
- b.Aux = nil
- b.swapSuccessors()
- return true
- }
- // match: (GT (FlagLT) yes no)
- // result: (First nil no yes)
- for v.Op == OpS390XFlagLT {
- b.Kind = BlockFirst
- b.SetControl(nil)
- b.Aux = nil
- b.swapSuccessors()
- return true
- }
- // match: (GT (FlagGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpS390XFlagGT {
- b.Kind = BlockFirst
- b.SetControl(nil)
- b.Aux = nil
- return true
- }
- case BlockIf:
- // match: (If (MOVDLT (MOVDconst [0]) (MOVDconst [1]) cmp) yes no)
- // result: (LT cmp yes no)
- for v.Op == OpS390XMOVDLT {
- cmp := v.Args[2]
- v_0 := v.Args[0]
- if v_0.Op != OpS390XMOVDconst || v_0.AuxInt != 0 {
- break
- }
- v_1 := v.Args[1]
- if v_1.Op != OpS390XMOVDconst || v_1.AuxInt != 1 {
- break
- }
- b.Kind = BlockS390XLT
- b.SetControl(cmp)
- b.Aux = nil
- return true
- }
- // match: (If (MOVDLE (MOVDconst [0]) (MOVDconst [1]) cmp) yes no)
- // result: (LE cmp yes no)
- for v.Op == OpS390XMOVDLE {
- cmp := v.Args[2]
- v_0 := v.Args[0]
- if v_0.Op != OpS390XMOVDconst || v_0.AuxInt != 0 {
- break
- }
- v_1 := v.Args[1]
- if v_1.Op != OpS390XMOVDconst || v_1.AuxInt != 1 {
- break
- }
- b.Kind = BlockS390XLE
- b.SetControl(cmp)
- b.Aux = nil
- return true
- }
- // match: (If (MOVDGT (MOVDconst [0]) (MOVDconst [1]) cmp) yes no)
- // result: (GT cmp yes no)
- for v.Op == OpS390XMOVDGT {
- cmp := v.Args[2]
- v_0 := v.Args[0]
- if v_0.Op != OpS390XMOVDconst || v_0.AuxInt != 0 {
- break
- }
- v_1 := v.Args[1]
- if v_1.Op != OpS390XMOVDconst || v_1.AuxInt != 1 {
+ case BlockS390XBRC:
+ // match: (BRC {c} (CMPWconst [0] (LOCGR {d} (MOVDconst [0]) (MOVDconst [x]) cmp)) yes no)
+ // cond: x != 0 && c.(s390x.CCMask) == s390x.Equal
+ // result: (BRC {d} cmp no yes)
+ for v.Op == OpS390XCMPWconst {
+ if v.AuxInt != 0 {
break
}
- b.Kind = BlockS390XGT
- b.SetControl(cmp)
- b.Aux = nil
- return true
- }
- // match: (If (MOVDGE (MOVDconst [0]) (MOVDconst [1]) cmp) yes no)
- // result: (GE cmp yes no)
- for v.Op == OpS390XMOVDGE {
- cmp := v.Args[2]
v_0 := v.Args[0]
- if v_0.Op != OpS390XMOVDconst || v_0.AuxInt != 0 {
+ if v_0.Op != OpS390XLOCGR {
break
}
- v_1 := v.Args[1]
- if v_1.Op != OpS390XMOVDconst || v_1.AuxInt != 1 {
+ d := v_0.Aux
+ cmp := v_0.Args[2]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpS390XMOVDconst || v_0_0.AuxInt != 0 {
break
}
- b.Kind = BlockS390XGE
- b.SetControl(cmp)
- b.Aux = nil
- return true
- }
- // match: (If (MOVDEQ (MOVDconst [0]) (MOVDconst [1]) cmp) yes no)
- // result: (EQ cmp yes no)
- for v.Op == OpS390XMOVDEQ {
- cmp := v.Args[2]
- v_0 := v.Args[0]
- if v_0.Op != OpS390XMOVDconst || v_0.AuxInt != 0 {
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpS390XMOVDconst {
break
}
- v_1 := v.Args[1]
- if v_1.Op != OpS390XMOVDconst || v_1.AuxInt != 1 {
+ x := v_0_1.AuxInt
+ c := b.Aux
+ if !(x != 0 && c.(s390x.CCMask) == s390x.Equal) {
break
}
- b.Kind = BlockS390XEQ
+ b.Kind = BlockS390XBRC
b.SetControl(cmp)
- b.Aux = nil
+ b.Aux = d
+ b.swapSuccessors()
return true
}
- // match: (If (MOVDNE (MOVDconst [0]) (MOVDconst [1]) cmp) yes no)
- // result: (NE cmp yes no)
- for v.Op == OpS390XMOVDNE {
- cmp := v.Args[2]
- v_0 := v.Args[0]
- if v_0.Op != OpS390XMOVDconst || v_0.AuxInt != 0 {
- break
- }
- v_1 := v.Args[1]
- if v_1.Op != OpS390XMOVDconst || v_1.AuxInt != 1 {
+ // match: (BRC {c} (CMPWconst [0] (LOCGR {d} (MOVDconst [0]) (MOVDconst [x]) cmp)) yes no)
+ // cond: x != 0 && c.(s390x.CCMask) == s390x.NotEqual
+ // result: (BRC {d} cmp yes no)
+ for v.Op == OpS390XCMPWconst {
+ if v.AuxInt != 0 {
break
}
- b.Kind = BlockS390XNE
- b.SetControl(cmp)
- b.Aux = nil
- return true
- }
- // match: (If (MOVDGTnoinv (MOVDconst [0]) (MOVDconst [1]) cmp) yes no)
- // result: (GTF cmp yes no)
- for v.Op == OpS390XMOVDGTnoinv {
- cmp := v.Args[2]
v_0 := v.Args[0]
- if v_0.Op != OpS390XMOVDconst || v_0.AuxInt != 0 {
+ if v_0.Op != OpS390XLOCGR {
break
}
- v_1 := v.Args[1]
- if v_1.Op != OpS390XMOVDconst || v_1.AuxInt != 1 {
+ d := v_0.Aux
+ cmp := v_0.Args[2]
+ v_0_0 := v_0.Args[0]
+ if v_0_0.Op != OpS390XMOVDconst || v_0_0.AuxInt != 0 {
break
}
- b.Kind = BlockS390XGTF
- b.SetControl(cmp)
- b.Aux = nil
- return true
- }
- // match: (If (MOVDGEnoinv (MOVDconst [0]) (MOVDconst [1]) cmp) yes no)
- // result: (GEF cmp yes no)
- for v.Op == OpS390XMOVDGEnoinv {
- cmp := v.Args[2]
- v_0 := v.Args[0]
- if v_0.Op != OpS390XMOVDconst || v_0.AuxInt != 0 {
+ v_0_1 := v_0.Args[1]
+ if v_0_1.Op != OpS390XMOVDconst {
break
}
- v_1 := v.Args[1]
- if v_1.Op != OpS390XMOVDconst || v_1.AuxInt != 1 {
+ x := v_0_1.AuxInt
+ c := b.Aux
+ if !(x != 0 && c.(s390x.CCMask) == s390x.NotEqual) {
break
}
- b.Kind = BlockS390XGEF
+ b.Kind = BlockS390XBRC
b.SetControl(cmp)
- b.Aux = nil
+ b.Aux = d
return true
}
- // match: (If cond yes no)
- // result: (NE (CMPWconst [0] (MOVBZreg <typ.Bool> cond)) yes no)
- for {
- cond := b.Control
- b.Kind = BlockS390XNE
- v0 := b.NewValue0(v.Pos, OpS390XCMPWconst, types.TypeFlags)
- v0.AuxInt = 0
- v1 := b.NewValue0(v.Pos, OpS390XMOVBZreg, typ.Bool)
- v1.AddArg(cond)
- v0.AddArg(v1)
- b.SetControl(v0)
- b.Aux = nil
- return true
- }
- case BlockS390XLE:
- // match: (LE (InvertFlags cmp) yes no)
- // result: (GE cmp yes no)
+ // match: (BRC {c} (InvertFlags cmp) yes no)
+ // result: (BRC {c.(s390x.CCMask).ReverseComparison()} cmp yes no)
for v.Op == OpS390XInvertFlags {
cmp := v.Args[0]
- b.Kind = BlockS390XGE
+ c := b.Aux
+ b.Kind = BlockS390XBRC
b.SetControl(cmp)
- b.Aux = nil
+ b.Aux = c.(s390x.CCMask).ReverseComparison()
return true
}
- // match: (LE (FlagEQ) yes no)
+ // match: (BRC {c} (FlagEQ) yes no)
+ // cond: c.(s390x.CCMask) & s390x.Equal != 0
// result: (First nil yes no)
for v.Op == OpS390XFlagEQ {
+ c := b.Aux
+ if !(c.(s390x.CCMask)&s390x.Equal != 0) {
+ break
+ }
b.Kind = BlockFirst
b.SetControl(nil)
b.Aux = nil
return true
}
- // match: (LE (FlagLT) yes no)
+ // match: (BRC {c} (FlagLT) yes no)
+ // cond: c.(s390x.CCMask) & s390x.Less != 0
// result: (First nil yes no)
for v.Op == OpS390XFlagLT {
+ c := b.Aux
+ if !(c.(s390x.CCMask)&s390x.Less != 0) {
+ break
+ }
b.Kind = BlockFirst
b.SetControl(nil)
b.Aux = nil
return true
}
- // match: (LE (FlagGT) yes no)
- // result: (First nil no yes)
+ // match: (BRC {c} (FlagGT) yes no)
+ // cond: c.(s390x.CCMask) & s390x.Greater != 0
+ // result: (First nil yes no)
for v.Op == OpS390XFlagGT {
+ c := b.Aux
+ if !(c.(s390x.CCMask)&s390x.Greater != 0) {
+ break
+ }
b.Kind = BlockFirst
b.SetControl(nil)
b.Aux = nil
- b.swapSuccessors()
return true
}
- case BlockS390XLT:
- // match: (LT (InvertFlags cmp) yes no)
- // result: (GT cmp yes no)
- for v.Op == OpS390XInvertFlags {
- cmp := v.Args[0]
- b.Kind = BlockS390XGT
- b.SetControl(cmp)
+ // match: (BRC {c} (FlagOV) yes no)
+ // cond: c.(s390x.CCMask) & s390x.Unordered != 0
+ // result: (First nil yes no)
+ for v.Op == OpS390XFlagOV {
+ c := b.Aux
+ if !(c.(s390x.CCMask)&s390x.Unordered != 0) {
+ break
+ }
+ b.Kind = BlockFirst
+ b.SetControl(nil)
b.Aux = nil
return true
}
- // match: (LT (FlagEQ) yes no)
+ // match: (BRC {c} (FlagEQ) yes no)
+ // cond: c.(s390x.CCMask) & s390x.Equal == 0
// result: (First nil no yes)
for v.Op == OpS390XFlagEQ {
+ c := b.Aux
+ if !(c.(s390x.CCMask)&s390x.Equal == 0) {
+ break
+ }
b.Kind = BlockFirst
b.SetControl(nil)
b.Aux = nil
b.swapSuccessors()
return true
}
- // match: (LT (FlagLT) yes no)
- // result: (First nil yes no)
+ // match: (BRC {c} (FlagLT) yes no)
+ // cond: c.(s390x.CCMask) & s390x.Less == 0
+ // result: (First nil no yes)
for v.Op == OpS390XFlagLT {
+ c := b.Aux
+ if !(c.(s390x.CCMask)&s390x.Less == 0) {
+ break
+ }
b.Kind = BlockFirst
b.SetControl(nil)
b.Aux = nil
+ b.swapSuccessors()
return true
}
- // match: (LT (FlagGT) yes no)
+ // match: (BRC {c} (FlagGT) yes no)
+ // cond: c.(s390x.CCMask) & s390x.Greater == 0
// result: (First nil no yes)
for v.Op == OpS390XFlagGT {
+ c := b.Aux
+ if !(c.(s390x.CCMask)&s390x.Greater == 0) {
+ break
+ }
b.Kind = BlockFirst
b.SetControl(nil)
b.Aux = nil
b.swapSuccessors()
return true
}
- case BlockS390XNE:
- // match: (NE (CMPWconst [0] (MOVDLT (MOVDconst [0]) (MOVDconst [1]) cmp)) yes no)
- // result: (LT cmp yes no)
- for v.Op == OpS390XCMPWconst {
- if v.AuxInt != 0 {
- break
- }
- v_0 := v.Args[0]
- if v_0.Op != OpS390XMOVDLT {
- break
- }
- cmp := v_0.Args[2]
- v_0_0 := v_0.Args[0]
- if v_0_0.Op != OpS390XMOVDconst || v_0_0.AuxInt != 0 {
- break
- }
- v_0_1 := v_0.Args[1]
- if v_0_1.Op != OpS390XMOVDconst || v_0_1.AuxInt != 1 {
- break
- }
- b.Kind = BlockS390XLT
- b.SetControl(cmp)
- b.Aux = nil
- return true
- }
- // match: (NE (CMPWconst [0] (MOVDLE (MOVDconst [0]) (MOVDconst [1]) cmp)) yes no)
- // result: (LE cmp yes no)
- for v.Op == OpS390XCMPWconst {
- if v.AuxInt != 0 {
- break
- }
- v_0 := v.Args[0]
- if v_0.Op != OpS390XMOVDLE {
- break
- }
- cmp := v_0.Args[2]
- v_0_0 := v_0.Args[0]
- if v_0_0.Op != OpS390XMOVDconst || v_0_0.AuxInt != 0 {
- break
- }
- v_0_1 := v_0.Args[1]
- if v_0_1.Op != OpS390XMOVDconst || v_0_1.AuxInt != 1 {
- break
- }
- b.Kind = BlockS390XLE
- b.SetControl(cmp)
- b.Aux = nil
- return true
- }
- // match: (NE (CMPWconst [0] (MOVDGT (MOVDconst [0]) (MOVDconst [1]) cmp)) yes no)
- // result: (GT cmp yes no)
- for v.Op == OpS390XCMPWconst {
- if v.AuxInt != 0 {
- break
- }
- v_0 := v.Args[0]
- if v_0.Op != OpS390XMOVDGT {
- break
- }
- cmp := v_0.Args[2]
- v_0_0 := v_0.Args[0]
- if v_0_0.Op != OpS390XMOVDconst || v_0_0.AuxInt != 0 {
- break
- }
- v_0_1 := v_0.Args[1]
- if v_0_1.Op != OpS390XMOVDconst || v_0_1.AuxInt != 1 {
- break
- }
- b.Kind = BlockS390XGT
- b.SetControl(cmp)
- b.Aux = nil
- return true
- }
- // match: (NE (CMPWconst [0] (MOVDGE (MOVDconst [0]) (MOVDconst [1]) cmp)) yes no)
- // result: (GE cmp yes no)
- for v.Op == OpS390XCMPWconst {
- if v.AuxInt != 0 {
- break
- }
- v_0 := v.Args[0]
- if v_0.Op != OpS390XMOVDGE {
- break
- }
- cmp := v_0.Args[2]
- v_0_0 := v_0.Args[0]
- if v_0_0.Op != OpS390XMOVDconst || v_0_0.AuxInt != 0 {
- break
- }
- v_0_1 := v_0.Args[1]
- if v_0_1.Op != OpS390XMOVDconst || v_0_1.AuxInt != 1 {
- break
- }
- b.Kind = BlockS390XGE
- b.SetControl(cmp)
- b.Aux = nil
- return true
- }
- // match: (NE (CMPWconst [0] (MOVDEQ (MOVDconst [0]) (MOVDconst [1]) cmp)) yes no)
- // result: (EQ cmp yes no)
- for v.Op == OpS390XCMPWconst {
- if v.AuxInt != 0 {
- break
- }
- v_0 := v.Args[0]
- if v_0.Op != OpS390XMOVDEQ {
- break
- }
- cmp := v_0.Args[2]
- v_0_0 := v_0.Args[0]
- if v_0_0.Op != OpS390XMOVDconst || v_0_0.AuxInt != 0 {
- break
- }
- v_0_1 := v_0.Args[1]
- if v_0_1.Op != OpS390XMOVDconst || v_0_1.AuxInt != 1 {
- break
- }
- b.Kind = BlockS390XEQ
- b.SetControl(cmp)
- b.Aux = nil
- return true
- }
- // match: (NE (CMPWconst [0] (MOVDNE (MOVDconst [0]) (MOVDconst [1]) cmp)) yes no)
- // result: (NE cmp yes no)
- for v.Op == OpS390XCMPWconst {
- if v.AuxInt != 0 {
- break
- }
- v_0 := v.Args[0]
- if v_0.Op != OpS390XMOVDNE {
- break
- }
- cmp := v_0.Args[2]
- v_0_0 := v_0.Args[0]
- if v_0_0.Op != OpS390XMOVDconst || v_0_0.AuxInt != 0 {
- break
- }
- v_0_1 := v_0.Args[1]
- if v_0_1.Op != OpS390XMOVDconst || v_0_1.AuxInt != 1 {
- break
- }
- b.Kind = BlockS390XNE
- b.SetControl(cmp)
- b.Aux = nil
- return true
- }
- // match: (NE (CMPWconst [0] (MOVDGTnoinv (MOVDconst [0]) (MOVDconst [1]) cmp)) yes no)
- // result: (GTF cmp yes no)
- for v.Op == OpS390XCMPWconst {
- if v.AuxInt != 0 {
- break
- }
- v_0 := v.Args[0]
- if v_0.Op != OpS390XMOVDGTnoinv {
- break
- }
- cmp := v_0.Args[2]
- v_0_0 := v_0.Args[0]
- if v_0_0.Op != OpS390XMOVDconst || v_0_0.AuxInt != 0 {
- break
- }
- v_0_1 := v_0.Args[1]
- if v_0_1.Op != OpS390XMOVDconst || v_0_1.AuxInt != 1 {
- break
- }
- b.Kind = BlockS390XGTF
- b.SetControl(cmp)
- b.Aux = nil
- return true
- }
- // match: (NE (CMPWconst [0] (MOVDGEnoinv (MOVDconst [0]) (MOVDconst [1]) cmp)) yes no)
- // result: (GEF cmp yes no)
- for v.Op == OpS390XCMPWconst {
- if v.AuxInt != 0 {
- break
- }
- v_0 := v.Args[0]
- if v_0.Op != OpS390XMOVDGEnoinv {
- break
- }
- cmp := v_0.Args[2]
- v_0_0 := v_0.Args[0]
- if v_0_0.Op != OpS390XMOVDconst || v_0_0.AuxInt != 0 {
- break
- }
- v_0_1 := v_0.Args[1]
- if v_0_1.Op != OpS390XMOVDconst || v_0_1.AuxInt != 1 {
+ // match: (BRC {c} (FlagOV) yes no)
+ // cond: c.(s390x.CCMask) & s390x.Unordered == 0
+ // result: (First nil no yes)
+ for v.Op == OpS390XFlagOV {
+ c := b.Aux
+ if !(c.(s390x.CCMask)&s390x.Unordered == 0) {
break
}
- b.Kind = BlockS390XGEF
- b.SetControl(cmp)
- b.Aux = nil
- return true
- }
- // match: (NE (InvertFlags cmp) yes no)
- // result: (NE cmp yes no)
- for v.Op == OpS390XInvertFlags {
- cmp := v.Args[0]
- b.Kind = BlockS390XNE
- b.SetControl(cmp)
- b.Aux = nil
- return true
- }
- // match: (NE (FlagEQ) yes no)
- // result: (First nil no yes)
- for v.Op == OpS390XFlagEQ {
b.Kind = BlockFirst
b.SetControl(nil)
b.Aux = nil
b.swapSuccessors()
return true
}
- // match: (NE (FlagLT) yes no)
- // result: (First nil yes no)
- for v.Op == OpS390XFlagLT {
- b.Kind = BlockFirst
- b.SetControl(nil)
- b.Aux = nil
- return true
- }
- // match: (NE (FlagGT) yes no)
- // result: (First nil yes no)
- for v.Op == OpS390XFlagGT {
- b.Kind = BlockFirst
- b.SetControl(nil)
- b.Aux = nil
+ case BlockIf:
+ // match: (If cond yes no)
+ // result: (BRC {s390x.NotEqual} (CMPWconst [0] (MOVBZreg <typ.Bool> cond)) yes no)
+ for {
+ cond := b.Control
+ b.Kind = BlockS390XBRC
+ v0 := b.NewValue0(v.Pos, OpS390XCMPWconst, types.TypeFlags)
+ v0.AuxInt = 0
+ v1 := b.NewValue0(v.Pos, OpS390XMOVBZreg, typ.Bool)
+ v1.AddArg(cond)
+ v0.AddArg(v1)
+ b.SetControl(v0)
+ b.Aux = s390x.NotEqual
return true
}
}