// shifts
// hardware instruction uses only the low 6 bits of the shift
// we compare to 64 to ensure Go semantics for large shifts
-(Lsh64x64 <t> x y) -> (CSELULT (SLL <t> x y) (MOVDconst <t> [0]) (CMPconst [64] y))
-(Lsh64x32 <t> x y) -> (CSELULT (SLL <t> x (ZeroExt32to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
-(Lsh64x16 <t> x y) -> (CSELULT (SLL <t> x (ZeroExt16to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
-(Lsh64x8 <t> x y) -> (CSELULT (SLL <t> x (ZeroExt8to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
-
-(Lsh32x64 <t> x y) -> (CSELULT (SLL <t> x y) (MOVDconst <t> [0]) (CMPconst [64] y))
-(Lsh32x32 <t> x y) -> (CSELULT (SLL <t> x (ZeroExt32to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
-(Lsh32x16 <t> x y) -> (CSELULT (SLL <t> x (ZeroExt16to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
-(Lsh32x8 <t> x y) -> (CSELULT (SLL <t> x (ZeroExt8to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
-
-(Lsh16x64 <t> x y) -> (CSELULT (SLL <t> x y) (MOVDconst <t> [0]) (CMPconst [64] y))
-(Lsh16x32 <t> x y) -> (CSELULT (SLL <t> x (ZeroExt32to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
-(Lsh16x16 <t> x y) -> (CSELULT (SLL <t> x (ZeroExt16to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
-(Lsh16x8 <t> x y) -> (CSELULT (SLL <t> x (ZeroExt8to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
-
-(Lsh8x64 <t> x y) -> (CSELULT (SLL <t> x y) (MOVDconst <t> [0]) (CMPconst [64] y))
-(Lsh8x32 <t> x y) -> (CSELULT (SLL <t> x (ZeroExt32to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
-(Lsh8x16 <t> x y) -> (CSELULT (SLL <t> x (ZeroExt16to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
-(Lsh8x8 <t> x y) -> (CSELULT (SLL <t> x (ZeroExt8to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
-
-(Rsh64Ux64 <t> x y) -> (CSELULT (SRL <t> x y) (MOVDconst <t> [0]) (CMPconst [64] y))
-(Rsh64Ux32 <t> x y) -> (CSELULT (SRL <t> x (ZeroExt32to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
-(Rsh64Ux16 <t> x y) -> (CSELULT (SRL <t> x (ZeroExt16to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
-(Rsh64Ux8 <t> x y) -> (CSELULT (SRL <t> x (ZeroExt8to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
-
-(Rsh32Ux64 <t> x y) -> (CSELULT (SRL <t> (ZeroExt32to64 x) y) (MOVDconst <t> [0]) (CMPconst [64] y))
-(Rsh32Ux32 <t> x y) -> (CSELULT (SRL <t> (ZeroExt32to64 x) (ZeroExt32to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
-(Rsh32Ux16 <t> x y) -> (CSELULT (SRL <t> (ZeroExt32to64 x) (ZeroExt16to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
-(Rsh32Ux8 <t> x y) -> (CSELULT (SRL <t> (ZeroExt32to64 x) (ZeroExt8to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
-
-(Rsh16Ux64 <t> x y) -> (CSELULT (SRL <t> (ZeroExt16to64 x) y) (MOVDconst <t> [0]) (CMPconst [64] y))
-(Rsh16Ux32 <t> x y) -> (CSELULT (SRL <t> (ZeroExt16to64 x) (ZeroExt32to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
-(Rsh16Ux16 <t> x y) -> (CSELULT (SRL <t> (ZeroExt16to64 x) (ZeroExt16to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
-(Rsh16Ux8 <t> x y) -> (CSELULT (SRL <t> (ZeroExt16to64 x) (ZeroExt8to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
-
-(Rsh8Ux64 <t> x y) -> (CSELULT (SRL <t> (ZeroExt8to64 x) y) (MOVDconst <t> [0]) (CMPconst [64] y))
-(Rsh8Ux32 <t> x y) -> (CSELULT (SRL <t> (ZeroExt8to64 x) (ZeroExt32to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
-(Rsh8Ux16 <t> x y) -> (CSELULT (SRL <t> (ZeroExt8to64 x) (ZeroExt16to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
-(Rsh8Ux8 <t> x y) -> (CSELULT (SRL <t> (ZeroExt8to64 x) (ZeroExt8to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
-
-(Rsh64x64 x y) -> (SRA x (CSELULT <y.Type> y (MOVDconst <y.Type> [63]) (CMPconst [64] y)))
-(Rsh64x32 x y) -> (SRA x (CSELULT <y.Type> (ZeroExt32to64 y) (MOVDconst <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
-(Rsh64x16 x y) -> (SRA x (CSELULT <y.Type> (ZeroExt16to64 y) (MOVDconst <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
-(Rsh64x8 x y) -> (SRA x (CSELULT <y.Type> (ZeroExt8to64 y) (MOVDconst <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
-
-(Rsh32x64 x y) -> (SRA (SignExt32to64 x) (CSELULT <y.Type> y (MOVDconst <y.Type> [63]) (CMPconst [64] y)))
-(Rsh32x32 x y) -> (SRA (SignExt32to64 x) (CSELULT <y.Type> (ZeroExt32to64 y) (MOVDconst <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
-(Rsh32x16 x y) -> (SRA (SignExt32to64 x) (CSELULT <y.Type> (ZeroExt16to64 y) (MOVDconst <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
-(Rsh32x8 x y) -> (SRA (SignExt32to64 x) (CSELULT <y.Type> (ZeroExt8to64 y) (MOVDconst <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
-
-(Rsh16x64 x y) -> (SRA (SignExt16to64 x) (CSELULT <y.Type> y (MOVDconst <y.Type> [63]) (CMPconst [64] y)))
-(Rsh16x32 x y) -> (SRA (SignExt16to64 x) (CSELULT <y.Type> (ZeroExt32to64 y) (MOVDconst <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
-(Rsh16x16 x y) -> (SRA (SignExt16to64 x) (CSELULT <y.Type> (ZeroExt16to64 y) (MOVDconst <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
-(Rsh16x8 x y) -> (SRA (SignExt16to64 x) (CSELULT <y.Type> (ZeroExt8to64 y) (MOVDconst <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
-
-(Rsh8x64 x y) -> (SRA (SignExt8to64 x) (CSELULT <y.Type> y (MOVDconst <y.Type> [63]) (CMPconst [64] y)))
-(Rsh8x32 x y) -> (SRA (SignExt8to64 x) (CSELULT <y.Type> (ZeroExt32to64 y) (MOVDconst <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
-(Rsh8x16 x y) -> (SRA (SignExt8to64 x) (CSELULT <y.Type> (ZeroExt16to64 y) (MOVDconst <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
-(Rsh8x8 x y) -> (SRA (SignExt8to64 x) (CSELULT <y.Type> (ZeroExt8to64 y) (MOVDconst <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
+(Lsh64x64 <t> x y) -> (CSEL {OpARM64LessThanU} (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] y))
+(Lsh64x32 <t> x y) -> (CSEL {OpARM64LessThanU} (SLL <t> x (ZeroExt32to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
+(Lsh64x16 <t> x y) -> (CSEL {OpARM64LessThanU} (SLL <t> x (ZeroExt16to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
+(Lsh64x8 <t> x y) -> (CSEL {OpARM64LessThanU} (SLL <t> x (ZeroExt8to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
+
+(Lsh32x64 <t> x y) -> (CSEL {OpARM64LessThanU} (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] y))
+(Lsh32x32 <t> x y) -> (CSEL {OpARM64LessThanU} (SLL <t> x (ZeroExt32to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
+(Lsh32x16 <t> x y) -> (CSEL {OpARM64LessThanU} (SLL <t> x (ZeroExt16to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
+(Lsh32x8 <t> x y) -> (CSEL {OpARM64LessThanU} (SLL <t> x (ZeroExt8to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
+
+(Lsh16x64 <t> x y) -> (CSEL {OpARM64LessThanU} (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] y))
+(Lsh16x32 <t> x y) -> (CSEL {OpARM64LessThanU} (SLL <t> x (ZeroExt32to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
+(Lsh16x16 <t> x y) -> (CSEL {OpARM64LessThanU} (SLL <t> x (ZeroExt16to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
+(Lsh16x8 <t> x y) -> (CSEL {OpARM64LessThanU} (SLL <t> x (ZeroExt8to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
+
+(Lsh8x64 <t> x y) -> (CSEL {OpARM64LessThanU} (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] y))
+(Lsh8x32 <t> x y) -> (CSEL {OpARM64LessThanU} (SLL <t> x (ZeroExt32to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
+(Lsh8x16 <t> x y) -> (CSEL {OpARM64LessThanU} (SLL <t> x (ZeroExt16to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
+(Lsh8x8 <t> x y) -> (CSEL {OpARM64LessThanU} (SLL <t> x (ZeroExt8to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
+
+(Rsh64Ux64 <t> x y) -> (CSEL {OpARM64LessThanU} (SRL <t> x y) (Const64 <t> [0]) (CMPconst [64] y))
+(Rsh64Ux32 <t> x y) -> (CSEL {OpARM64LessThanU} (SRL <t> x (ZeroExt32to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
+(Rsh64Ux16 <t> x y) -> (CSEL {OpARM64LessThanU} (SRL <t> x (ZeroExt16to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
+(Rsh64Ux8 <t> x y) -> (CSEL {OpARM64LessThanU} (SRL <t> x (ZeroExt8to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
+
+(Rsh32Ux64 <t> x y) -> (CSEL {OpARM64LessThanU} (SRL <t> (ZeroExt32to64 x) y) (Const64 <t> [0]) (CMPconst [64] y))
+(Rsh32Ux32 <t> x y) -> (CSEL {OpARM64LessThanU} (SRL <t> (ZeroExt32to64 x) (ZeroExt32to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
+(Rsh32Ux16 <t> x y) -> (CSEL {OpARM64LessThanU} (SRL <t> (ZeroExt32to64 x) (ZeroExt16to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
+(Rsh32Ux8 <t> x y) -> (CSEL {OpARM64LessThanU} (SRL <t> (ZeroExt32to64 x) (ZeroExt8to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
+
+(Rsh16Ux64 <t> x y) -> (CSEL {OpARM64LessThanU} (SRL <t> (ZeroExt16to64 x) y) (Const64 <t> [0]) (CMPconst [64] y))
+(Rsh16Ux32 <t> x y) -> (CSEL {OpARM64LessThanU} (SRL <t> (ZeroExt16to64 x) (ZeroExt32to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
+(Rsh16Ux16 <t> x y) -> (CSEL {OpARM64LessThanU} (SRL <t> (ZeroExt16to64 x) (ZeroExt16to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
+(Rsh16Ux8 <t> x y) -> (CSEL {OpARM64LessThanU} (SRL <t> (ZeroExt16to64 x) (ZeroExt8to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
+
+(Rsh8Ux64 <t> x y) -> (CSEL {OpARM64LessThanU} (SRL <t> (ZeroExt8to64 x) y) (Const64 <t> [0]) (CMPconst [64] y))
+(Rsh8Ux32 <t> x y) -> (CSEL {OpARM64LessThanU} (SRL <t> (ZeroExt8to64 x) (ZeroExt32to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
+(Rsh8Ux16 <t> x y) -> (CSEL {OpARM64LessThanU} (SRL <t> (ZeroExt8to64 x) (ZeroExt16to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
+(Rsh8Ux8 <t> x y) -> (CSEL {OpARM64LessThanU} (SRL <t> (ZeroExt8to64 x) (ZeroExt8to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
+
+(Rsh64x64 x y) -> (SRA x (CSEL {OpARM64LessThanU} <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] y)))
+(Rsh64x32 x y) -> (SRA x (CSEL {OpARM64LessThanU} <y.Type> (ZeroExt32to64 y) (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
+(Rsh64x16 x y) -> (SRA x (CSEL {OpARM64LessThanU} <y.Type> (ZeroExt16to64 y) (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
+(Rsh64x8 x y) -> (SRA x (CSEL {OpARM64LessThanU} <y.Type> (ZeroExt8to64 y) (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
+
+(Rsh32x64 x y) -> (SRA (SignExt32to64 x) (CSEL {OpARM64LessThanU} <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] y)))
+(Rsh32x32 x y) -> (SRA (SignExt32to64 x) (CSEL {OpARM64LessThanU} <y.Type> (ZeroExt32to64 y) (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
+(Rsh32x16 x y) -> (SRA (SignExt32to64 x) (CSEL {OpARM64LessThanU} <y.Type> (ZeroExt16to64 y) (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
+(Rsh32x8 x y) -> (SRA (SignExt32to64 x) (CSEL {OpARM64LessThanU} <y.Type> (ZeroExt8to64 y) (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
+
+(Rsh16x64 x y) -> (SRA (SignExt16to64 x) (CSEL {OpARM64LessThanU} <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] y)))
+(Rsh16x32 x y) -> (SRA (SignExt16to64 x) (CSEL {OpARM64LessThanU} <y.Type> (ZeroExt32to64 y) (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
+(Rsh16x16 x y) -> (SRA (SignExt16to64 x) (CSEL {OpARM64LessThanU} <y.Type> (ZeroExt16to64 y) (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
+(Rsh16x8 x y) -> (SRA (SignExt16to64 x) (CSEL {OpARM64LessThanU} <y.Type> (ZeroExt8to64 y) (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
+
+(Rsh8x64 x y) -> (SRA (SignExt8to64 x) (CSEL {OpARM64LessThanU} <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] y)))
+(Rsh8x32 x y) -> (SRA (SignExt8to64 x) (CSEL {OpARM64LessThanU} <y.Type> (ZeroExt32to64 y) (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
+(Rsh8x16 x y) -> (SRA (SignExt8to64 x) (CSEL {OpARM64LessThanU} <y.Type> (ZeroExt16to64 y) (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
+(Rsh8x8 x y) -> (SRA (SignExt8to64 x) (CSEL {OpARM64LessThanU} <y.Type> (ZeroExt8to64 y) (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
// constants
(Const64 [val]) -> (MOVDconst [val])
(Geq32U x y) -> (GreaterEqualU (CMPW x y))
(Geq64U x y) -> (GreaterEqualU (CMP x y))
+// CSEL needs a flag-generating argument. Synthesize a CMPW if necessary.
+(CondSelect x y bool) && flagArg(bool) != nil -> (CSEL {bool.Op} x y flagArg(bool))
+(CondSelect x y bool) && flagArg(bool) == nil -> (CSEL {OpARM64NotEqual} x y (CMPWconst [0] bool))
+
(OffPtr [off] ptr:(SP)) -> (MOVDaddr [off] ptr)
(OffPtr [off] ptr) -> (ADDconst [off] ptr)
(XOR x x) -> (MOVDconst [0])
(BIC x x) -> (MOVDconst [0])
(AND x (MVN y)) -> (BIC x y)
-(CSELULT x (MOVDconst [0]) flag) -> (CSELULT0 x flag)
+(CSEL {cc} x (MOVDconst [0]) flag) -> (CSEL0 {cc} x flag)
+(CSEL {cc} (MOVDconst [0]) y flag) -> (CSEL0 {arm64Negate(cc.(Op))} y flag)
(SUB x (SUB y z)) -> (SUB (ADD <v.Type> x z) y)
(SUB (SUB x y) z) -> (SUB x (ADD <y.Type> y z))
(EQ (InvertFlags cmp) yes no) -> (EQ cmp yes no)
(NE (InvertFlags cmp) yes no) -> (NE cmp yes no)
+// absorb InvertFlags into CSEL(0)
+(CSEL {cc} x y (InvertFlags cmp)) -> (CSEL {arm64Invert(cc.(Op))} x y cmp)
+(CSEL0 {cc} x (InvertFlags cmp)) -> (CSEL0 {arm64Invert(cc.(Op))} x cmp)
+
// absorb flag constants into boolean values
(Equal (FlagEQ)) -> (MOVDconst [1])
(Equal (FlagLT_ULT)) -> (MOVDconst [0])
(MOVBUreg x) && x.Type.IsBoolean() -> (MOVDreg x)
// absorb flag constants into conditional instructions
-(CSELULT _ y (FlagEQ)) -> y
-(CSELULT x _ (FlagLT_ULT)) -> x
-(CSELULT _ y (FlagLT_UGT)) -> y
-(CSELULT x _ (FlagGT_ULT)) -> x
-(CSELULT _ y (FlagGT_UGT)) -> y
-(CSELULT0 _ (FlagEQ)) -> (MOVDconst [0])
-(CSELULT0 x (FlagLT_ULT)) -> x
-(CSELULT0 _ (FlagLT_UGT)) -> (MOVDconst [0])
-(CSELULT0 x (FlagGT_ULT)) -> x
-(CSELULT0 _ (FlagGT_UGT)) -> (MOVDconst [0])
+(CSEL {cc} x _ flag) && ccARM64Eval(cc, flag) > 0 -> x
+(CSEL {cc} _ y flag) && ccARM64Eval(cc, flag) < 0 -> y
+(CSEL0 {cc} x flag) && ccARM64Eval(cc, flag) > 0 -> x
+(CSEL0 {cc} _ flag) && ccARM64Eval(cc, flag) < 0 -> (MOVDconst [0])
+
+// absorb flags back into boolean CSEL
+(CSEL {cc} x y (CMPWconst [0] bool)) && cc.(Op) == OpARM64NotEqual && flagArg(bool) != nil ->
+ (CSEL {bool.Op} x y flagArg(bool))
+(CSEL {cc} x y (CMPWconst [0] bool)) && cc.(Op) == OpARM64Equal && flagArg(bool) != nil ->
+ (CSEL {arm64Negate(bool.Op)} x y flagArg(bool))
+(CSEL0 {cc} x (CMPWconst [0] bool)) && cc.(Op) == OpARM64NotEqual && flagArg(bool) != nil ->
+ (CSEL0 {bool.Op} x flagArg(bool))
+(CSEL0 {cc} x (CMPWconst [0] bool)) && cc.(Op) == OpARM64Equal && flagArg(bool) != nil ->
+ (CSEL0 {arm64Negate(bool.Op)} x flagArg(bool))
// absorb shifts into ops
(ADD x0 x1:(SLLconst [c] y)) && clobberIfDead(x1) -> (ADDshiftLL x0 y [c])
return rewriteValueARM64_OpARM64CMPshiftRA_0(v)
case OpARM64CMPshiftRL:
return rewriteValueARM64_OpARM64CMPshiftRL_0(v)
- case OpARM64CSELULT:
- return rewriteValueARM64_OpARM64CSELULT_0(v)
- case OpARM64CSELULT0:
- return rewriteValueARM64_OpARM64CSELULT0_0(v)
+ case OpARM64CSEL:
+ return rewriteValueARM64_OpARM64CSEL_0(v)
+ case OpARM64CSEL0:
+ return rewriteValueARM64_OpARM64CSEL0_0(v)
case OpARM64DIV:
return rewriteValueARM64_OpARM64DIV_0(v)
case OpARM64DIVW:
return rewriteValueARM64_OpCom64_0(v)
case OpCom8:
return rewriteValueARM64_OpCom8_0(v)
+ case OpCondSelect:
+ return rewriteValueARM64_OpCondSelect_0(v)
case OpConst16:
return rewriteValueARM64_OpConst16_0(v)
case OpConst32:
}
return false
}
-func rewriteValueARM64_OpARM64CSELULT_0(v *Value) bool {
- // match: (CSELULT x (MOVDconst [0]) flag)
+func rewriteValueARM64_OpARM64CSEL_0(v *Value) bool {
+ // match: (CSEL {cc} x (MOVDconst [0]) flag)
// cond:
- // result: (CSELULT0 x flag)
+ // result: (CSEL0 {cc} x flag)
for {
+ cc := v.Aux
_ = v.Args[2]
x := v.Args[0]
v_1 := v.Args[1]
break
}
flag := v.Args[2]
- v.reset(OpARM64CSELULT0)
+ v.reset(OpARM64CSEL0)
+ v.Aux = cc
v.AddArg(x)
v.AddArg(flag)
return true
}
- // match: (CSELULT _ y (FlagEQ))
+ // match: (CSEL {cc} (MOVDconst [0]) y flag)
// cond:
- // result: y
+ // result: (CSEL0 {arm64Negate(cc.(Op))} y flag)
for {
+ cc := v.Aux
_ = v.Args[2]
+ v_0 := v.Args[0]
+ if v_0.Op != OpARM64MOVDconst {
+ break
+ }
+ if v_0.AuxInt != 0 {
+ break
+ }
+ y := v.Args[1]
+ flag := v.Args[2]
+ v.reset(OpARM64CSEL0)
+ v.Aux = arm64Negate(cc.(Op))
+ v.AddArg(y)
+ v.AddArg(flag)
+ return true
+ }
+ // match: (CSEL {cc} x y (InvertFlags cmp))
+ // cond:
+ // result: (CSEL {arm64Invert(cc.(Op))} x y cmp)
+ for {
+ cc := v.Aux
+ _ = v.Args[2]
+ x := v.Args[0]
y := v.Args[1]
v_2 := v.Args[2]
- if v_2.Op != OpARM64FlagEQ {
+ if v_2.Op != OpARM64InvertFlags {
break
}
- v.reset(OpCopy)
- v.Type = y.Type
+ cmp := v_2.Args[0]
+ v.reset(OpARM64CSEL)
+ v.Aux = arm64Invert(cc.(Op))
+ v.AddArg(x)
v.AddArg(y)
+ v.AddArg(cmp)
return true
}
- // match: (CSELULT x _ (FlagLT_ULT))
- // cond:
+ // match: (CSEL {cc} x _ flag)
+ // cond: ccARM64Eval(cc, flag) > 0
// result: x
for {
+ cc := v.Aux
_ = v.Args[2]
x := v.Args[0]
- v_2 := v.Args[2]
- if v_2.Op != OpARM64FlagLT_ULT {
+ flag := v.Args[2]
+ if !(ccARM64Eval(cc, flag) > 0) {
break
}
v.reset(OpCopy)
v.AddArg(x)
return true
}
- // match: (CSELULT _ y (FlagLT_UGT))
- // cond:
+ // match: (CSEL {cc} _ y flag)
+ // cond: ccARM64Eval(cc, flag) < 0
// result: y
for {
+ cc := v.Aux
_ = v.Args[2]
y := v.Args[1]
- v_2 := v.Args[2]
- if v_2.Op != OpARM64FlagLT_UGT {
+ flag := v.Args[2]
+ if !(ccARM64Eval(cc, flag) < 0) {
break
}
v.reset(OpCopy)
v.AddArg(y)
return true
}
- // match: (CSELULT x _ (FlagGT_ULT))
- // cond:
- // result: x
+ // match: (CSEL {cc} x y (CMPWconst [0] bool))
+ // cond: cc.(Op) == OpARM64NotEqual && flagArg(bool) != nil
+ // result: (CSEL {bool.Op} x y flagArg(bool))
for {
+ cc := v.Aux
_ = v.Args[2]
x := v.Args[0]
+ y := v.Args[1]
v_2 := v.Args[2]
- if v_2.Op != OpARM64FlagGT_ULT {
+ if v_2.Op != OpARM64CMPWconst {
break
}
- v.reset(OpCopy)
- v.Type = x.Type
+ if v_2.AuxInt != 0 {
+ break
+ }
+ bool := v_2.Args[0]
+ if !(cc.(Op) == OpARM64NotEqual && flagArg(bool) != nil) {
+ break
+ }
+ v.reset(OpARM64CSEL)
+ v.Aux = bool.Op
v.AddArg(x)
+ v.AddArg(y)
+ v.AddArg(flagArg(bool))
return true
}
- // match: (CSELULT _ y (FlagGT_UGT))
- // cond:
- // result: y
+ // match: (CSEL {cc} x y (CMPWconst [0] bool))
+ // cond: cc.(Op) == OpARM64Equal && flagArg(bool) != nil
+ // result: (CSEL {arm64Negate(bool.Op)} x y flagArg(bool))
for {
+ cc := v.Aux
_ = v.Args[2]
+ x := v.Args[0]
y := v.Args[1]
v_2 := v.Args[2]
- if v_2.Op != OpARM64FlagGT_UGT {
+ if v_2.Op != OpARM64CMPWconst {
break
}
- v.reset(OpCopy)
- v.Type = y.Type
+ if v_2.AuxInt != 0 {
+ break
+ }
+ bool := v_2.Args[0]
+ if !(cc.(Op) == OpARM64Equal && flagArg(bool) != nil) {
+ break
+ }
+ v.reset(OpARM64CSEL)
+ v.Aux = arm64Negate(bool.Op)
+ v.AddArg(x)
v.AddArg(y)
+ v.AddArg(flagArg(bool))
return true
}
return false
}
-func rewriteValueARM64_OpARM64CSELULT0_0(v *Value) bool {
- // match: (CSELULT0 _ (FlagEQ))
+func rewriteValueARM64_OpARM64CSEL0_0(v *Value) bool {
+ // match: (CSEL0 {cc} x (InvertFlags cmp))
// cond:
- // result: (MOVDconst [0])
+ // result: (CSEL0 {arm64Invert(cc.(Op))} x cmp)
for {
+ cc := v.Aux
_ = v.Args[1]
+ x := v.Args[0]
v_1 := v.Args[1]
- if v_1.Op != OpARM64FlagEQ {
+ if v_1.Op != OpARM64InvertFlags {
break
}
- v.reset(OpARM64MOVDconst)
- v.AuxInt = 0
+ cmp := v_1.Args[0]
+ v.reset(OpARM64CSEL0)
+ v.Aux = arm64Invert(cc.(Op))
+ v.AddArg(x)
+ v.AddArg(cmp)
return true
}
- // match: (CSELULT0 x (FlagLT_ULT))
- // cond:
+ // match: (CSEL0 {cc} x flag)
+ // cond: ccARM64Eval(cc, flag) > 0
// result: x
for {
+ cc := v.Aux
_ = v.Args[1]
x := v.Args[0]
- v_1 := v.Args[1]
- if v_1.Op != OpARM64FlagLT_ULT {
+ flag := v.Args[1]
+ if !(ccARM64Eval(cc, flag) > 0) {
break
}
v.reset(OpCopy)
v.AddArg(x)
return true
}
- // match: (CSELULT0 _ (FlagLT_UGT))
- // cond:
+ // match: (CSEL0 {cc} _ flag)
+ // cond: ccARM64Eval(cc, flag) < 0
// result: (MOVDconst [0])
for {
+ cc := v.Aux
_ = v.Args[1]
- v_1 := v.Args[1]
- if v_1.Op != OpARM64FlagLT_UGT {
+ flag := v.Args[1]
+ if !(ccARM64Eval(cc, flag) < 0) {
break
}
v.reset(OpARM64MOVDconst)
v.AuxInt = 0
return true
}
- // match: (CSELULT0 x (FlagGT_ULT))
- // cond:
- // result: x
+ // match: (CSEL0 {cc} x (CMPWconst [0] bool))
+ // cond: cc.(Op) == OpARM64NotEqual && flagArg(bool) != nil
+ // result: (CSEL0 {bool.Op} x flagArg(bool))
for {
+ cc := v.Aux
_ = v.Args[1]
x := v.Args[0]
v_1 := v.Args[1]
- if v_1.Op != OpARM64FlagGT_ULT {
+ if v_1.Op != OpARM64CMPWconst {
break
}
- v.reset(OpCopy)
- v.Type = x.Type
+ if v_1.AuxInt != 0 {
+ break
+ }
+ bool := v_1.Args[0]
+ if !(cc.(Op) == OpARM64NotEqual && flagArg(bool) != nil) {
+ break
+ }
+ v.reset(OpARM64CSEL0)
+ v.Aux = bool.Op
v.AddArg(x)
+ v.AddArg(flagArg(bool))
return true
}
- // match: (CSELULT0 _ (FlagGT_UGT))
- // cond:
- // result: (MOVDconst [0])
+ // match: (CSEL0 {cc} x (CMPWconst [0] bool))
+ // cond: cc.(Op) == OpARM64Equal && flagArg(bool) != nil
+ // result: (CSEL0 {arm64Negate(bool.Op)} x flagArg(bool))
for {
+ cc := v.Aux
_ = v.Args[1]
+ x := v.Args[0]
v_1 := v.Args[1]
- if v_1.Op != OpARM64FlagGT_UGT {
+ if v_1.Op != OpARM64CMPWconst {
break
}
- v.reset(OpARM64MOVDconst)
- v.AuxInt = 0
+ if v_1.AuxInt != 0 {
+ break
+ }
+ bool := v_1.Args[0]
+ if !(cc.(Op) == OpARM64Equal && flagArg(bool) != nil) {
+ break
+ }
+ v.reset(OpARM64CSEL0)
+ v.Aux = arm64Negate(bool.Op)
+ v.AddArg(x)
+ v.AddArg(flagArg(bool))
return true
}
return false
return true
}
}
+func rewriteValueARM64_OpCondSelect_0(v *Value) bool {
+ b := v.Block
+ _ = b
+ // match: (CondSelect x y bool)
+ // cond: flagArg(bool) != nil
+ // result: (CSEL {bool.Op} x y flagArg(bool))
+ for {
+ _ = v.Args[2]
+ x := v.Args[0]
+ y := v.Args[1]
+ bool := v.Args[2]
+ if !(flagArg(bool) != nil) {
+ break
+ }
+ v.reset(OpARM64CSEL)
+ v.Aux = bool.Op
+ v.AddArg(x)
+ v.AddArg(y)
+ v.AddArg(flagArg(bool))
+ return true
+ }
+ // match: (CondSelect x y bool)
+ // cond: flagArg(bool) == nil
+ // result: (CSEL {OpARM64NotEqual} x y (CMPWconst [0] bool))
+ for {
+ _ = v.Args[2]
+ x := v.Args[0]
+ y := v.Args[1]
+ bool := v.Args[2]
+ if !(flagArg(bool) == nil) {
+ break
+ }
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64NotEqual
+ v.AddArg(x)
+ v.AddArg(y)
+ v0 := b.NewValue0(v.Pos, OpARM64CMPWconst, types.TypeFlags)
+ v0.AuxInt = 0
+ v0.AddArg(bool)
+ v.AddArg(v0)
+ return true
+ }
+ return false
+}
func rewriteValueARM64_OpConst16_0(v *Value) bool {
// match: (Const16 [val])
// cond:
_ = typ
// match: (Lsh16x16 <t> x y)
// cond:
- // result: (CSELULT (SLL <t> x (ZeroExt16to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
+ // result: (CSEL {OpARM64LessThanU} (SLL <t> x (ZeroExt16to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
v0.AddArg(x)
v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
v1.AddArg(y)
v0.AddArg(v1)
v.AddArg(v0)
- v2 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v2 := b.NewValue0(v.Pos, OpConst64, t)
v2.AuxInt = 0
v.AddArg(v2)
v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Lsh16x32 <t> x y)
// cond:
- // result: (CSELULT (SLL <t> x (ZeroExt32to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
+ // result: (CSEL {OpARM64LessThanU} (SLL <t> x (ZeroExt32to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
v0.AddArg(x)
v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
v1.AddArg(y)
v0.AddArg(v1)
v.AddArg(v0)
- v2 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v2 := b.NewValue0(v.Pos, OpConst64, t)
v2.AuxInt = 0
v.AddArg(v2)
v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = b
// match: (Lsh16x64 <t> x y)
// cond:
- // result: (CSELULT (SLL <t> x y) (MOVDconst <t> [0]) (CMPconst [64] y))
+ // result: (CSEL {OpARM64LessThanU} (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] y))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
v0.AddArg(x)
v0.AddArg(y)
v.AddArg(v0)
- v1 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v1 := b.NewValue0(v.Pos, OpConst64, t)
v1.AuxInt = 0
v.AddArg(v1)
v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Lsh16x8 <t> x y)
// cond:
- // result: (CSELULT (SLL <t> x (ZeroExt8to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
+ // result: (CSEL {OpARM64LessThanU} (SLL <t> x (ZeroExt8to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
v0.AddArg(x)
v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
v1.AddArg(y)
v0.AddArg(v1)
v.AddArg(v0)
- v2 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v2 := b.NewValue0(v.Pos, OpConst64, t)
v2.AuxInt = 0
v.AddArg(v2)
v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Lsh32x16 <t> x y)
// cond:
- // result: (CSELULT (SLL <t> x (ZeroExt16to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
+ // result: (CSEL {OpARM64LessThanU} (SLL <t> x (ZeroExt16to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
v0.AddArg(x)
v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
v1.AddArg(y)
v0.AddArg(v1)
v.AddArg(v0)
- v2 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v2 := b.NewValue0(v.Pos, OpConst64, t)
v2.AuxInt = 0
v.AddArg(v2)
v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Lsh32x32 <t> x y)
// cond:
- // result: (CSELULT (SLL <t> x (ZeroExt32to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
+ // result: (CSEL {OpARM64LessThanU} (SLL <t> x (ZeroExt32to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
v0.AddArg(x)
v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
v1.AddArg(y)
v0.AddArg(v1)
v.AddArg(v0)
- v2 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v2 := b.NewValue0(v.Pos, OpConst64, t)
v2.AuxInt = 0
v.AddArg(v2)
v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = b
// match: (Lsh32x64 <t> x y)
// cond:
- // result: (CSELULT (SLL <t> x y) (MOVDconst <t> [0]) (CMPconst [64] y))
+ // result: (CSEL {OpARM64LessThanU} (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] y))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
v0.AddArg(x)
v0.AddArg(y)
v.AddArg(v0)
- v1 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v1 := b.NewValue0(v.Pos, OpConst64, t)
v1.AuxInt = 0
v.AddArg(v1)
v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Lsh32x8 <t> x y)
// cond:
- // result: (CSELULT (SLL <t> x (ZeroExt8to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
+ // result: (CSEL {OpARM64LessThanU} (SLL <t> x (ZeroExt8to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
v0.AddArg(x)
v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
v1.AddArg(y)
v0.AddArg(v1)
v.AddArg(v0)
- v2 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v2 := b.NewValue0(v.Pos, OpConst64, t)
v2.AuxInt = 0
v.AddArg(v2)
v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Lsh64x16 <t> x y)
// cond:
- // result: (CSELULT (SLL <t> x (ZeroExt16to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
+ // result: (CSEL {OpARM64LessThanU} (SLL <t> x (ZeroExt16to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
v0.AddArg(x)
v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
v1.AddArg(y)
v0.AddArg(v1)
v.AddArg(v0)
- v2 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v2 := b.NewValue0(v.Pos, OpConst64, t)
v2.AuxInt = 0
v.AddArg(v2)
v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Lsh64x32 <t> x y)
// cond:
- // result: (CSELULT (SLL <t> x (ZeroExt32to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
+ // result: (CSEL {OpARM64LessThanU} (SLL <t> x (ZeroExt32to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
v0.AddArg(x)
v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
v1.AddArg(y)
v0.AddArg(v1)
v.AddArg(v0)
- v2 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v2 := b.NewValue0(v.Pos, OpConst64, t)
v2.AuxInt = 0
v.AddArg(v2)
v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = b
// match: (Lsh64x64 <t> x y)
// cond:
- // result: (CSELULT (SLL <t> x y) (MOVDconst <t> [0]) (CMPconst [64] y))
+ // result: (CSEL {OpARM64LessThanU} (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] y))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
v0.AddArg(x)
v0.AddArg(y)
v.AddArg(v0)
- v1 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v1 := b.NewValue0(v.Pos, OpConst64, t)
v1.AuxInt = 0
v.AddArg(v1)
v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Lsh64x8 <t> x y)
// cond:
- // result: (CSELULT (SLL <t> x (ZeroExt8to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
+ // result: (CSEL {OpARM64LessThanU} (SLL <t> x (ZeroExt8to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
v0.AddArg(x)
v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
v1.AddArg(y)
v0.AddArg(v1)
v.AddArg(v0)
- v2 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v2 := b.NewValue0(v.Pos, OpConst64, t)
v2.AuxInt = 0
v.AddArg(v2)
v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Lsh8x16 <t> x y)
// cond:
- // result: (CSELULT (SLL <t> x (ZeroExt16to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
+ // result: (CSEL {OpARM64LessThanU} (SLL <t> x (ZeroExt16to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
v0.AddArg(x)
v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
v1.AddArg(y)
v0.AddArg(v1)
v.AddArg(v0)
- v2 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v2 := b.NewValue0(v.Pos, OpConst64, t)
v2.AuxInt = 0
v.AddArg(v2)
v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Lsh8x32 <t> x y)
// cond:
- // result: (CSELULT (SLL <t> x (ZeroExt32to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
+ // result: (CSEL {OpARM64LessThanU} (SLL <t> x (ZeroExt32to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
v0.AddArg(x)
v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
v1.AddArg(y)
v0.AddArg(v1)
v.AddArg(v0)
- v2 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v2 := b.NewValue0(v.Pos, OpConst64, t)
v2.AuxInt = 0
v.AddArg(v2)
v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = b
// match: (Lsh8x64 <t> x y)
// cond:
- // result: (CSELULT (SLL <t> x y) (MOVDconst <t> [0]) (CMPconst [64] y))
+ // result: (CSEL {OpARM64LessThanU} (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] y))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
v0.AddArg(x)
v0.AddArg(y)
v.AddArg(v0)
- v1 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v1 := b.NewValue0(v.Pos, OpConst64, t)
v1.AuxInt = 0
v.AddArg(v1)
v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Lsh8x8 <t> x y)
// cond:
- // result: (CSELULT (SLL <t> x (ZeroExt8to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
+ // result: (CSEL {OpARM64LessThanU} (SLL <t> x (ZeroExt8to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
v0.AddArg(x)
v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
v1.AddArg(y)
v0.AddArg(v1)
v.AddArg(v0)
- v2 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v2 := b.NewValue0(v.Pos, OpConst64, t)
v2.AuxInt = 0
v.AddArg(v2)
v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh16Ux16 <t> x y)
// cond:
- // result: (CSELULT (SRL <t> (ZeroExt16to64 x) (ZeroExt16to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
+ // result: (CSEL {OpARM64LessThanU} (SRL <t> (ZeroExt16to64 x) (ZeroExt16to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
v1.AddArg(x)
v2.AddArg(y)
v0.AddArg(v2)
v.AddArg(v0)
- v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v3 := b.NewValue0(v.Pos, OpConst64, t)
v3.AuxInt = 0
v.AddArg(v3)
v4 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh16Ux32 <t> x y)
// cond:
- // result: (CSELULT (SRL <t> (ZeroExt16to64 x) (ZeroExt32to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
+ // result: (CSEL {OpARM64LessThanU} (SRL <t> (ZeroExt16to64 x) (ZeroExt32to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
v1.AddArg(x)
v2.AddArg(y)
v0.AddArg(v2)
v.AddArg(v0)
- v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v3 := b.NewValue0(v.Pos, OpConst64, t)
v3.AuxInt = 0
v.AddArg(v3)
v4 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh16Ux64 <t> x y)
// cond:
- // result: (CSELULT (SRL <t> (ZeroExt16to64 x) y) (MOVDconst <t> [0]) (CMPconst [64] y))
+ // result: (CSEL {OpARM64LessThanU} (SRL <t> (ZeroExt16to64 x) y) (Const64 <t> [0]) (CMPconst [64] y))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
v1.AddArg(x)
v0.AddArg(v1)
v0.AddArg(y)
v.AddArg(v0)
- v2 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v2 := b.NewValue0(v.Pos, OpConst64, t)
v2.AuxInt = 0
v.AddArg(v2)
v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh16Ux8 <t> x y)
// cond:
- // result: (CSELULT (SRL <t> (ZeroExt16to64 x) (ZeroExt8to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
+ // result: (CSEL {OpARM64LessThanU} (SRL <t> (ZeroExt16to64 x) (ZeroExt8to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
v1.AddArg(x)
v2.AddArg(y)
v0.AddArg(v2)
v.AddArg(v0)
- v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v3 := b.NewValue0(v.Pos, OpConst64, t)
v3.AuxInt = 0
v.AddArg(v3)
v4 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh16x16 x y)
// cond:
- // result: (SRA (SignExt16to64 x) (CSELULT <y.Type> (ZeroExt16to64 y) (MOVDconst <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
+ // result: (SRA (SignExt16to64 x) (CSEL {OpARM64LessThanU} <y.Type> (ZeroExt16to64 y) (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
for {
_ = v.Args[1]
x := v.Args[0]
v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
v0.AddArg(x)
v.AddArg(v0)
- v1 := b.NewValue0(v.Pos, OpARM64CSELULT, y.Type)
+ v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
+ v1.Aux = OpARM64LessThanU
v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
v2.AddArg(y)
v1.AddArg(v2)
- v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, y.Type)
+ v3 := b.NewValue0(v.Pos, OpConst64, y.Type)
v3.AuxInt = 63
v1.AddArg(v3)
v4 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh16x32 x y)
// cond:
- // result: (SRA (SignExt16to64 x) (CSELULT <y.Type> (ZeroExt32to64 y) (MOVDconst <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
+ // result: (SRA (SignExt16to64 x) (CSEL {OpARM64LessThanU} <y.Type> (ZeroExt32to64 y) (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
for {
_ = v.Args[1]
x := v.Args[0]
v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
v0.AddArg(x)
v.AddArg(v0)
- v1 := b.NewValue0(v.Pos, OpARM64CSELULT, y.Type)
+ v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
+ v1.Aux = OpARM64LessThanU
v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
v2.AddArg(y)
v1.AddArg(v2)
- v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, y.Type)
+ v3 := b.NewValue0(v.Pos, OpConst64, y.Type)
v3.AuxInt = 63
v1.AddArg(v3)
v4 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh16x64 x y)
// cond:
- // result: (SRA (SignExt16to64 x) (CSELULT <y.Type> y (MOVDconst <y.Type> [63]) (CMPconst [64] y)))
+ // result: (SRA (SignExt16to64 x) (CSEL {OpARM64LessThanU} <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] y)))
for {
_ = v.Args[1]
x := v.Args[0]
v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
v0.AddArg(x)
v.AddArg(v0)
- v1 := b.NewValue0(v.Pos, OpARM64CSELULT, y.Type)
+ v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
+ v1.Aux = OpARM64LessThanU
v1.AddArg(y)
- v2 := b.NewValue0(v.Pos, OpARM64MOVDconst, y.Type)
+ v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
v2.AuxInt = 63
v1.AddArg(v2)
v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh16x8 x y)
// cond:
- // result: (SRA (SignExt16to64 x) (CSELULT <y.Type> (ZeroExt8to64 y) (MOVDconst <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
+ // result: (SRA (SignExt16to64 x) (CSEL {OpARM64LessThanU} <y.Type> (ZeroExt8to64 y) (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
for {
_ = v.Args[1]
x := v.Args[0]
v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
v0.AddArg(x)
v.AddArg(v0)
- v1 := b.NewValue0(v.Pos, OpARM64CSELULT, y.Type)
+ v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
+ v1.Aux = OpARM64LessThanU
v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
v2.AddArg(y)
v1.AddArg(v2)
- v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, y.Type)
+ v3 := b.NewValue0(v.Pos, OpConst64, y.Type)
v3.AuxInt = 63
v1.AddArg(v3)
v4 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh32Ux16 <t> x y)
// cond:
- // result: (CSELULT (SRL <t> (ZeroExt32to64 x) (ZeroExt16to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
+ // result: (CSEL {OpARM64LessThanU} (SRL <t> (ZeroExt32to64 x) (ZeroExt16to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
v1.AddArg(x)
v2.AddArg(y)
v0.AddArg(v2)
v.AddArg(v0)
- v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v3 := b.NewValue0(v.Pos, OpConst64, t)
v3.AuxInt = 0
v.AddArg(v3)
v4 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh32Ux32 <t> x y)
// cond:
- // result: (CSELULT (SRL <t> (ZeroExt32to64 x) (ZeroExt32to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
+ // result: (CSEL {OpARM64LessThanU} (SRL <t> (ZeroExt32to64 x) (ZeroExt32to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
v1.AddArg(x)
v2.AddArg(y)
v0.AddArg(v2)
v.AddArg(v0)
- v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v3 := b.NewValue0(v.Pos, OpConst64, t)
v3.AuxInt = 0
v.AddArg(v3)
v4 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh32Ux64 <t> x y)
// cond:
- // result: (CSELULT (SRL <t> (ZeroExt32to64 x) y) (MOVDconst <t> [0]) (CMPconst [64] y))
+ // result: (CSEL {OpARM64LessThanU} (SRL <t> (ZeroExt32to64 x) y) (Const64 <t> [0]) (CMPconst [64] y))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
v1.AddArg(x)
v0.AddArg(v1)
v0.AddArg(y)
v.AddArg(v0)
- v2 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v2 := b.NewValue0(v.Pos, OpConst64, t)
v2.AuxInt = 0
v.AddArg(v2)
v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh32Ux8 <t> x y)
// cond:
- // result: (CSELULT (SRL <t> (ZeroExt32to64 x) (ZeroExt8to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
+ // result: (CSEL {OpARM64LessThanU} (SRL <t> (ZeroExt32to64 x) (ZeroExt8to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
v1.AddArg(x)
v2.AddArg(y)
v0.AddArg(v2)
v.AddArg(v0)
- v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v3 := b.NewValue0(v.Pos, OpConst64, t)
v3.AuxInt = 0
v.AddArg(v3)
v4 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh32x16 x y)
// cond:
- // result: (SRA (SignExt32to64 x) (CSELULT <y.Type> (ZeroExt16to64 y) (MOVDconst <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
+ // result: (SRA (SignExt32to64 x) (CSEL {OpARM64LessThanU} <y.Type> (ZeroExt16to64 y) (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
for {
_ = v.Args[1]
x := v.Args[0]
v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
v0.AddArg(x)
v.AddArg(v0)
- v1 := b.NewValue0(v.Pos, OpARM64CSELULT, y.Type)
+ v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
+ v1.Aux = OpARM64LessThanU
v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
v2.AddArg(y)
v1.AddArg(v2)
- v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, y.Type)
+ v3 := b.NewValue0(v.Pos, OpConst64, y.Type)
v3.AuxInt = 63
v1.AddArg(v3)
v4 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh32x32 x y)
// cond:
- // result: (SRA (SignExt32to64 x) (CSELULT <y.Type> (ZeroExt32to64 y) (MOVDconst <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
+ // result: (SRA (SignExt32to64 x) (CSEL {OpARM64LessThanU} <y.Type> (ZeroExt32to64 y) (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
for {
_ = v.Args[1]
x := v.Args[0]
v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
v0.AddArg(x)
v.AddArg(v0)
- v1 := b.NewValue0(v.Pos, OpARM64CSELULT, y.Type)
+ v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
+ v1.Aux = OpARM64LessThanU
v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
v2.AddArg(y)
v1.AddArg(v2)
- v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, y.Type)
+ v3 := b.NewValue0(v.Pos, OpConst64, y.Type)
v3.AuxInt = 63
v1.AddArg(v3)
v4 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh32x64 x y)
// cond:
- // result: (SRA (SignExt32to64 x) (CSELULT <y.Type> y (MOVDconst <y.Type> [63]) (CMPconst [64] y)))
+ // result: (SRA (SignExt32to64 x) (CSEL {OpARM64LessThanU} <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] y)))
for {
_ = v.Args[1]
x := v.Args[0]
v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
v0.AddArg(x)
v.AddArg(v0)
- v1 := b.NewValue0(v.Pos, OpARM64CSELULT, y.Type)
+ v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
+ v1.Aux = OpARM64LessThanU
v1.AddArg(y)
- v2 := b.NewValue0(v.Pos, OpARM64MOVDconst, y.Type)
+ v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
v2.AuxInt = 63
v1.AddArg(v2)
v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh32x8 x y)
// cond:
- // result: (SRA (SignExt32to64 x) (CSELULT <y.Type> (ZeroExt8to64 y) (MOVDconst <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
+ // result: (SRA (SignExt32to64 x) (CSEL {OpARM64LessThanU} <y.Type> (ZeroExt8to64 y) (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
for {
_ = v.Args[1]
x := v.Args[0]
v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
v0.AddArg(x)
v.AddArg(v0)
- v1 := b.NewValue0(v.Pos, OpARM64CSELULT, y.Type)
+ v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
+ v1.Aux = OpARM64LessThanU
v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
v2.AddArg(y)
v1.AddArg(v2)
- v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, y.Type)
+ v3 := b.NewValue0(v.Pos, OpConst64, y.Type)
v3.AuxInt = 63
v1.AddArg(v3)
v4 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh64Ux16 <t> x y)
// cond:
- // result: (CSELULT (SRL <t> x (ZeroExt16to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
+ // result: (CSEL {OpARM64LessThanU} (SRL <t> x (ZeroExt16to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
v0.AddArg(x)
v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
v1.AddArg(y)
v0.AddArg(v1)
v.AddArg(v0)
- v2 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v2 := b.NewValue0(v.Pos, OpConst64, t)
v2.AuxInt = 0
v.AddArg(v2)
v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh64Ux32 <t> x y)
// cond:
- // result: (CSELULT (SRL <t> x (ZeroExt32to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
+ // result: (CSEL {OpARM64LessThanU} (SRL <t> x (ZeroExt32to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
v0.AddArg(x)
v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
v1.AddArg(y)
v0.AddArg(v1)
v.AddArg(v0)
- v2 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v2 := b.NewValue0(v.Pos, OpConst64, t)
v2.AuxInt = 0
v.AddArg(v2)
v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = b
// match: (Rsh64Ux64 <t> x y)
// cond:
- // result: (CSELULT (SRL <t> x y) (MOVDconst <t> [0]) (CMPconst [64] y))
+ // result: (CSEL {OpARM64LessThanU} (SRL <t> x y) (Const64 <t> [0]) (CMPconst [64] y))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
v0.AddArg(x)
v0.AddArg(y)
v.AddArg(v0)
- v1 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v1 := b.NewValue0(v.Pos, OpConst64, t)
v1.AuxInt = 0
v.AddArg(v1)
v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh64Ux8 <t> x y)
// cond:
- // result: (CSELULT (SRL <t> x (ZeroExt8to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
+ // result: (CSEL {OpARM64LessThanU} (SRL <t> x (ZeroExt8to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
v0.AddArg(x)
v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
v1.AddArg(y)
v0.AddArg(v1)
v.AddArg(v0)
- v2 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v2 := b.NewValue0(v.Pos, OpConst64, t)
v2.AuxInt = 0
v.AddArg(v2)
v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh64x16 x y)
// cond:
- // result: (SRA x (CSELULT <y.Type> (ZeroExt16to64 y) (MOVDconst <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
+ // result: (SRA x (CSEL {OpARM64LessThanU} <y.Type> (ZeroExt16to64 y) (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
for {
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
v.reset(OpARM64SRA)
v.AddArg(x)
- v0 := b.NewValue0(v.Pos, OpARM64CSELULT, y.Type)
+ v0 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
+ v0.Aux = OpARM64LessThanU
v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
v1.AddArg(y)
v0.AddArg(v1)
- v2 := b.NewValue0(v.Pos, OpARM64MOVDconst, y.Type)
+ v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
v2.AuxInt = 63
v0.AddArg(v2)
v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh64x32 x y)
// cond:
- // result: (SRA x (CSELULT <y.Type> (ZeroExt32to64 y) (MOVDconst <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
+ // result: (SRA x (CSEL {OpARM64LessThanU} <y.Type> (ZeroExt32to64 y) (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
for {
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
v.reset(OpARM64SRA)
v.AddArg(x)
- v0 := b.NewValue0(v.Pos, OpARM64CSELULT, y.Type)
+ v0 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
+ v0.Aux = OpARM64LessThanU
v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
v1.AddArg(y)
v0.AddArg(v1)
- v2 := b.NewValue0(v.Pos, OpARM64MOVDconst, y.Type)
+ v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
v2.AuxInt = 63
v0.AddArg(v2)
v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = b
// match: (Rsh64x64 x y)
// cond:
- // result: (SRA x (CSELULT <y.Type> y (MOVDconst <y.Type> [63]) (CMPconst [64] y)))
+ // result: (SRA x (CSEL {OpARM64LessThanU} <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] y)))
for {
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
v.reset(OpARM64SRA)
v.AddArg(x)
- v0 := b.NewValue0(v.Pos, OpARM64CSELULT, y.Type)
+ v0 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
+ v0.Aux = OpARM64LessThanU
v0.AddArg(y)
- v1 := b.NewValue0(v.Pos, OpARM64MOVDconst, y.Type)
+ v1 := b.NewValue0(v.Pos, OpConst64, y.Type)
v1.AuxInt = 63
v0.AddArg(v1)
v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh64x8 x y)
// cond:
- // result: (SRA x (CSELULT <y.Type> (ZeroExt8to64 y) (MOVDconst <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
+ // result: (SRA x (CSEL {OpARM64LessThanU} <y.Type> (ZeroExt8to64 y) (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
for {
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
v.reset(OpARM64SRA)
v.AddArg(x)
- v0 := b.NewValue0(v.Pos, OpARM64CSELULT, y.Type)
+ v0 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
+ v0.Aux = OpARM64LessThanU
v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
v1.AddArg(y)
v0.AddArg(v1)
- v2 := b.NewValue0(v.Pos, OpARM64MOVDconst, y.Type)
+ v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
v2.AuxInt = 63
v0.AddArg(v2)
v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh8Ux16 <t> x y)
// cond:
- // result: (CSELULT (SRL <t> (ZeroExt8to64 x) (ZeroExt16to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
+ // result: (CSEL {OpARM64LessThanU} (SRL <t> (ZeroExt8to64 x) (ZeroExt16to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
v1.AddArg(x)
v2.AddArg(y)
v0.AddArg(v2)
v.AddArg(v0)
- v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v3 := b.NewValue0(v.Pos, OpConst64, t)
v3.AuxInt = 0
v.AddArg(v3)
v4 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh8Ux32 <t> x y)
// cond:
- // result: (CSELULT (SRL <t> (ZeroExt8to64 x) (ZeroExt32to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
+ // result: (CSEL {OpARM64LessThanU} (SRL <t> (ZeroExt8to64 x) (ZeroExt32to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
v1.AddArg(x)
v2.AddArg(y)
v0.AddArg(v2)
v.AddArg(v0)
- v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v3 := b.NewValue0(v.Pos, OpConst64, t)
v3.AuxInt = 0
v.AddArg(v3)
v4 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh8Ux64 <t> x y)
// cond:
- // result: (CSELULT (SRL <t> (ZeroExt8to64 x) y) (MOVDconst <t> [0]) (CMPconst [64] y))
+ // result: (CSEL {OpARM64LessThanU} (SRL <t> (ZeroExt8to64 x) y) (Const64 <t> [0]) (CMPconst [64] y))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
v1.AddArg(x)
v0.AddArg(v1)
v0.AddArg(y)
v.AddArg(v0)
- v2 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v2 := b.NewValue0(v.Pos, OpConst64, t)
v2.AuxInt = 0
v.AddArg(v2)
v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh8Ux8 <t> x y)
// cond:
- // result: (CSELULT (SRL <t> (ZeroExt8to64 x) (ZeroExt8to64 y)) (MOVDconst <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
+ // result: (CSEL {OpARM64LessThanU} (SRL <t> (ZeroExt8to64 x) (ZeroExt8to64 y)) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
for {
t := v.Type
_ = v.Args[1]
x := v.Args[0]
y := v.Args[1]
- v.reset(OpARM64CSELULT)
+ v.reset(OpARM64CSEL)
+ v.Aux = OpARM64LessThanU
v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
v1.AddArg(x)
v2.AddArg(y)
v0.AddArg(v2)
v.AddArg(v0)
- v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, t)
+ v3 := b.NewValue0(v.Pos, OpConst64, t)
v3.AuxInt = 0
v.AddArg(v3)
v4 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh8x16 x y)
// cond:
- // result: (SRA (SignExt8to64 x) (CSELULT <y.Type> (ZeroExt16to64 y) (MOVDconst <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
+ // result: (SRA (SignExt8to64 x) (CSEL {OpARM64LessThanU} <y.Type> (ZeroExt16to64 y) (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
for {
_ = v.Args[1]
x := v.Args[0]
v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
v0.AddArg(x)
v.AddArg(v0)
- v1 := b.NewValue0(v.Pos, OpARM64CSELULT, y.Type)
+ v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
+ v1.Aux = OpARM64LessThanU
v2 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
v2.AddArg(y)
v1.AddArg(v2)
- v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, y.Type)
+ v3 := b.NewValue0(v.Pos, OpConst64, y.Type)
v3.AuxInt = 63
v1.AddArg(v3)
v4 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh8x32 x y)
// cond:
- // result: (SRA (SignExt8to64 x) (CSELULT <y.Type> (ZeroExt32to64 y) (MOVDconst <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
+ // result: (SRA (SignExt8to64 x) (CSEL {OpARM64LessThanU} <y.Type> (ZeroExt32to64 y) (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
for {
_ = v.Args[1]
x := v.Args[0]
v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
v0.AddArg(x)
v.AddArg(v0)
- v1 := b.NewValue0(v.Pos, OpARM64CSELULT, y.Type)
+ v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
+ v1.Aux = OpARM64LessThanU
v2 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
v2.AddArg(y)
v1.AddArg(v2)
- v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, y.Type)
+ v3 := b.NewValue0(v.Pos, OpConst64, y.Type)
v3.AuxInt = 63
v1.AddArg(v3)
v4 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh8x64 x y)
// cond:
- // result: (SRA (SignExt8to64 x) (CSELULT <y.Type> y (MOVDconst <y.Type> [63]) (CMPconst [64] y)))
+ // result: (SRA (SignExt8to64 x) (CSEL {OpARM64LessThanU} <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] y)))
for {
_ = v.Args[1]
x := v.Args[0]
v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
v0.AddArg(x)
v.AddArg(v0)
- v1 := b.NewValue0(v.Pos, OpARM64CSELULT, y.Type)
+ v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
+ v1.Aux = OpARM64LessThanU
v1.AddArg(y)
- v2 := b.NewValue0(v.Pos, OpARM64MOVDconst, y.Type)
+ v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
v2.AuxInt = 63
v1.AddArg(v2)
v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
_ = typ
// match: (Rsh8x8 x y)
// cond:
- // result: (SRA (SignExt8to64 x) (CSELULT <y.Type> (ZeroExt8to64 y) (MOVDconst <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
+ // result: (SRA (SignExt8to64 x) (CSEL {OpARM64LessThanU} <y.Type> (ZeroExt8to64 y) (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
for {
_ = v.Args[1]
x := v.Args[0]
v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
v0.AddArg(x)
v.AddArg(v0)
- v1 := b.NewValue0(v.Pos, OpARM64CSELULT, y.Type)
+ v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
+ v1.Aux = OpARM64LessThanU
v2 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
v2.AddArg(y)
v1.AddArg(v2)
- v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, y.Type)
+ v3 := b.NewValue0(v.Pos, OpConst64, y.Type)
v3.AuxInt = 63
v1.AddArg(v3)
v4 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)