(Trunc32to8 ...) => (Copy ...)
(Trunc32to16 ...) => (Copy ...)
-// Lowering float <-> int
+// Lowering float-int conversions
(Cvt32to32F ...) => (CVTSL2SS ...)
(Cvt32to64F ...) => (CVTSL2SD ...)
(CMPBconst (MOVLconst [x]) [y]) && int8(x)>y && uint8(x)>uint8(y) => (FlagGT_UGT)
// Other known comparisons.
-(CMPLconst (SHRLconst _ [c]) [n]) && 0 <= n && 0 < c && c <= 32 && (1<<uint64(32-c)) <= uint64(n) -> (FlagLT_ULT)
-(CMPLconst (ANDLconst _ [m]) [n]) && 0 <= int32(m) && int32(m) < int32(n) -> (FlagLT_ULT)
-(CMPWconst (ANDLconst _ [m]) [n]) && 0 <= int16(m) && int16(m) < int16(n) -> (FlagLT_ULT)
-(CMPBconst (ANDLconst _ [m]) [n]) && 0 <= int8(m) && int8(m) < int8(n) -> (FlagLT_ULT)
+(CMPLconst (SHRLconst _ [c]) [n]) && 0 <= n && 0 < c && c <= 32 && (1<<uint64(32-c)) <= uint64(n) => (FlagLT_ULT)
+(CMPLconst (ANDLconst _ [m]) [n]) && 0 <= m && m < n => (FlagLT_ULT)
+(CMPWconst (ANDLconst _ [m]) [n]) && 0 <= int16(m) && int16(m) < n => (FlagLT_ULT)
+(CMPBconst (ANDLconst _ [m]) [n]) && 0 <= int8(m) && int8(m) < n => (FlagLT_ULT)
// TODO: DIVxU also.
// Absorb flag constants into SBB ops.
-(SBBLcarrymask (FlagEQ)) -> (MOVLconst [0])
-(SBBLcarrymask (FlagLT_ULT)) -> (MOVLconst [-1])
-(SBBLcarrymask (FlagLT_UGT)) -> (MOVLconst [0])
-(SBBLcarrymask (FlagGT_ULT)) -> (MOVLconst [-1])
-(SBBLcarrymask (FlagGT_UGT)) -> (MOVLconst [0])
+(SBBLcarrymask (FlagEQ)) => (MOVLconst [0])
+(SBBLcarrymask (FlagLT_ULT)) => (MOVLconst [-1])
+(SBBLcarrymask (FlagLT_UGT)) => (MOVLconst [0])
+(SBBLcarrymask (FlagGT_ULT)) => (MOVLconst [-1])
+(SBBLcarrymask (FlagGT_UGT)) => (MOVLconst [0])
// Absorb flag constants into branches.
-(EQ (FlagEQ) yes no) -> (First yes no)
-(EQ (FlagLT_ULT) yes no) -> (First no yes)
-(EQ (FlagLT_UGT) yes no) -> (First no yes)
-(EQ (FlagGT_ULT) yes no) -> (First no yes)
-(EQ (FlagGT_UGT) yes no) -> (First no yes)
-
-(NE (FlagEQ) yes no) -> (First no yes)
-(NE (FlagLT_ULT) yes no) -> (First yes no)
-(NE (FlagLT_UGT) yes no) -> (First yes no)
-(NE (FlagGT_ULT) yes no) -> (First yes no)
-(NE (FlagGT_UGT) yes no) -> (First yes no)
-
-(LT (FlagEQ) yes no) -> (First no yes)
-(LT (FlagLT_ULT) yes no) -> (First yes no)
-(LT (FlagLT_UGT) yes no) -> (First yes no)
-(LT (FlagGT_ULT) yes no) -> (First no yes)
-(LT (FlagGT_UGT) yes no) -> (First no yes)
-
-(LE (FlagEQ) yes no) -> (First yes no)
-(LE (FlagLT_ULT) yes no) -> (First yes no)
-(LE (FlagLT_UGT) yes no) -> (First yes no)
-(LE (FlagGT_ULT) yes no) -> (First no yes)
-(LE (FlagGT_UGT) yes no) -> (First no yes)
-
-(GT (FlagEQ) yes no) -> (First no yes)
-(GT (FlagLT_ULT) yes no) -> (First no yes)
-(GT (FlagLT_UGT) yes no) -> (First no yes)
-(GT (FlagGT_ULT) yes no) -> (First yes no)
-(GT (FlagGT_UGT) yes no) -> (First yes no)
-
-(GE (FlagEQ) yes no) -> (First yes no)
-(GE (FlagLT_ULT) yes no) -> (First no yes)
-(GE (FlagLT_UGT) yes no) -> (First no yes)
-(GE (FlagGT_ULT) yes no) -> (First yes no)
-(GE (FlagGT_UGT) yes no) -> (First yes no)
-
-(ULT (FlagEQ) yes no) -> (First no yes)
-(ULT (FlagLT_ULT) yes no) -> (First yes no)
-(ULT (FlagLT_UGT) yes no) -> (First no yes)
-(ULT (FlagGT_ULT) yes no) -> (First yes no)
-(ULT (FlagGT_UGT) yes no) -> (First no yes)
-
-(ULE (FlagEQ) yes no) -> (First yes no)
-(ULE (FlagLT_ULT) yes no) -> (First yes no)
-(ULE (FlagLT_UGT) yes no) -> (First no yes)
-(ULE (FlagGT_ULT) yes no) -> (First yes no)
-(ULE (FlagGT_UGT) yes no) -> (First no yes)
-
-(UGT (FlagEQ) yes no) -> (First no yes)
-(UGT (FlagLT_ULT) yes no) -> (First no yes)
-(UGT (FlagLT_UGT) yes no) -> (First yes no)
-(UGT (FlagGT_ULT) yes no) -> (First no yes)
-(UGT (FlagGT_UGT) yes no) -> (First yes no)
-
-(UGE (FlagEQ) yes no) -> (First yes no)
-(UGE (FlagLT_ULT) yes no) -> (First no yes)
-(UGE (FlagLT_UGT) yes no) -> (First yes no)
-(UGE (FlagGT_ULT) yes no) -> (First no yes)
-(UGE (FlagGT_UGT) yes no) -> (First yes no)
+(EQ (FlagEQ) yes no) => (First yes no)
+(EQ (FlagLT_ULT) yes no) => (First no yes)
+(EQ (FlagLT_UGT) yes no) => (First no yes)
+(EQ (FlagGT_ULT) yes no) => (First no yes)
+(EQ (FlagGT_UGT) yes no) => (First no yes)
+
+(NE (FlagEQ) yes no) => (First no yes)
+(NE (FlagLT_ULT) yes no) => (First yes no)
+(NE (FlagLT_UGT) yes no) => (First yes no)
+(NE (FlagGT_ULT) yes no) => (First yes no)
+(NE (FlagGT_UGT) yes no) => (First yes no)
+
+(LT (FlagEQ) yes no) => (First no yes)
+(LT (FlagLT_ULT) yes no) => (First yes no)
+(LT (FlagLT_UGT) yes no) => (First yes no)
+(LT (FlagGT_ULT) yes no) => (First no yes)
+(LT (FlagGT_UGT) yes no) => (First no yes)
+
+(LE (FlagEQ) yes no) => (First yes no)
+(LE (FlagLT_ULT) yes no) => (First yes no)
+(LE (FlagLT_UGT) yes no) => (First yes no)
+(LE (FlagGT_ULT) yes no) => (First no yes)
+(LE (FlagGT_UGT) yes no) => (First no yes)
+
+(GT (FlagEQ) yes no) => (First no yes)
+(GT (FlagLT_ULT) yes no) => (First no yes)
+(GT (FlagLT_UGT) yes no) => (First no yes)
+(GT (FlagGT_ULT) yes no) => (First yes no)
+(GT (FlagGT_UGT) yes no) => (First yes no)
+
+(GE (FlagEQ) yes no) => (First yes no)
+(GE (FlagLT_ULT) yes no) => (First no yes)
+(GE (FlagLT_UGT) yes no) => (First no yes)
+(GE (FlagGT_ULT) yes no) => (First yes no)
+(GE (FlagGT_UGT) yes no) => (First yes no)
+
+(ULT (FlagEQ) yes no) => (First no yes)
+(ULT (FlagLT_ULT) yes no) => (First yes no)
+(ULT (FlagLT_UGT) yes no) => (First no yes)
+(ULT (FlagGT_ULT) yes no) => (First yes no)
+(ULT (FlagGT_UGT) yes no) => (First no yes)
+
+(ULE (FlagEQ) yes no) => (First yes no)
+(ULE (FlagLT_ULT) yes no) => (First yes no)
+(ULE (FlagLT_UGT) yes no) => (First no yes)
+(ULE (FlagGT_ULT) yes no) => (First yes no)
+(ULE (FlagGT_UGT) yes no) => (First no yes)
+
+(UGT (FlagEQ) yes no) => (First no yes)
+(UGT (FlagLT_ULT) yes no) => (First no yes)
+(UGT (FlagLT_UGT) yes no) => (First yes no)
+(UGT (FlagGT_ULT) yes no) => (First no yes)
+(UGT (FlagGT_UGT) yes no) => (First yes no)
+
+(UGE (FlagEQ) yes no) => (First yes no)
+(UGE (FlagLT_ULT) yes no) => (First no yes)
+(UGE (FlagLT_UGT) yes no) => (First yes no)
+(UGE (FlagGT_ULT) yes no) => (First no yes)
+(UGE (FlagGT_UGT) yes no) => (First yes no)
// Absorb flag constants into SETxx ops.
-(SETEQ (FlagEQ)) -> (MOVLconst [1])
-(SETEQ (FlagLT_ULT)) -> (MOVLconst [0])
-(SETEQ (FlagLT_UGT)) -> (MOVLconst [0])
-(SETEQ (FlagGT_ULT)) -> (MOVLconst [0])
-(SETEQ (FlagGT_UGT)) -> (MOVLconst [0])
-
-(SETNE (FlagEQ)) -> (MOVLconst [0])
-(SETNE (FlagLT_ULT)) -> (MOVLconst [1])
-(SETNE (FlagLT_UGT)) -> (MOVLconst [1])
-(SETNE (FlagGT_ULT)) -> (MOVLconst [1])
-(SETNE (FlagGT_UGT)) -> (MOVLconst [1])
-
-(SETL (FlagEQ)) -> (MOVLconst [0])
-(SETL (FlagLT_ULT)) -> (MOVLconst [1])
-(SETL (FlagLT_UGT)) -> (MOVLconst [1])
-(SETL (FlagGT_ULT)) -> (MOVLconst [0])
-(SETL (FlagGT_UGT)) -> (MOVLconst [0])
-
-(SETLE (FlagEQ)) -> (MOVLconst [1])
-(SETLE (FlagLT_ULT)) -> (MOVLconst [1])
-(SETLE (FlagLT_UGT)) -> (MOVLconst [1])
-(SETLE (FlagGT_ULT)) -> (MOVLconst [0])
-(SETLE (FlagGT_UGT)) -> (MOVLconst [0])
-
-(SETG (FlagEQ)) -> (MOVLconst [0])
-(SETG (FlagLT_ULT)) -> (MOVLconst [0])
-(SETG (FlagLT_UGT)) -> (MOVLconst [0])
-(SETG (FlagGT_ULT)) -> (MOVLconst [1])
-(SETG (FlagGT_UGT)) -> (MOVLconst [1])
-
-(SETGE (FlagEQ)) -> (MOVLconst [1])
-(SETGE (FlagLT_ULT)) -> (MOVLconst [0])
-(SETGE (FlagLT_UGT)) -> (MOVLconst [0])
-(SETGE (FlagGT_ULT)) -> (MOVLconst [1])
-(SETGE (FlagGT_UGT)) -> (MOVLconst [1])
-
-(SETB (FlagEQ)) -> (MOVLconst [0])
-(SETB (FlagLT_ULT)) -> (MOVLconst [1])
-(SETB (FlagLT_UGT)) -> (MOVLconst [0])
-(SETB (FlagGT_ULT)) -> (MOVLconst [1])
-(SETB (FlagGT_UGT)) -> (MOVLconst [0])
-
-(SETBE (FlagEQ)) -> (MOVLconst [1])
-(SETBE (FlagLT_ULT)) -> (MOVLconst [1])
-(SETBE (FlagLT_UGT)) -> (MOVLconst [0])
-(SETBE (FlagGT_ULT)) -> (MOVLconst [1])
-(SETBE (FlagGT_UGT)) -> (MOVLconst [0])
-
-(SETA (FlagEQ)) -> (MOVLconst [0])
-(SETA (FlagLT_ULT)) -> (MOVLconst [0])
-(SETA (FlagLT_UGT)) -> (MOVLconst [1])
-(SETA (FlagGT_ULT)) -> (MOVLconst [0])
-(SETA (FlagGT_UGT)) -> (MOVLconst [1])
-
-(SETAE (FlagEQ)) -> (MOVLconst [1])
-(SETAE (FlagLT_ULT)) -> (MOVLconst [0])
-(SETAE (FlagLT_UGT)) -> (MOVLconst [1])
-(SETAE (FlagGT_ULT)) -> (MOVLconst [0])
-(SETAE (FlagGT_UGT)) -> (MOVLconst [1])
+(SETEQ (FlagEQ)) => (MOVLconst [1])
+(SETEQ (FlagLT_ULT)) => (MOVLconst [0])
+(SETEQ (FlagLT_UGT)) => (MOVLconst [0])
+(SETEQ (FlagGT_ULT)) => (MOVLconst [0])
+(SETEQ (FlagGT_UGT)) => (MOVLconst [0])
+
+(SETNE (FlagEQ)) => (MOVLconst [0])
+(SETNE (FlagLT_ULT)) => (MOVLconst [1])
+(SETNE (FlagLT_UGT)) => (MOVLconst [1])
+(SETNE (FlagGT_ULT)) => (MOVLconst [1])
+(SETNE (FlagGT_UGT)) => (MOVLconst [1])
+
+(SETL (FlagEQ)) => (MOVLconst [0])
+(SETL (FlagLT_ULT)) => (MOVLconst [1])
+(SETL (FlagLT_UGT)) => (MOVLconst [1])
+(SETL (FlagGT_ULT)) => (MOVLconst [0])
+(SETL (FlagGT_UGT)) => (MOVLconst [0])
+
+(SETLE (FlagEQ)) => (MOVLconst [1])
+(SETLE (FlagLT_ULT)) => (MOVLconst [1])
+(SETLE (FlagLT_UGT)) => (MOVLconst [1])
+(SETLE (FlagGT_ULT)) => (MOVLconst [0])
+(SETLE (FlagGT_UGT)) => (MOVLconst [0])
+
+(SETG (FlagEQ)) => (MOVLconst [0])
+(SETG (FlagLT_ULT)) => (MOVLconst [0])
+(SETG (FlagLT_UGT)) => (MOVLconst [0])
+(SETG (FlagGT_ULT)) => (MOVLconst [1])
+(SETG (FlagGT_UGT)) => (MOVLconst [1])
+
+(SETGE (FlagEQ)) => (MOVLconst [1])
+(SETGE (FlagLT_ULT)) => (MOVLconst [0])
+(SETGE (FlagLT_UGT)) => (MOVLconst [0])
+(SETGE (FlagGT_ULT)) => (MOVLconst [1])
+(SETGE (FlagGT_UGT)) => (MOVLconst [1])
+
+(SETB (FlagEQ)) => (MOVLconst [0])
+(SETB (FlagLT_ULT)) => (MOVLconst [1])
+(SETB (FlagLT_UGT)) => (MOVLconst [0])
+(SETB (FlagGT_ULT)) => (MOVLconst [1])
+(SETB (FlagGT_UGT)) => (MOVLconst [0])
+
+(SETBE (FlagEQ)) => (MOVLconst [1])
+(SETBE (FlagLT_ULT)) => (MOVLconst [1])
+(SETBE (FlagLT_UGT)) => (MOVLconst [0])
+(SETBE (FlagGT_ULT)) => (MOVLconst [1])
+(SETBE (FlagGT_UGT)) => (MOVLconst [0])
+
+(SETA (FlagEQ)) => (MOVLconst [0])
+(SETA (FlagLT_ULT)) => (MOVLconst [0])
+(SETA (FlagLT_UGT)) => (MOVLconst [1])
+(SETA (FlagGT_ULT)) => (MOVLconst [0])
+(SETA (FlagGT_UGT)) => (MOVLconst [1])
+
+(SETAE (FlagEQ)) => (MOVLconst [1])
+(SETAE (FlagLT_ULT)) => (MOVLconst [0])
+(SETAE (FlagLT_UGT)) => (MOVLconst [1])
+(SETAE (FlagGT_ULT)) => (MOVLconst [0])
+(SETAE (FlagGT_UGT)) => (MOVLconst [1])
// Remove redundant *const ops
-(ADDLconst [c] x) && int32(c)==0 -> x
-(SUBLconst [c] x) && int32(c) == 0 -> x
-(ANDLconst [c] _) && int32(c)==0 -> (MOVLconst [0])
-(ANDLconst [c] x) && int32(c)==-1 -> x
-(ORLconst [c] x) && int32(c)==0 -> x
-(ORLconst [c] _) && int32(c)==-1 -> (MOVLconst [-1])
-(XORLconst [c] x) && int32(c)==0 -> x
+(ADDLconst [c] x) && c==0 => x
+(SUBLconst [c] x) && c==0 => x
+(ANDLconst [c] _) && c==0 => (MOVLconst [0])
+(ANDLconst [c] x) && c==-1 => x
+(ORLconst [c] x) && c==0 => x
+(ORLconst [c] _) && c==-1 => (MOVLconst [-1])
+(XORLconst [c] x) && c==0 => x
// TODO: since we got rid of the W/B versions, we might miss
// things like (ANDLconst [0x100] x) which were formerly
// (ANDBconst [0] x). Probably doesn't happen very often.
// If we cared, we might do:
-// (ANDLconst <t> [c] x) && t.Size()==1 && int8(x)==0 -> (MOVLconst [0])
+// (ANDLconst <t> [c] x) && t.Size()==1 && int8(x)==0 => (MOVLconst [0])
// Convert constant subtracts to constant adds
-(SUBLconst [c] x) -> (ADDLconst [int64(int32(-c))] x)
+(SUBLconst [c] x) => (ADDLconst [-c] x)
// generic constant folding
// TODO: more of this
-(ADDLconst [c] (MOVLconst [d])) -> (MOVLconst [int64(int32(c+d))])
-(ADDLconst [c] (ADDLconst [d] x)) -> (ADDLconst [int64(int32(c+d))] x)
-(SARLconst [c] (MOVLconst [d])) -> (MOVLconst [d>>uint64(c)])
-(SARWconst [c] (MOVLconst [d])) -> (MOVLconst [d>>uint64(c)])
-(SARBconst [c] (MOVLconst [d])) -> (MOVLconst [d>>uint64(c)])
-(NEGL (MOVLconst [c])) -> (MOVLconst [int64(int32(-c))])
-(MULLconst [c] (MOVLconst [d])) -> (MOVLconst [int64(int32(c*d))])
-(ANDLconst [c] (MOVLconst [d])) -> (MOVLconst [c&d])
-(ORLconst [c] (MOVLconst [d])) -> (MOVLconst [c|d])
-(XORLconst [c] (MOVLconst [d])) -> (MOVLconst [c^d])
-(NOTL (MOVLconst [c])) -> (MOVLconst [^c])
+(ADDLconst [c] (MOVLconst [d])) => (MOVLconst [c+d])
+(ADDLconst [c] (ADDLconst [d] x)) => (ADDLconst [c+d] x)
+(SARLconst [c] (MOVLconst [d])) => (MOVLconst [d>>uint64(c)])
+(SARWconst [c] (MOVLconst [d])) => (MOVLconst [d>>uint64(c)])
+(SARBconst [c] (MOVLconst [d])) => (MOVLconst [d>>uint64(c)])
+(NEGL (MOVLconst [c])) => (MOVLconst [-c])
+(MULLconst [c] (MOVLconst [d])) => (MOVLconst [c*d])
+(ANDLconst [c] (MOVLconst [d])) => (MOVLconst [c&d])
+(ORLconst [c] (MOVLconst [d])) => (MOVLconst [c|d])
+(XORLconst [c] (MOVLconst [d])) => (MOVLconst [c^d])
+(NOTL (MOVLconst [c])) => (MOVLconst [^c])
// generic simplifications
// TODO: more of this
-(ADDL x (NEGL y)) -> (SUBL x y)
-(SUBL x x) -> (MOVLconst [0])
-(ANDL x x) -> x
-(ORL x x) -> x
-(XORL x x) -> (MOVLconst [0])
+(ADDL x (NEGL y)) => (SUBL x y)
+(SUBL x x) => (MOVLconst [0])
+(ANDL x x) => x
+(ORL x x) => x
+(XORL x x) => (MOVLconst [0])
// checking AND against 0.
-(CMP(L|W|B)const l:(ANDL x y) [0]) && l.Uses==1 -> (TEST(L|W|B) x y)
-(CMPLconst l:(ANDLconst [c] x) [0]) && l.Uses==1 -> (TESTLconst [c] x)
-(CMPWconst l:(ANDLconst [c] x) [0]) && l.Uses==1 -> (TESTWconst [int64(int16(c))] x)
-(CMPBconst l:(ANDLconst [c] x) [0]) && l.Uses==1 -> (TESTBconst [int64(int8(c))] x)
+(CMP(L|W|B)const l:(ANDL x y) [0]) && l.Uses==1 => (TEST(L|W|B) x y)
+(CMPLconst l:(ANDLconst [c] x) [0]) && l.Uses==1 => (TESTLconst [c] x)
+(CMPWconst l:(ANDLconst [c] x) [0]) && l.Uses==1 => (TESTWconst [int16(c)] x)
+(CMPBconst l:(ANDLconst [c] x) [0]) && l.Uses==1 => (TESTBconst [int8(c)] x)
// TEST %reg,%reg is shorter than CMP
-(CMP(L|W|B)const x [0]) -> (TEST(L|W|B) x x)
+(CMP(L|W|B)const x [0]) => (TEST(L|W|B) x x)
// Convert LEAL1 back to ADDL if we can
-(LEAL1 [0] {nil} x y) -> (ADDL x y)
+(LEAL1 [0] {nil} x y) => (ADDL x y)
// Combining byte loads into larger (unaligned) loads.
// There are many ways these combinations could occur. This is
&& s0.Uses == 1
&& mergePoint(b,x0,x1) != nil
&& clobber(x0, x1, s0)
- -> @mergePoint(b,x0,x1) (MOVWload [i0] {s} p mem)
+ => @mergePoint(b,x0,x1) (MOVWload [i0] {s} p mem)
(ORL x0:(MOVBload [i] {s} p0 mem)
s0:(SHLLconst [8] x1:(MOVBload [i] {s} p1 mem)))
&& sequentialAddresses(p0, p1, 1)
&& mergePoint(b,x0,x1) != nil
&& clobber(x0, x1, s0)
- -> @mergePoint(b,x0,x1) (MOVWload [i] {s} p0 mem)
+ => @mergePoint(b,x0,x1) (MOVWload [i] {s} p0 mem)
(ORL o0:(ORL
x0:(MOVWload [i0] {s} p mem)
&& o0.Uses == 1
&& mergePoint(b,x0,x1,x2) != nil
&& clobber(x0, x1, x2, s0, s1, o0)
- -> @mergePoint(b,x0,x1,x2) (MOVLload [i0] {s} p mem)
+ => @mergePoint(b,x0,x1,x2) (MOVLload [i0] {s} p mem)
(ORL o0:(ORL
x0:(MOVWload [i] {s} p0 mem)
&& sequentialAddresses(p1, p2, 1)
&& mergePoint(b,x0,x1,x2) != nil
&& clobber(x0, x1, x2, s0, s1, o0)
- -> @mergePoint(b,x0,x1,x2) (MOVLload [i] {s} p0 mem)
+ => @mergePoint(b,x0,x1,x2) (MOVLload [i] {s} p0 mem)
// Combine constant stores into larger (unaligned) stores.
(MOVBstoreconst [c] {s} p x:(MOVBstoreconst [a] {s} p mem))
&& x.Uses == 1
- && ValAndOff(a).Off() + 1 == ValAndOff(c).Off()
+ && a.Off() + 1 == c.Off()
&& clobber(x)
- -> (MOVWstoreconst [makeValAndOff(ValAndOff(a).Val()&0xff | ValAndOff(c).Val()<<8, ValAndOff(a).Off())] {s} p mem)
+ => (MOVWstoreconst [makeValAndOff32(int32(a.Val()&0xff | c.Val()<<8), int32(a.Off()))] {s} p mem)
(MOVBstoreconst [a] {s} p x:(MOVBstoreconst [c] {s} p mem))
&& x.Uses == 1
- && ValAndOff(a).Off() + 1 == ValAndOff(c).Off()
+ && a.Off() + 1 == c.Off()
&& clobber(x)
- -> (MOVWstoreconst [makeValAndOff(ValAndOff(a).Val()&0xff | ValAndOff(c).Val()<<8, ValAndOff(a).Off())] {s} p mem)
+ => (MOVWstoreconst [makeValAndOff32(int32(a.Val()&0xff | c.Val()<<8), int32(a.Off()))] {s} p mem)
(MOVBstoreconst [c] {s} p1 x:(MOVBstoreconst [a] {s} p0 mem))
&& x.Uses == 1
- && ValAndOff(a).Off() == ValAndOff(c).Off()
+ && a.Off() == c.Off()
&& sequentialAddresses(p0, p1, 1)
&& clobber(x)
- -> (MOVWstoreconst [makeValAndOff(ValAndOff(a).Val()&0xff | ValAndOff(c).Val()<<8, ValAndOff(a).Off())] {s} p0 mem)
+ => (MOVWstoreconst [makeValAndOff32(int32(a.Val()&0xff | c.Val()<<8), int32(a.Off()))] {s} p0 mem)
(MOVBstoreconst [a] {s} p0 x:(MOVBstoreconst [c] {s} p1 mem))
&& x.Uses == 1
- && ValAndOff(a).Off() == ValAndOff(c).Off()
+ && a.Off() == c.Off()
&& sequentialAddresses(p0, p1, 1)
&& clobber(x)
- -> (MOVWstoreconst [makeValAndOff(ValAndOff(a).Val()&0xff | ValAndOff(c).Val()<<8, ValAndOff(a).Off())] {s} p0 mem)
+ => (MOVWstoreconst [makeValAndOff32(int32(a.Val()&0xff | c.Val()<<8), int32(a.Off()))] {s} p0 mem)
(MOVWstoreconst [c] {s} p x:(MOVWstoreconst [a] {s} p mem))
&& x.Uses == 1
- && ValAndOff(a).Off() + 2 == ValAndOff(c).Off()
+ && a.Off() + 2 == c.Off()
&& clobber(x)
- -> (MOVLstoreconst [makeValAndOff(ValAndOff(a).Val()&0xffff | ValAndOff(c).Val()<<16, ValAndOff(a).Off())] {s} p mem)
+ => (MOVLstoreconst [makeValAndOff32(int32(a.Val()&0xffff | c.Val()<<16), int32(a.Off()))] {s} p mem)
(MOVWstoreconst [a] {s} p x:(MOVWstoreconst [c] {s} p mem))
&& x.Uses == 1
&& ValAndOff(a).Off() + 2 == ValAndOff(c).Off()
&& clobber(x)
- -> (MOVLstoreconst [makeValAndOff(ValAndOff(a).Val()&0xffff | ValAndOff(c).Val()<<16, ValAndOff(a).Off())] {s} p mem)
+ => (MOVLstoreconst [makeValAndOff32(int32(a.Val()&0xffff | c.Val()<<16), int32(a.Off()))] {s} p mem)
(MOVWstoreconst [c] {s} p1 x:(MOVWstoreconst [a] {s} p0 mem))
&& x.Uses == 1
- && ValAndOff(a).Off() == ValAndOff(c).Off()
+ && a.Off() == c.Off()
&& sequentialAddresses(p0, p1, 2)
&& clobber(x)
- -> (MOVLstoreconst [makeValAndOff(ValAndOff(a).Val()&0xffff | ValAndOff(c).Val()<<16, ValAndOff(a).Off())] {s} p0 mem)
+ => (MOVLstoreconst [makeValAndOff32(int32(a.Val()&0xffff | c.Val()<<16), int32(a.Off()))] {s} p0 mem)
(MOVWstoreconst [a] {s} p0 x:(MOVWstoreconst [c] {s} p1 mem))
&& x.Uses == 1
- && ValAndOff(a).Off() == ValAndOff(c).Off()
+ && a.Off() == c.Off()
&& sequentialAddresses(p0, p1, 2)
&& clobber(x)
- -> (MOVLstoreconst [makeValAndOff(ValAndOff(a).Val()&0xffff | ValAndOff(c).Val()<<16, ValAndOff(a).Off())] {s} p0 mem)
+ => (MOVLstoreconst [makeValAndOff32(int32(a.Val()&0xffff | c.Val()<<16), int32(a.Off()))] {s} p0 mem)
// Combine stores into larger (unaligned) stores.
(MOVBstore [i] {s} p (SHR(W|L)const [8] w) x:(MOVBstore [i-1] {s} p w mem))
&& x.Uses == 1
&& clobber(x)
- -> (MOVWstore [i-1] {s} p w mem)
+ => (MOVWstore [i-1] {s} p w mem)
(MOVBstore [i] {s} p w x:(MOVBstore {s} [i+1] p (SHR(W|L)const [8] w) mem))
&& x.Uses == 1
&& clobber(x)
- -> (MOVWstore [i] {s} p w mem)
+ => (MOVWstore [i] {s} p w mem)
(MOVBstore [i] {s} p (SHRLconst [j] w) x:(MOVBstore [i-1] {s} p w0:(SHRLconst [j-8] w) mem))
&& x.Uses == 1
&& clobber(x)
- -> (MOVWstore [i-1] {s} p w0 mem)
+ => (MOVWstore [i-1] {s} p w0 mem)
(MOVBstore [i] {s} p1 (SHR(W|L)const [8] w) x:(MOVBstore [i] {s} p0 w mem))
&& x.Uses == 1
&& sequentialAddresses(p0, p1, 1)
&& clobber(x)
- -> (MOVWstore [i] {s} p0 w mem)
+ => (MOVWstore [i] {s} p0 w mem)
(MOVBstore [i] {s} p0 w x:(MOVBstore {s} [i] p1 (SHR(W|L)const [8] w) mem))
&& x.Uses == 1
&& sequentialAddresses(p0, p1, 1)
&& clobber(x)
- -> (MOVWstore [i] {s} p0 w mem)
+ => (MOVWstore [i] {s} p0 w mem)
(MOVBstore [i] {s} p1 (SHRLconst [j] w) x:(MOVBstore [i] {s} p0 w0:(SHRLconst [j-8] w) mem))
&& x.Uses == 1
&& sequentialAddresses(p0, p1, 1)
&& clobber(x)
- -> (MOVWstore [i] {s} p0 w0 mem)
+ => (MOVWstore [i] {s} p0 w0 mem)
(MOVWstore [i] {s} p (SHRLconst [16] w) x:(MOVWstore [i-2] {s} p w mem))
&& x.Uses == 1
&& clobber(x)
- -> (MOVLstore [i-2] {s} p w mem)
+ => (MOVLstore [i-2] {s} p w mem)
(MOVWstore [i] {s} p (SHRLconst [j] w) x:(MOVWstore [i-2] {s} p w0:(SHRLconst [j-16] w) mem))
&& x.Uses == 1
&& clobber(x)
- -> (MOVLstore [i-2] {s} p w0 mem)
+ => (MOVLstore [i-2] {s} p w0 mem)
(MOVWstore [i] {s} p1 (SHRLconst [16] w) x:(MOVWstore [i] {s} p0 w mem))
&& x.Uses == 1
&& sequentialAddresses(p0, p1, 2)
&& clobber(x)
- -> (MOVLstore [i] {s} p0 w mem)
+ => (MOVLstore [i] {s} p0 w mem)
(MOVWstore [i] {s} p1 (SHRLconst [j] w) x:(MOVWstore [i] {s} p0 w0:(SHRLconst [j-16] w) mem))
&& x.Uses == 1
&& sequentialAddresses(p0, p1, 2)
&& clobber(x)
- -> (MOVLstore [i] {s} p0 w0 mem)
+ => (MOVLstore [i] {s} p0 w0 mem)
// For PIC, break floating-point constant loading into two instructions so we have
// a register to use for holding the address of the constant pool entry.
-(MOVSSconst [c]) && config.ctxt.Flag_shared -> (MOVSSconst2 (MOVSSconst1 [c]))
-(MOVSDconst [c]) && config.ctxt.Flag_shared -> (MOVSDconst2 (MOVSDconst1 [c]))
+(MOVSSconst [c]) && config.ctxt.Flag_shared => (MOVSSconst2 (MOVSSconst1 [c]))
+(MOVSDconst [c]) && config.ctxt.Flag_shared => (MOVSDconst2 (MOVSDconst1 [c]))
-(CMP(L|W|B) l:(MOV(L|W|B)load {sym} [off] ptr mem) x) && canMergeLoad(v, l) && clobber(l) -> (CMP(L|W|B)load {sym} [off] ptr x mem)
-(CMP(L|W|B) x l:(MOV(L|W|B)load {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) -> (InvertFlags (CMP(L|W|B)load {sym} [off] ptr x mem))
+(CMP(L|W|B) l:(MOV(L|W|B)load {sym} [off] ptr mem) x) && canMergeLoad(v, l) && clobber(l) => (CMP(L|W|B)load {sym} [off] ptr x mem)
+(CMP(L|W|B) x l:(MOV(L|W|B)load {sym} [off] ptr mem)) && canMergeLoad(v, l) && clobber(l) => (InvertFlags (CMP(L|W|B)load {sym} [off] ptr x mem))
(CMP(L|W|B)const l:(MOV(L|W|B)load {sym} [off] ptr mem) [c])
&& l.Uses == 1
- && validValAndOff(c, off)
- && clobber(l) ->
- @l.Block (CMP(L|W|B)constload {sym} [makeValAndOff(c,off)] ptr mem)
+ && validValAndOff(int64(c), int64(off))
+ && clobber(l) =>
+ @l.Block (CMP(L|W|B)constload {sym} [makeValAndOff32(int32(c),int32(off))] ptr mem)
-(CMPLload {sym} [off] ptr (MOVLconst [c]) mem) && validValAndOff(int64(int32(c)),off) -> (CMPLconstload {sym} [makeValAndOff(int64(int32(c)),off)] ptr mem)
-(CMPWload {sym} [off] ptr (MOVLconst [c]) mem) && validValAndOff(int64(int16(c)),off) -> (CMPWconstload {sym} [makeValAndOff(int64(int16(c)),off)] ptr mem)
-(CMPBload {sym} [off] ptr (MOVLconst [c]) mem) && validValAndOff(int64(int8(c)),off) -> (CMPBconstload {sym} [makeValAndOff(int64(int8(c)),off)] ptr mem)
+(CMPLload {sym} [off] ptr (MOVLconst [c]) mem) && validValAndOff(int64(c),int64(off)) => (CMPLconstload {sym} [makeValAndOff32(c,off)] ptr mem)
+(CMPWload {sym} [off] ptr (MOVLconst [c]) mem) && validValAndOff(int64(int16(c)),int64(off)) => (CMPWconstload {sym} [makeValAndOff32(int32(int16(c)),off)] ptr mem)
+(CMPBload {sym} [off] ptr (MOVLconst [c]) mem) && validValAndOff(int64(int8(c)),int64(off)) => (CMPBconstload {sym} [makeValAndOff32(int32(int8(c)),off)] ptr mem)
-(MOVBload [off] {sym} (SB) _) && symIsRO(sym) -> (MOVLconst [int64(read8(sym, off))])
-(MOVWload [off] {sym} (SB) _) && symIsRO(sym) -> (MOVLconst [int64(read16(sym, off, config.ctxt.Arch.ByteOrder))])
-(MOVLload [off] {sym} (SB) _) && symIsRO(sym) -> (MOVLconst [int64(int32(read32(sym, off, config.ctxt.Arch.ByteOrder)))])
+(MOVBload [off] {sym} (SB) _) && symIsRO(sym) => (MOVLconst [int32(read8(sym, int64(off)))])
+(MOVWload [off] {sym} (SB) _) && symIsRO(sym) => (MOVLconst [int32(read16(sym, int64(off), config.ctxt.Arch.ByteOrder))])
+(MOVLload [off] {sym} (SB) _) && symIsRO(sym) => (MOVLconst [int32(read32(sym, int64(off), config.ctxt.Arch.ByteOrder))])
return true
}
// match: (ADDLconst [c] x)
- // cond: int32(c)==0
+ // cond: c==0
// result: x
for {
- c := v.AuxInt
+ c := auxIntToInt32(v.AuxInt)
x := v_0
- if !(int32(c) == 0) {
+ if !(c == 0) {
break
}
v.copyOf(x)
return true
}
// match: (ADDLconst [c] (MOVLconst [d]))
- // result: (MOVLconst [int64(int32(c+d))])
+ // result: (MOVLconst [c+d])
for {
- c := v.AuxInt
+ c := auxIntToInt32(v.AuxInt)
if v_0.Op != Op386MOVLconst {
break
}
- d := v_0.AuxInt
+ d := auxIntToInt32(v_0.AuxInt)
v.reset(Op386MOVLconst)
- v.AuxInt = int64(int32(c + d))
+ v.AuxInt = int32ToAuxInt(c + d)
return true
}
// match: (ADDLconst [c] (ADDLconst [d] x))
- // result: (ADDLconst [int64(int32(c+d))] x)
+ // result: (ADDLconst [c+d] x)
for {
- c := v.AuxInt
+ c := auxIntToInt32(v.AuxInt)
if v_0.Op != Op386ADDLconst {
break
}
- d := v_0.AuxInt
+ d := auxIntToInt32(v_0.AuxInt)
x := v_0.Args[0]
v.reset(Op386ADDLconst)
- v.AuxInt = int64(int32(c + d))
+ v.AuxInt = int32ToAuxInt(c + d)
v.AddArg(x)
return true
}
return true
}
// match: (ANDLconst [c] _)
- // cond: int32(c)==0
+ // cond: c==0
// result: (MOVLconst [0])
for {
- c := v.AuxInt
- if !(int32(c) == 0) {
+ c := auxIntToInt32(v.AuxInt)
+ if !(c == 0) {
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
// match: (ANDLconst [c] x)
- // cond: int32(c)==-1
+ // cond: c==-1
// result: x
for {
- c := v.AuxInt
+ c := auxIntToInt32(v.AuxInt)
x := v_0
- if !(int32(c) == -1) {
+ if !(c == -1) {
break
}
v.copyOf(x)
// match: (ANDLconst [c] (MOVLconst [d]))
// result: (MOVLconst [c&d])
for {
- c := v.AuxInt
+ c := auxIntToInt32(v.AuxInt)
if v_0.Op != Op386MOVLconst {
break
}
- d := v_0.AuxInt
+ d := auxIntToInt32(v_0.AuxInt)
v.reset(Op386MOVLconst)
- v.AuxInt = c & d
+ v.AuxInt = int32ToAuxInt(c & d)
return true
}
return false
if l.Op != Op386MOVBload {
break
}
- off := l.AuxInt
- sym := l.Aux
+ off := auxIntToInt32(l.AuxInt)
+ sym := auxToSym(l.Aux)
mem := l.Args[1]
ptr := l.Args[0]
x := v_1
break
}
v.reset(Op386CMPBload)
- v.AuxInt = off
- v.Aux = sym
+ v.AuxInt = int32ToAuxInt(off)
+ v.Aux = symToAux(sym)
v.AddArg3(ptr, x, mem)
return true
}
if l.Op != Op386MOVBload {
break
}
- off := l.AuxInt
- sym := l.Aux
+ off := auxIntToInt32(l.AuxInt)
+ sym := auxToSym(l.Aux)
mem := l.Args[1]
ptr := l.Args[0]
if !(canMergeLoad(v, l) && clobber(l)) {
}
v.reset(Op386InvertFlags)
v0 := b.NewValue0(l.Pos, Op386CMPBload, types.TypeFlags)
- v0.AuxInt = off
- v0.Aux = sym
+ v0.AuxInt = int32ToAuxInt(off)
+ v0.Aux = symToAux(sym)
v0.AddArg3(ptr, x, mem)
v.AddArg(v0)
return true
return true
}
// match: (CMPBconst (ANDLconst _ [m]) [n])
- // cond: 0 <= int8(m) && int8(m) < int8(n)
+ // cond: 0 <= int8(m) && int8(m) < n
// result: (FlagLT_ULT)
for {
- n := v.AuxInt
+ n := auxIntToInt8(v.AuxInt)
if v_0.Op != Op386ANDLconst {
break
}
- m := v_0.AuxInt
- if !(0 <= int8(m) && int8(m) < int8(n)) {
+ m := auxIntToInt32(v_0.AuxInt)
+ if !(0 <= int8(m) && int8(m) < n) {
break
}
v.reset(Op386FlagLT_ULT)
// cond: l.Uses==1
// result: (TESTB x y)
for {
- if v.AuxInt != 0 {
+ if auxIntToInt8(v.AuxInt) != 0 {
break
}
l := v_0
}
// match: (CMPBconst l:(ANDLconst [c] x) [0])
// cond: l.Uses==1
- // result: (TESTBconst [int64(int8(c))] x)
+ // result: (TESTBconst [int8(c)] x)
for {
- if v.AuxInt != 0 {
+ if auxIntToInt8(v.AuxInt) != 0 {
break
}
l := v_0
if l.Op != Op386ANDLconst {
break
}
- c := l.AuxInt
+ c := auxIntToInt32(l.AuxInt)
x := l.Args[0]
if !(l.Uses == 1) {
break
}
v.reset(Op386TESTBconst)
- v.AuxInt = int64(int8(c))
+ v.AuxInt = int8ToAuxInt(int8(c))
v.AddArg(x)
return true
}
// match: (CMPBconst x [0])
// result: (TESTB x x)
for {
- if v.AuxInt != 0 {
+ if auxIntToInt8(v.AuxInt) != 0 {
break
}
x := v_0
return true
}
// match: (CMPBconst l:(MOVBload {sym} [off] ptr mem) [c])
- // cond: l.Uses == 1 && validValAndOff(c, off) && clobber(l)
- // result: @l.Block (CMPBconstload {sym} [makeValAndOff(c,off)] ptr mem)
+ // cond: l.Uses == 1 && validValAndOff(int64(c), int64(off)) && clobber(l)
+ // result: @l.Block (CMPBconstload {sym} [makeValAndOff32(int32(c),int32(off))] ptr mem)
for {
- c := v.AuxInt
+ c := auxIntToInt8(v.AuxInt)
l := v_0
if l.Op != Op386MOVBload {
break
}
- off := l.AuxInt
- sym := l.Aux
+ off := auxIntToInt32(l.AuxInt)
+ sym := auxToSym(l.Aux)
mem := l.Args[1]
ptr := l.Args[0]
- if !(l.Uses == 1 && validValAndOff(c, off) && clobber(l)) {
+ if !(l.Uses == 1 && validValAndOff(int64(c), int64(off)) && clobber(l)) {
break
}
b = l.Block
v0 := b.NewValue0(l.Pos, Op386CMPBconstload, types.TypeFlags)
v.copyOf(v0)
- v0.AuxInt = makeValAndOff(c, off)
- v0.Aux = sym
+ v0.AuxInt = valAndOffToAuxInt(makeValAndOff32(int32(c), int32(off)))
+ v0.Aux = symToAux(sym)
v0.AddArg2(ptr, mem)
return true
}
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (CMPBload {sym} [off] ptr (MOVLconst [c]) mem)
- // cond: validValAndOff(int64(int8(c)),off)
- // result: (CMPBconstload {sym} [makeValAndOff(int64(int8(c)),off)] ptr mem)
+ // cond: validValAndOff(int64(int8(c)),int64(off))
+ // result: (CMPBconstload {sym} [makeValAndOff32(int32(int8(c)),off)] ptr mem)
for {
- off := v.AuxInt
- sym := v.Aux
+ off := auxIntToInt32(v.AuxInt)
+ sym := auxToSym(v.Aux)
ptr := v_0
if v_1.Op != Op386MOVLconst {
break
}
- c := v_1.AuxInt
+ c := auxIntToInt32(v_1.AuxInt)
mem := v_2
- if !(validValAndOff(int64(int8(c)), off)) {
+ if !(validValAndOff(int64(int8(c)), int64(off))) {
break
}
v.reset(Op386CMPBconstload)
- v.AuxInt = makeValAndOff(int64(int8(c)), off)
- v.Aux = sym
+ v.AuxInt = valAndOffToAuxInt(makeValAndOff32(int32(int8(c)), off))
+ v.Aux = symToAux(sym)
v.AddArg2(ptr, mem)
return true
}
if l.Op != Op386MOVLload {
break
}
- off := l.AuxInt
- sym := l.Aux
+ off := auxIntToInt32(l.AuxInt)
+ sym := auxToSym(l.Aux)
mem := l.Args[1]
ptr := l.Args[0]
x := v_1
break
}
v.reset(Op386CMPLload)
- v.AuxInt = off
- v.Aux = sym
+ v.AuxInt = int32ToAuxInt(off)
+ v.Aux = symToAux(sym)
v.AddArg3(ptr, x, mem)
return true
}
if l.Op != Op386MOVLload {
break
}
- off := l.AuxInt
- sym := l.Aux
+ off := auxIntToInt32(l.AuxInt)
+ sym := auxToSym(l.Aux)
mem := l.Args[1]
ptr := l.Args[0]
if !(canMergeLoad(v, l) && clobber(l)) {
}
v.reset(Op386InvertFlags)
v0 := b.NewValue0(l.Pos, Op386CMPLload, types.TypeFlags)
- v0.AuxInt = off
- v0.Aux = sym
+ v0.AuxInt = int32ToAuxInt(off)
+ v0.Aux = symToAux(sym)
v0.AddArg3(ptr, x, mem)
v.AddArg(v0)
return true
// cond: 0 <= n && 0 < c && c <= 32 && (1<<uint64(32-c)) <= uint64(n)
// result: (FlagLT_ULT)
for {
- n := v.AuxInt
+ n := auxIntToInt32(v.AuxInt)
if v_0.Op != Op386SHRLconst {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt32(v_0.AuxInt)
if !(0 <= n && 0 < c && c <= 32 && (1<<uint64(32-c)) <= uint64(n)) {
break
}
return true
}
// match: (CMPLconst (ANDLconst _ [m]) [n])
- // cond: 0 <= int32(m) && int32(m) < int32(n)
+ // cond: 0 <= m && m < n
// result: (FlagLT_ULT)
for {
- n := v.AuxInt
+ n := auxIntToInt32(v.AuxInt)
if v_0.Op != Op386ANDLconst {
break
}
- m := v_0.AuxInt
- if !(0 <= int32(m) && int32(m) < int32(n)) {
+ m := auxIntToInt32(v_0.AuxInt)
+ if !(0 <= m && m < n) {
break
}
v.reset(Op386FlagLT_ULT)
// cond: l.Uses==1
// result: (TESTL x y)
for {
- if v.AuxInt != 0 {
+ if auxIntToInt32(v.AuxInt) != 0 {
break
}
l := v_0
// cond: l.Uses==1
// result: (TESTLconst [c] x)
for {
- if v.AuxInt != 0 {
+ if auxIntToInt32(v.AuxInt) != 0 {
break
}
l := v_0
if l.Op != Op386ANDLconst {
break
}
- c := l.AuxInt
+ c := auxIntToInt32(l.AuxInt)
x := l.Args[0]
if !(l.Uses == 1) {
break
}
v.reset(Op386TESTLconst)
- v.AuxInt = c
+ v.AuxInt = int32ToAuxInt(c)
v.AddArg(x)
return true
}
// match: (CMPLconst x [0])
// result: (TESTL x x)
for {
- if v.AuxInt != 0 {
+ if auxIntToInt32(v.AuxInt) != 0 {
break
}
x := v_0
return true
}
// match: (CMPLconst l:(MOVLload {sym} [off] ptr mem) [c])
- // cond: l.Uses == 1 && validValAndOff(c, off) && clobber(l)
- // result: @l.Block (CMPLconstload {sym} [makeValAndOff(c,off)] ptr mem)
+ // cond: l.Uses == 1 && validValAndOff(int64(c), int64(off)) && clobber(l)
+ // result: @l.Block (CMPLconstload {sym} [makeValAndOff32(int32(c),int32(off))] ptr mem)
for {
- c := v.AuxInt
+ c := auxIntToInt32(v.AuxInt)
l := v_0
if l.Op != Op386MOVLload {
break
}
- off := l.AuxInt
- sym := l.Aux
+ off := auxIntToInt32(l.AuxInt)
+ sym := auxToSym(l.Aux)
mem := l.Args[1]
ptr := l.Args[0]
- if !(l.Uses == 1 && validValAndOff(c, off) && clobber(l)) {
+ if !(l.Uses == 1 && validValAndOff(int64(c), int64(off)) && clobber(l)) {
break
}
b = l.Block
v0 := b.NewValue0(l.Pos, Op386CMPLconstload, types.TypeFlags)
v.copyOf(v0)
- v0.AuxInt = makeValAndOff(c, off)
- v0.Aux = sym
+ v0.AuxInt = valAndOffToAuxInt(makeValAndOff32(int32(c), int32(off)))
+ v0.Aux = symToAux(sym)
v0.AddArg2(ptr, mem)
return true
}
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (CMPLload {sym} [off] ptr (MOVLconst [c]) mem)
- // cond: validValAndOff(int64(int32(c)),off)
- // result: (CMPLconstload {sym} [makeValAndOff(int64(int32(c)),off)] ptr mem)
+ // cond: validValAndOff(int64(c),int64(off))
+ // result: (CMPLconstload {sym} [makeValAndOff32(c,off)] ptr mem)
for {
- off := v.AuxInt
- sym := v.Aux
+ off := auxIntToInt32(v.AuxInt)
+ sym := auxToSym(v.Aux)
ptr := v_0
if v_1.Op != Op386MOVLconst {
break
}
- c := v_1.AuxInt
+ c := auxIntToInt32(v_1.AuxInt)
mem := v_2
- if !(validValAndOff(int64(int32(c)), off)) {
+ if !(validValAndOff(int64(c), int64(off))) {
break
}
v.reset(Op386CMPLconstload)
- v.AuxInt = makeValAndOff(int64(int32(c)), off)
- v.Aux = sym
+ v.AuxInt = valAndOffToAuxInt(makeValAndOff32(c, off))
+ v.Aux = symToAux(sym)
v.AddArg2(ptr, mem)
return true
}
if l.Op != Op386MOVWload {
break
}
- off := l.AuxInt
- sym := l.Aux
+ off := auxIntToInt32(l.AuxInt)
+ sym := auxToSym(l.Aux)
mem := l.Args[1]
ptr := l.Args[0]
x := v_1
break
}
v.reset(Op386CMPWload)
- v.AuxInt = off
- v.Aux = sym
+ v.AuxInt = int32ToAuxInt(off)
+ v.Aux = symToAux(sym)
v.AddArg3(ptr, x, mem)
return true
}
if l.Op != Op386MOVWload {
break
}
- off := l.AuxInt
- sym := l.Aux
+ off := auxIntToInt32(l.AuxInt)
+ sym := auxToSym(l.Aux)
mem := l.Args[1]
ptr := l.Args[0]
if !(canMergeLoad(v, l) && clobber(l)) {
}
v.reset(Op386InvertFlags)
v0 := b.NewValue0(l.Pos, Op386CMPWload, types.TypeFlags)
- v0.AuxInt = off
- v0.Aux = sym
+ v0.AuxInt = int32ToAuxInt(off)
+ v0.Aux = symToAux(sym)
v0.AddArg3(ptr, x, mem)
v.AddArg(v0)
return true
return true
}
// match: (CMPWconst (ANDLconst _ [m]) [n])
- // cond: 0 <= int16(m) && int16(m) < int16(n)
+ // cond: 0 <= int16(m) && int16(m) < n
// result: (FlagLT_ULT)
for {
- n := v.AuxInt
+ n := auxIntToInt16(v.AuxInt)
if v_0.Op != Op386ANDLconst {
break
}
- m := v_0.AuxInt
- if !(0 <= int16(m) && int16(m) < int16(n)) {
+ m := auxIntToInt32(v_0.AuxInt)
+ if !(0 <= int16(m) && int16(m) < n) {
break
}
v.reset(Op386FlagLT_ULT)
// cond: l.Uses==1
// result: (TESTW x y)
for {
- if v.AuxInt != 0 {
+ if auxIntToInt16(v.AuxInt) != 0 {
break
}
l := v_0
}
// match: (CMPWconst l:(ANDLconst [c] x) [0])
// cond: l.Uses==1
- // result: (TESTWconst [int64(int16(c))] x)
+ // result: (TESTWconst [int16(c)] x)
for {
- if v.AuxInt != 0 {
+ if auxIntToInt16(v.AuxInt) != 0 {
break
}
l := v_0
if l.Op != Op386ANDLconst {
break
}
- c := l.AuxInt
+ c := auxIntToInt32(l.AuxInt)
x := l.Args[0]
if !(l.Uses == 1) {
break
}
v.reset(Op386TESTWconst)
- v.AuxInt = int64(int16(c))
+ v.AuxInt = int16ToAuxInt(int16(c))
v.AddArg(x)
return true
}
// match: (CMPWconst x [0])
// result: (TESTW x x)
for {
- if v.AuxInt != 0 {
+ if auxIntToInt16(v.AuxInt) != 0 {
break
}
x := v_0
return true
}
// match: (CMPWconst l:(MOVWload {sym} [off] ptr mem) [c])
- // cond: l.Uses == 1 && validValAndOff(c, off) && clobber(l)
- // result: @l.Block (CMPWconstload {sym} [makeValAndOff(c,off)] ptr mem)
+ // cond: l.Uses == 1 && validValAndOff(int64(c), int64(off)) && clobber(l)
+ // result: @l.Block (CMPWconstload {sym} [makeValAndOff32(int32(c),int32(off))] ptr mem)
for {
- c := v.AuxInt
+ c := auxIntToInt16(v.AuxInt)
l := v_0
if l.Op != Op386MOVWload {
break
}
- off := l.AuxInt
- sym := l.Aux
+ off := auxIntToInt32(l.AuxInt)
+ sym := auxToSym(l.Aux)
mem := l.Args[1]
ptr := l.Args[0]
- if !(l.Uses == 1 && validValAndOff(c, off) && clobber(l)) {
+ if !(l.Uses == 1 && validValAndOff(int64(c), int64(off)) && clobber(l)) {
break
}
b = l.Block
v0 := b.NewValue0(l.Pos, Op386CMPWconstload, types.TypeFlags)
v.copyOf(v0)
- v0.AuxInt = makeValAndOff(c, off)
- v0.Aux = sym
+ v0.AuxInt = valAndOffToAuxInt(makeValAndOff32(int32(c), int32(off)))
+ v0.Aux = symToAux(sym)
v0.AddArg2(ptr, mem)
return true
}
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (CMPWload {sym} [off] ptr (MOVLconst [c]) mem)
- // cond: validValAndOff(int64(int16(c)),off)
- // result: (CMPWconstload {sym} [makeValAndOff(int64(int16(c)),off)] ptr mem)
+ // cond: validValAndOff(int64(int16(c)),int64(off))
+ // result: (CMPWconstload {sym} [makeValAndOff32(int32(int16(c)),off)] ptr mem)
for {
- off := v.AuxInt
- sym := v.Aux
+ off := auxIntToInt32(v.AuxInt)
+ sym := auxToSym(v.Aux)
ptr := v_0
if v_1.Op != Op386MOVLconst {
break
}
- c := v_1.AuxInt
+ c := auxIntToInt32(v_1.AuxInt)
mem := v_2
- if !(validValAndOff(int64(int16(c)), off)) {
+ if !(validValAndOff(int64(int16(c)), int64(off))) {
break
}
v.reset(Op386CMPWconstload)
- v.AuxInt = makeValAndOff(int64(int16(c)), off)
- v.Aux = sym
+ v.AuxInt = valAndOffToAuxInt(makeValAndOff32(int32(int16(c)), off))
+ v.Aux = symToAux(sym)
v.AddArg2(ptr, mem)
return true
}
// match: (LEAL1 [0] {nil} x y)
// result: (ADDL x y)
for {
- if v.AuxInt != 0 || v.Aux != nil {
+ if auxIntToInt32(v.AuxInt) != 0 || auxToSym(v.Aux) != nil {
break
}
x := v_0
}
// match: (MOVBload [off] {sym} (SB) _)
// cond: symIsRO(sym)
- // result: (MOVLconst [int64(read8(sym, off))])
+ // result: (MOVLconst [int32(read8(sym, int64(off)))])
for {
- off := v.AuxInt
- sym := v.Aux
+ off := auxIntToInt32(v.AuxInt)
+ sym := auxToSym(v.Aux)
if v_0.Op != OpSB || !(symIsRO(sym)) {
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = int64(read8(sym, off))
+ v.AuxInt = int32ToAuxInt(int32(read8(sym, int64(off))))
return true
}
return false
// cond: x.Uses == 1 && clobber(x)
// result: (MOVWstore [i-1] {s} p w mem)
for {
- i := v.AuxInt
- s := v.Aux
+ i := auxIntToInt32(v.AuxInt)
+ s := auxToSym(v.Aux)
p := v_0
- if v_1.Op != Op386SHRWconst || v_1.AuxInt != 8 {
+ if v_1.Op != Op386SHRWconst || auxIntToInt16(v_1.AuxInt) != 8 {
break
}
w := v_1.Args[0]
x := v_2
- if x.Op != Op386MOVBstore || x.AuxInt != i-1 || x.Aux != s {
+ if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i-1 || auxToSym(x.Aux) != s {
break
}
mem := x.Args[2]
break
}
v.reset(Op386MOVWstore)
- v.AuxInt = i - 1
- v.Aux = s
+ v.AuxInt = int32ToAuxInt(i - 1)
+ v.Aux = symToAux(s)
v.AddArg3(p, w, mem)
return true
}
// cond: x.Uses == 1 && clobber(x)
// result: (MOVWstore [i-1] {s} p w mem)
for {
- i := v.AuxInt
- s := v.Aux
+ i := auxIntToInt32(v.AuxInt)
+ s := auxToSym(v.Aux)
p := v_0
- if v_1.Op != Op386SHRLconst || v_1.AuxInt != 8 {
+ if v_1.Op != Op386SHRLconst || auxIntToInt32(v_1.AuxInt) != 8 {
break
}
w := v_1.Args[0]
x := v_2
- if x.Op != Op386MOVBstore || x.AuxInt != i-1 || x.Aux != s {
+ if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i-1 || auxToSym(x.Aux) != s {
break
}
mem := x.Args[2]
break
}
v.reset(Op386MOVWstore)
- v.AuxInt = i - 1
- v.Aux = s
+ v.AuxInt = int32ToAuxInt(i - 1)
+ v.Aux = symToAux(s)
v.AddArg3(p, w, mem)
return true
}
// cond: x.Uses == 1 && clobber(x)
// result: (MOVWstore [i] {s} p w mem)
for {
- i := v.AuxInt
- s := v.Aux
+ i := auxIntToInt32(v.AuxInt)
+ s := auxToSym(v.Aux)
p := v_0
w := v_1
x := v_2
- if x.Op != Op386MOVBstore || x.AuxInt != i+1 || x.Aux != s {
+ if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i+1 || auxToSym(x.Aux) != s {
break
}
mem := x.Args[2]
break
}
x_1 := x.Args[1]
- if x_1.Op != Op386SHRWconst || x_1.AuxInt != 8 || w != x_1.Args[0] || !(x.Uses == 1 && clobber(x)) {
+ if x_1.Op != Op386SHRWconst || auxIntToInt16(x_1.AuxInt) != 8 || w != x_1.Args[0] || !(x.Uses == 1 && clobber(x)) {
break
}
v.reset(Op386MOVWstore)
- v.AuxInt = i
- v.Aux = s
+ v.AuxInt = int32ToAuxInt(i)
+ v.Aux = symToAux(s)
v.AddArg3(p, w, mem)
return true
}
// cond: x.Uses == 1 && clobber(x)
// result: (MOVWstore [i] {s} p w mem)
for {
- i := v.AuxInt
- s := v.Aux
+ i := auxIntToInt32(v.AuxInt)
+ s := auxToSym(v.Aux)
p := v_0
w := v_1
x := v_2
- if x.Op != Op386MOVBstore || x.AuxInt != i+1 || x.Aux != s {
+ if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i+1 || auxToSym(x.Aux) != s {
break
}
mem := x.Args[2]
break
}
x_1 := x.Args[1]
- if x_1.Op != Op386SHRLconst || x_1.AuxInt != 8 || w != x_1.Args[0] || !(x.Uses == 1 && clobber(x)) {
+ if x_1.Op != Op386SHRLconst || auxIntToInt32(x_1.AuxInt) != 8 || w != x_1.Args[0] || !(x.Uses == 1 && clobber(x)) {
break
}
v.reset(Op386MOVWstore)
- v.AuxInt = i
- v.Aux = s
+ v.AuxInt = int32ToAuxInt(i)
+ v.Aux = symToAux(s)
v.AddArg3(p, w, mem)
return true
}
// cond: x.Uses == 1 && clobber(x)
// result: (MOVWstore [i-1] {s} p w0 mem)
for {
- i := v.AuxInt
- s := v.Aux
+ i := auxIntToInt32(v.AuxInt)
+ s := auxToSym(v.Aux)
p := v_0
if v_1.Op != Op386SHRLconst {
break
}
- j := v_1.AuxInt
+ j := auxIntToInt32(v_1.AuxInt)
w := v_1.Args[0]
x := v_2
- if x.Op != Op386MOVBstore || x.AuxInt != i-1 || x.Aux != s {
+ if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i-1 || auxToSym(x.Aux) != s {
break
}
mem := x.Args[2]
break
}
w0 := x.Args[1]
- if w0.Op != Op386SHRLconst || w0.AuxInt != j-8 || w != w0.Args[0] || !(x.Uses == 1 && clobber(x)) {
+ if w0.Op != Op386SHRLconst || auxIntToInt32(w0.AuxInt) != j-8 || w != w0.Args[0] || !(x.Uses == 1 && clobber(x)) {
break
}
v.reset(Op386MOVWstore)
- v.AuxInt = i - 1
- v.Aux = s
+ v.AuxInt = int32ToAuxInt(i - 1)
+ v.Aux = symToAux(s)
v.AddArg3(p, w0, mem)
return true
}
// cond: x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)
// result: (MOVWstore [i] {s} p0 w mem)
for {
- i := v.AuxInt
- s := v.Aux
+ i := auxIntToInt32(v.AuxInt)
+ s := auxToSym(v.Aux)
p1 := v_0
- if v_1.Op != Op386SHRWconst || v_1.AuxInt != 8 {
+ if v_1.Op != Op386SHRWconst || auxIntToInt16(v_1.AuxInt) != 8 {
break
}
w := v_1.Args[0]
x := v_2
- if x.Op != Op386MOVBstore || x.AuxInt != i || x.Aux != s {
+ if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i || auxToSym(x.Aux) != s {
break
}
mem := x.Args[2]
break
}
v.reset(Op386MOVWstore)
- v.AuxInt = i
- v.Aux = s
+ v.AuxInt = int32ToAuxInt(i)
+ v.Aux = symToAux(s)
v.AddArg3(p0, w, mem)
return true
}
// cond: x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)
// result: (MOVWstore [i] {s} p0 w mem)
for {
- i := v.AuxInt
- s := v.Aux
+ i := auxIntToInt32(v.AuxInt)
+ s := auxToSym(v.Aux)
p1 := v_0
- if v_1.Op != Op386SHRLconst || v_1.AuxInt != 8 {
+ if v_1.Op != Op386SHRLconst || auxIntToInt32(v_1.AuxInt) != 8 {
break
}
w := v_1.Args[0]
x := v_2
- if x.Op != Op386MOVBstore || x.AuxInt != i || x.Aux != s {
+ if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i || auxToSym(x.Aux) != s {
break
}
mem := x.Args[2]
break
}
v.reset(Op386MOVWstore)
- v.AuxInt = i
- v.Aux = s
+ v.AuxInt = int32ToAuxInt(i)
+ v.Aux = symToAux(s)
v.AddArg3(p0, w, mem)
return true
}
// cond: x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)
// result: (MOVWstore [i] {s} p0 w mem)
for {
- i := v.AuxInt
- s := v.Aux
+ i := auxIntToInt32(v.AuxInt)
+ s := auxToSym(v.Aux)
p0 := v_0
w := v_1
x := v_2
- if x.Op != Op386MOVBstore || x.AuxInt != i || x.Aux != s {
+ if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i || auxToSym(x.Aux) != s {
break
}
mem := x.Args[2]
p1 := x.Args[0]
x_1 := x.Args[1]
- if x_1.Op != Op386SHRWconst || x_1.AuxInt != 8 || w != x_1.Args[0] || !(x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)) {
+ if x_1.Op != Op386SHRWconst || auxIntToInt16(x_1.AuxInt) != 8 || w != x_1.Args[0] || !(x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)) {
break
}
v.reset(Op386MOVWstore)
- v.AuxInt = i
- v.Aux = s
+ v.AuxInt = int32ToAuxInt(i)
+ v.Aux = symToAux(s)
v.AddArg3(p0, w, mem)
return true
}
// cond: x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)
// result: (MOVWstore [i] {s} p0 w mem)
for {
- i := v.AuxInt
- s := v.Aux
+ i := auxIntToInt32(v.AuxInt)
+ s := auxToSym(v.Aux)
p0 := v_0
w := v_1
x := v_2
- if x.Op != Op386MOVBstore || x.AuxInt != i || x.Aux != s {
+ if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i || auxToSym(x.Aux) != s {
break
}
mem := x.Args[2]
p1 := x.Args[0]
x_1 := x.Args[1]
- if x_1.Op != Op386SHRLconst || x_1.AuxInt != 8 || w != x_1.Args[0] || !(x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)) {
+ if x_1.Op != Op386SHRLconst || auxIntToInt32(x_1.AuxInt) != 8 || w != x_1.Args[0] || !(x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)) {
break
}
v.reset(Op386MOVWstore)
- v.AuxInt = i
- v.Aux = s
+ v.AuxInt = int32ToAuxInt(i)
+ v.Aux = symToAux(s)
v.AddArg3(p0, w, mem)
return true
}
// cond: x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)
// result: (MOVWstore [i] {s} p0 w0 mem)
for {
- i := v.AuxInt
- s := v.Aux
+ i := auxIntToInt32(v.AuxInt)
+ s := auxToSym(v.Aux)
p1 := v_0
if v_1.Op != Op386SHRLconst {
break
}
- j := v_1.AuxInt
+ j := auxIntToInt32(v_1.AuxInt)
w := v_1.Args[0]
x := v_2
- if x.Op != Op386MOVBstore || x.AuxInt != i || x.Aux != s {
+ if x.Op != Op386MOVBstore || auxIntToInt32(x.AuxInt) != i || auxToSym(x.Aux) != s {
break
}
mem := x.Args[2]
p0 := x.Args[0]
w0 := x.Args[1]
- if w0.Op != Op386SHRLconst || w0.AuxInt != j-8 || w != w0.Args[0] || !(x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)) {
+ if w0.Op != Op386SHRLconst || auxIntToInt32(w0.AuxInt) != j-8 || w != w0.Args[0] || !(x.Uses == 1 && sequentialAddresses(p0, p1, 1) && clobber(x)) {
break
}
v.reset(Op386MOVWstore)
- v.AuxInt = i
- v.Aux = s
+ v.AuxInt = int32ToAuxInt(i)
+ v.Aux = symToAux(s)
v.AddArg3(p0, w0, mem)
return true
}
return true
}
// match: (MOVBstoreconst [c] {s} p x:(MOVBstoreconst [a] {s} p mem))
- // cond: x.Uses == 1 && ValAndOff(a).Off() + 1 == ValAndOff(c).Off() && clobber(x)
- // result: (MOVWstoreconst [makeValAndOff(ValAndOff(a).Val()&0xff | ValAndOff(c).Val()<<8, ValAndOff(a).Off())] {s} p mem)
+ // cond: x.Uses == 1 && a.Off() + 1 == c.Off() && clobber(x)
+ // result: (MOVWstoreconst [makeValAndOff32(int32(a.Val()&0xff | c.Val()<<8), int32(a.Off()))] {s} p mem)
for {
- c := v.AuxInt
- s := v.Aux
+ c := auxIntToValAndOff(v.AuxInt)
+ s := auxToSym(v.Aux)
p := v_0
x := v_1
if x.Op != Op386MOVBstoreconst {
break
}
- a := x.AuxInt
- if x.Aux != s {
+ a := auxIntToValAndOff(x.AuxInt)
+ if auxToSym(x.Aux) != s {
break
}
mem := x.Args[1]
- if p != x.Args[0] || !(x.Uses == 1 && ValAndOff(a).Off()+1 == ValAndOff(c).Off() && clobber(x)) {
+ if p != x.Args[0] || !(x.Uses == 1 && a.Off()+1 == c.Off() && clobber(x)) {
break
}
v.reset(Op386MOVWstoreconst)
- v.AuxInt = makeValAndOff(ValAndOff(a).Val()&0xff|ValAndOff(c).Val()<<8, ValAndOff(a).Off())
- v.Aux = s
+ v.AuxInt = valAndOffToAuxInt(makeValAndOff32(int32(a.Val()&0xff|c.Val()<<8), int32(a.Off())))
+ v.Aux = symToAux(s)
v.AddArg2(p, mem)
return true
}
// match: (MOVBstoreconst [a] {s} p x:(MOVBstoreconst [c] {s} p mem))
- // cond: x.Uses == 1 && ValAndOff(a).Off() + 1 == ValAndOff(c).Off() && clobber(x)
- // result: (MOVWstoreconst [makeValAndOff(ValAndOff(a).Val()&0xff | ValAndOff(c).Val()<<8, ValAndOff(a).Off())] {s} p mem)
+ // cond: x.Uses == 1 && a.Off() + 1 == c.Off() && clobber(x)
+ // result: (MOVWstoreconst [makeValAndOff32(int32(a.Val()&0xff | c.Val()<<8), int32(a.Off()))] {s} p mem)
for {
- a := v.AuxInt
- s := v.Aux
+ a := auxIntToValAndOff(v.AuxInt)
+ s := auxToSym(v.Aux)
p := v_0
x := v_1
if x.Op != Op386MOVBstoreconst {
break
}
- c := x.AuxInt
- if x.Aux != s {
+ c := auxIntToValAndOff(x.AuxInt)
+ if auxToSym(x.Aux) != s {
break
}
mem := x.Args[1]
- if p != x.Args[0] || !(x.Uses == 1 && ValAndOff(a).Off()+1 == ValAndOff(c).Off() && clobber(x)) {
+ if p != x.Args[0] || !(x.Uses == 1 && a.Off()+1 == c.Off() && clobber(x)) {
break
}
v.reset(Op386MOVWstoreconst)
- v.AuxInt = makeValAndOff(ValAndOff(a).Val()&0xff|ValAndOff(c).Val()<<8, ValAndOff(a).Off())
- v.Aux = s
+ v.AuxInt = valAndOffToAuxInt(makeValAndOff32(int32(a.Val()&0xff|c.Val()<<8), int32(a.Off())))
+ v.Aux = symToAux(s)
v.AddArg2(p, mem)
return true
}
// match: (MOVBstoreconst [c] {s} p1 x:(MOVBstoreconst [a] {s} p0 mem))
- // cond: x.Uses == 1 && ValAndOff(a).Off() == ValAndOff(c).Off() && sequentialAddresses(p0, p1, 1) && clobber(x)
- // result: (MOVWstoreconst [makeValAndOff(ValAndOff(a).Val()&0xff | ValAndOff(c).Val()<<8, ValAndOff(a).Off())] {s} p0 mem)
+ // cond: x.Uses == 1 && a.Off() == c.Off() && sequentialAddresses(p0, p1, 1) && clobber(x)
+ // result: (MOVWstoreconst [makeValAndOff32(int32(a.Val()&0xff | c.Val()<<8), int32(a.Off()))] {s} p0 mem)
for {
- c := v.AuxInt
- s := v.Aux
+ c := auxIntToValAndOff(v.AuxInt)
+ s := auxToSym(v.Aux)
p1 := v_0
x := v_1
if x.Op != Op386MOVBstoreconst {
break
}
- a := x.AuxInt
- if x.Aux != s {
+ a := auxIntToValAndOff(x.AuxInt)
+ if auxToSym(x.Aux) != s {
break
}
mem := x.Args[1]
p0 := x.Args[0]
- if !(x.Uses == 1 && ValAndOff(a).Off() == ValAndOff(c).Off() && sequentialAddresses(p0, p1, 1) && clobber(x)) {
+ if !(x.Uses == 1 && a.Off() == c.Off() && sequentialAddresses(p0, p1, 1) && clobber(x)) {
break
}
v.reset(Op386MOVWstoreconst)
- v.AuxInt = makeValAndOff(ValAndOff(a).Val()&0xff|ValAndOff(c).Val()<<8, ValAndOff(a).Off())
- v.Aux = s
+ v.AuxInt = valAndOffToAuxInt(makeValAndOff32(int32(a.Val()&0xff|c.Val()<<8), int32(a.Off())))
+ v.Aux = symToAux(s)
v.AddArg2(p0, mem)
return true
}
// match: (MOVBstoreconst [a] {s} p0 x:(MOVBstoreconst [c] {s} p1 mem))
- // cond: x.Uses == 1 && ValAndOff(a).Off() == ValAndOff(c).Off() && sequentialAddresses(p0, p1, 1) && clobber(x)
- // result: (MOVWstoreconst [makeValAndOff(ValAndOff(a).Val()&0xff | ValAndOff(c).Val()<<8, ValAndOff(a).Off())] {s} p0 mem)
+ // cond: x.Uses == 1 && a.Off() == c.Off() && sequentialAddresses(p0, p1, 1) && clobber(x)
+ // result: (MOVWstoreconst [makeValAndOff32(int32(a.Val()&0xff | c.Val()<<8), int32(a.Off()))] {s} p0 mem)
for {
- a := v.AuxInt
- s := v.Aux
+ a := auxIntToValAndOff(v.AuxInt)
+ s := auxToSym(v.Aux)
p0 := v_0
x := v_1
if x.Op != Op386MOVBstoreconst {
break
}
- c := x.AuxInt
- if x.Aux != s {
+ c := auxIntToValAndOff(x.AuxInt)
+ if auxToSym(x.Aux) != s {
break
}
mem := x.Args[1]
p1 := x.Args[0]
- if !(x.Uses == 1 && ValAndOff(a).Off() == ValAndOff(c).Off() && sequentialAddresses(p0, p1, 1) && clobber(x)) {
+ if !(x.Uses == 1 && a.Off() == c.Off() && sequentialAddresses(p0, p1, 1) && clobber(x)) {
break
}
v.reset(Op386MOVWstoreconst)
- v.AuxInt = makeValAndOff(ValAndOff(a).Val()&0xff|ValAndOff(c).Val()<<8, ValAndOff(a).Off())
- v.Aux = s
+ v.AuxInt = valAndOffToAuxInt(makeValAndOff32(int32(a.Val()&0xff|c.Val()<<8), int32(a.Off())))
+ v.Aux = symToAux(s)
v.AddArg2(p0, mem)
return true
}
}
// match: (MOVLload [off] {sym} (SB) _)
// cond: symIsRO(sym)
- // result: (MOVLconst [int64(int32(read32(sym, off, config.ctxt.Arch.ByteOrder)))])
+ // result: (MOVLconst [int32(read32(sym, int64(off), config.ctxt.Arch.ByteOrder))])
for {
- off := v.AuxInt
- sym := v.Aux
+ off := auxIntToInt32(v.AuxInt)
+ sym := auxToSym(v.Aux)
if v_0.Op != OpSB || !(symIsRO(sym)) {
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = int64(int32(read32(sym, off, config.ctxt.Arch.ByteOrder)))
+ v.AuxInt = int32ToAuxInt(int32(read32(sym, int64(off), config.ctxt.Arch.ByteOrder)))
return true
}
return false
// cond: config.ctxt.Flag_shared
// result: (MOVSDconst2 (MOVSDconst1 [c]))
for {
- c := v.AuxInt
+ c := auxIntToFloat64(v.AuxInt)
if !(config.ctxt.Flag_shared) {
break
}
v.reset(Op386MOVSDconst2)
v0 := b.NewValue0(v.Pos, Op386MOVSDconst1, typ.UInt32)
- v0.AuxInt = c
+ v0.AuxInt = float64ToAuxInt(c)
v.AddArg(v0)
return true
}
// cond: config.ctxt.Flag_shared
// result: (MOVSSconst2 (MOVSSconst1 [c]))
for {
- c := v.AuxInt
+ c := auxIntToFloat32(v.AuxInt)
if !(config.ctxt.Flag_shared) {
break
}
v.reset(Op386MOVSSconst2)
v0 := b.NewValue0(v.Pos, Op386MOVSSconst1, typ.UInt32)
- v0.AuxInt = c
+ v0.AuxInt = float32ToAuxInt(c)
v.AddArg(v0)
return true
}
}
// match: (MOVWload [off] {sym} (SB) _)
// cond: symIsRO(sym)
- // result: (MOVLconst [int64(read16(sym, off, config.ctxt.Arch.ByteOrder))])
+ // result: (MOVLconst [int32(read16(sym, int64(off), config.ctxt.Arch.ByteOrder))])
for {
- off := v.AuxInt
- sym := v.Aux
+ off := auxIntToInt32(v.AuxInt)
+ sym := auxToSym(v.Aux)
if v_0.Op != OpSB || !(symIsRO(sym)) {
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = int64(read16(sym, off, config.ctxt.Arch.ByteOrder))
+ v.AuxInt = int32ToAuxInt(int32(read16(sym, int64(off), config.ctxt.Arch.ByteOrder)))
return true
}
return false
// cond: x.Uses == 1 && clobber(x)
// result: (MOVLstore [i-2] {s} p w mem)
for {
- i := v.AuxInt
- s := v.Aux
+ i := auxIntToInt32(v.AuxInt)
+ s := auxToSym(v.Aux)
p := v_0
- if v_1.Op != Op386SHRLconst || v_1.AuxInt != 16 {
+ if v_1.Op != Op386SHRLconst || auxIntToInt32(v_1.AuxInt) != 16 {
break
}
w := v_1.Args[0]
x := v_2
- if x.Op != Op386MOVWstore || x.AuxInt != i-2 || x.Aux != s {
+ if x.Op != Op386MOVWstore || auxIntToInt32(x.AuxInt) != i-2 || auxToSym(x.Aux) != s {
break
}
mem := x.Args[2]
break
}
v.reset(Op386MOVLstore)
- v.AuxInt = i - 2
- v.Aux = s
+ v.AuxInt = int32ToAuxInt(i - 2)
+ v.Aux = symToAux(s)
v.AddArg3(p, w, mem)
return true
}
// cond: x.Uses == 1 && clobber(x)
// result: (MOVLstore [i-2] {s} p w0 mem)
for {
- i := v.AuxInt
- s := v.Aux
+ i := auxIntToInt32(v.AuxInt)
+ s := auxToSym(v.Aux)
p := v_0
if v_1.Op != Op386SHRLconst {
break
}
- j := v_1.AuxInt
+ j := auxIntToInt32(v_1.AuxInt)
w := v_1.Args[0]
x := v_2
- if x.Op != Op386MOVWstore || x.AuxInt != i-2 || x.Aux != s {
+ if x.Op != Op386MOVWstore || auxIntToInt32(x.AuxInt) != i-2 || auxToSym(x.Aux) != s {
break
}
mem := x.Args[2]
break
}
w0 := x.Args[1]
- if w0.Op != Op386SHRLconst || w0.AuxInt != j-16 || w != w0.Args[0] || !(x.Uses == 1 && clobber(x)) {
+ if w0.Op != Op386SHRLconst || auxIntToInt32(w0.AuxInt) != j-16 || w != w0.Args[0] || !(x.Uses == 1 && clobber(x)) {
break
}
v.reset(Op386MOVLstore)
- v.AuxInt = i - 2
- v.Aux = s
+ v.AuxInt = int32ToAuxInt(i - 2)
+ v.Aux = symToAux(s)
v.AddArg3(p, w0, mem)
return true
}
// cond: x.Uses == 1 && sequentialAddresses(p0, p1, 2) && clobber(x)
// result: (MOVLstore [i] {s} p0 w mem)
for {
- i := v.AuxInt
- s := v.Aux
+ i := auxIntToInt32(v.AuxInt)
+ s := auxToSym(v.Aux)
p1 := v_0
- if v_1.Op != Op386SHRLconst || v_1.AuxInt != 16 {
+ if v_1.Op != Op386SHRLconst || auxIntToInt32(v_1.AuxInt) != 16 {
break
}
w := v_1.Args[0]
x := v_2
- if x.Op != Op386MOVWstore || x.AuxInt != i || x.Aux != s {
+ if x.Op != Op386MOVWstore || auxIntToInt32(x.AuxInt) != i || auxToSym(x.Aux) != s {
break
}
mem := x.Args[2]
break
}
v.reset(Op386MOVLstore)
- v.AuxInt = i
- v.Aux = s
+ v.AuxInt = int32ToAuxInt(i)
+ v.Aux = symToAux(s)
v.AddArg3(p0, w, mem)
return true
}
// cond: x.Uses == 1 && sequentialAddresses(p0, p1, 2) && clobber(x)
// result: (MOVLstore [i] {s} p0 w0 mem)
for {
- i := v.AuxInt
- s := v.Aux
+ i := auxIntToInt32(v.AuxInt)
+ s := auxToSym(v.Aux)
p1 := v_0
if v_1.Op != Op386SHRLconst {
break
}
- j := v_1.AuxInt
+ j := auxIntToInt32(v_1.AuxInt)
w := v_1.Args[0]
x := v_2
- if x.Op != Op386MOVWstore || x.AuxInt != i || x.Aux != s {
+ if x.Op != Op386MOVWstore || auxIntToInt32(x.AuxInt) != i || auxToSym(x.Aux) != s {
break
}
mem := x.Args[2]
p0 := x.Args[0]
w0 := x.Args[1]
- if w0.Op != Op386SHRLconst || w0.AuxInt != j-16 || w != w0.Args[0] || !(x.Uses == 1 && sequentialAddresses(p0, p1, 2) && clobber(x)) {
+ if w0.Op != Op386SHRLconst || auxIntToInt32(w0.AuxInt) != j-16 || w != w0.Args[0] || !(x.Uses == 1 && sequentialAddresses(p0, p1, 2) && clobber(x)) {
break
}
v.reset(Op386MOVLstore)
- v.AuxInt = i
- v.Aux = s
+ v.AuxInt = int32ToAuxInt(i)
+ v.Aux = symToAux(s)
v.AddArg3(p0, w0, mem)
return true
}
return true
}
// match: (MOVWstoreconst [c] {s} p x:(MOVWstoreconst [a] {s} p mem))
- // cond: x.Uses == 1 && ValAndOff(a).Off() + 2 == ValAndOff(c).Off() && clobber(x)
- // result: (MOVLstoreconst [makeValAndOff(ValAndOff(a).Val()&0xffff | ValAndOff(c).Val()<<16, ValAndOff(a).Off())] {s} p mem)
+ // cond: x.Uses == 1 && a.Off() + 2 == c.Off() && clobber(x)
+ // result: (MOVLstoreconst [makeValAndOff32(int32(a.Val()&0xffff | c.Val()<<16), int32(a.Off()))] {s} p mem)
for {
- c := v.AuxInt
- s := v.Aux
+ c := auxIntToValAndOff(v.AuxInt)
+ s := auxToSym(v.Aux)
p := v_0
x := v_1
if x.Op != Op386MOVWstoreconst {
break
}
- a := x.AuxInt
- if x.Aux != s {
+ a := auxIntToValAndOff(x.AuxInt)
+ if auxToSym(x.Aux) != s {
break
}
mem := x.Args[1]
- if p != x.Args[0] || !(x.Uses == 1 && ValAndOff(a).Off()+2 == ValAndOff(c).Off() && clobber(x)) {
+ if p != x.Args[0] || !(x.Uses == 1 && a.Off()+2 == c.Off() && clobber(x)) {
break
}
v.reset(Op386MOVLstoreconst)
- v.AuxInt = makeValAndOff(ValAndOff(a).Val()&0xffff|ValAndOff(c).Val()<<16, ValAndOff(a).Off())
- v.Aux = s
+ v.AuxInt = valAndOffToAuxInt(makeValAndOff32(int32(a.Val()&0xffff|c.Val()<<16), int32(a.Off())))
+ v.Aux = symToAux(s)
v.AddArg2(p, mem)
return true
}
// match: (MOVWstoreconst [a] {s} p x:(MOVWstoreconst [c] {s} p mem))
// cond: x.Uses == 1 && ValAndOff(a).Off() + 2 == ValAndOff(c).Off() && clobber(x)
- // result: (MOVLstoreconst [makeValAndOff(ValAndOff(a).Val()&0xffff | ValAndOff(c).Val()<<16, ValAndOff(a).Off())] {s} p mem)
+ // result: (MOVLstoreconst [makeValAndOff32(int32(a.Val()&0xffff | c.Val()<<16), int32(a.Off()))] {s} p mem)
for {
- a := v.AuxInt
- s := v.Aux
+ a := auxIntToValAndOff(v.AuxInt)
+ s := auxToSym(v.Aux)
p := v_0
x := v_1
if x.Op != Op386MOVWstoreconst {
break
}
- c := x.AuxInt
- if x.Aux != s {
+ c := auxIntToValAndOff(x.AuxInt)
+ if auxToSym(x.Aux) != s {
break
}
mem := x.Args[1]
break
}
v.reset(Op386MOVLstoreconst)
- v.AuxInt = makeValAndOff(ValAndOff(a).Val()&0xffff|ValAndOff(c).Val()<<16, ValAndOff(a).Off())
- v.Aux = s
+ v.AuxInt = valAndOffToAuxInt(makeValAndOff32(int32(a.Val()&0xffff|c.Val()<<16), int32(a.Off())))
+ v.Aux = symToAux(s)
v.AddArg2(p, mem)
return true
}
// match: (MOVWstoreconst [c] {s} p1 x:(MOVWstoreconst [a] {s} p0 mem))
- // cond: x.Uses == 1 && ValAndOff(a).Off() == ValAndOff(c).Off() && sequentialAddresses(p0, p1, 2) && clobber(x)
- // result: (MOVLstoreconst [makeValAndOff(ValAndOff(a).Val()&0xffff | ValAndOff(c).Val()<<16, ValAndOff(a).Off())] {s} p0 mem)
+ // cond: x.Uses == 1 && a.Off() == c.Off() && sequentialAddresses(p0, p1, 2) && clobber(x)
+ // result: (MOVLstoreconst [makeValAndOff32(int32(a.Val()&0xffff | c.Val()<<16), int32(a.Off()))] {s} p0 mem)
for {
- c := v.AuxInt
- s := v.Aux
+ c := auxIntToValAndOff(v.AuxInt)
+ s := auxToSym(v.Aux)
p1 := v_0
x := v_1
if x.Op != Op386MOVWstoreconst {
break
}
- a := x.AuxInt
- if x.Aux != s {
+ a := auxIntToValAndOff(x.AuxInt)
+ if auxToSym(x.Aux) != s {
break
}
mem := x.Args[1]
p0 := x.Args[0]
- if !(x.Uses == 1 && ValAndOff(a).Off() == ValAndOff(c).Off() && sequentialAddresses(p0, p1, 2) && clobber(x)) {
+ if !(x.Uses == 1 && a.Off() == c.Off() && sequentialAddresses(p0, p1, 2) && clobber(x)) {
break
}
v.reset(Op386MOVLstoreconst)
- v.AuxInt = makeValAndOff(ValAndOff(a).Val()&0xffff|ValAndOff(c).Val()<<16, ValAndOff(a).Off())
- v.Aux = s
+ v.AuxInt = valAndOffToAuxInt(makeValAndOff32(int32(a.Val()&0xffff|c.Val()<<16), int32(a.Off())))
+ v.Aux = symToAux(s)
v.AddArg2(p0, mem)
return true
}
// match: (MOVWstoreconst [a] {s} p0 x:(MOVWstoreconst [c] {s} p1 mem))
- // cond: x.Uses == 1 && ValAndOff(a).Off() == ValAndOff(c).Off() && sequentialAddresses(p0, p1, 2) && clobber(x)
- // result: (MOVLstoreconst [makeValAndOff(ValAndOff(a).Val()&0xffff | ValAndOff(c).Val()<<16, ValAndOff(a).Off())] {s} p0 mem)
+ // cond: x.Uses == 1 && a.Off() == c.Off() && sequentialAddresses(p0, p1, 2) && clobber(x)
+ // result: (MOVLstoreconst [makeValAndOff32(int32(a.Val()&0xffff | c.Val()<<16), int32(a.Off()))] {s} p0 mem)
for {
- a := v.AuxInt
- s := v.Aux
+ a := auxIntToValAndOff(v.AuxInt)
+ s := auxToSym(v.Aux)
p0 := v_0
x := v_1
if x.Op != Op386MOVWstoreconst {
break
}
- c := x.AuxInt
- if x.Aux != s {
+ c := auxIntToValAndOff(x.AuxInt)
+ if auxToSym(x.Aux) != s {
break
}
mem := x.Args[1]
p1 := x.Args[0]
- if !(x.Uses == 1 && ValAndOff(a).Off() == ValAndOff(c).Off() && sequentialAddresses(p0, p1, 2) && clobber(x)) {
+ if !(x.Uses == 1 && a.Off() == c.Off() && sequentialAddresses(p0, p1, 2) && clobber(x)) {
break
}
v.reset(Op386MOVLstoreconst)
- v.AuxInt = makeValAndOff(ValAndOff(a).Val()&0xffff|ValAndOff(c).Val()<<16, ValAndOff(a).Off())
- v.Aux = s
+ v.AuxInt = valAndOffToAuxInt(makeValAndOff32(int32(a.Val()&0xffff|c.Val()<<16), int32(a.Off())))
+ v.Aux = symToAux(s)
v.AddArg2(p0, mem)
return true
}
return true
}
// match: (MULLconst [c] (MOVLconst [d]))
- // result: (MOVLconst [int64(int32(c*d))])
+ // result: (MOVLconst [c*d])
for {
- c := v.AuxInt
+ c := auxIntToInt32(v.AuxInt)
if v_0.Op != Op386MOVLconst {
break
}
- d := v_0.AuxInt
+ d := auxIntToInt32(v_0.AuxInt)
v.reset(Op386MOVLconst)
- v.AuxInt = int64(int32(c * d))
+ v.AuxInt = int32ToAuxInt(c * d)
return true
}
return false
func rewriteValue386_Op386NEGL(v *Value) bool {
v_0 := v.Args[0]
// match: (NEGL (MOVLconst [c]))
- // result: (MOVLconst [int64(int32(-c))])
+ // result: (MOVLconst [-c])
for {
if v_0.Op != Op386MOVLconst {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt32(v_0.AuxInt)
v.reset(Op386MOVLconst)
- v.AuxInt = int64(int32(-c))
+ v.AuxInt = int32ToAuxInt(-c)
return true
}
return false
if v_0.Op != Op386MOVLconst {
break
}
- c := v_0.AuxInt
+ c := auxIntToInt32(v_0.AuxInt)
v.reset(Op386MOVLconst)
- v.AuxInt = ^c
+ v.AuxInt = int32ToAuxInt(^c)
return true
}
return false
if x0.Op != Op386MOVBload {
continue
}
- i0 := x0.AuxInt
- s := x0.Aux
+ i0 := auxIntToInt32(x0.AuxInt)
+ s := auxToSym(x0.Aux)
mem := x0.Args[1]
p := x0.Args[0]
s0 := v_1
- if s0.Op != Op386SHLLconst || s0.AuxInt != 8 {
+ if s0.Op != Op386SHLLconst || auxIntToInt32(s0.AuxInt) != 8 {
continue
}
x1 := s0.Args[0]
if x1.Op != Op386MOVBload {
continue
}
- i1 := x1.AuxInt
- if x1.Aux != s {
+ i1 := auxIntToInt32(x1.AuxInt)
+ if auxToSym(x1.Aux) != s {
continue
}
_ = x1.Args[1]
b = mergePoint(b, x0, x1)
v0 := b.NewValue0(x1.Pos, Op386MOVWload, typ.UInt16)
v.copyOf(v0)
- v0.AuxInt = i0
- v0.Aux = s
+ v0.AuxInt = int32ToAuxInt(i0)
+ v0.Aux = symToAux(s)
v0.AddArg2(p, mem)
return true
}
if x0.Op != Op386MOVBload {
continue
}
- i := x0.AuxInt
- s := x0.Aux
+ i := auxIntToInt32(x0.AuxInt)
+ s := auxToSym(x0.Aux)
mem := x0.Args[1]
p0 := x0.Args[0]
s0 := v_1
- if s0.Op != Op386SHLLconst || s0.AuxInt != 8 {
+ if s0.Op != Op386SHLLconst || auxIntToInt32(s0.AuxInt) != 8 {
continue
}
x1 := s0.Args[0]
- if x1.Op != Op386MOVBload || x1.AuxInt != i || x1.Aux != s {
+ if x1.Op != Op386MOVBload || auxIntToInt32(x1.AuxInt) != i || auxToSym(x1.Aux) != s {
continue
}
_ = x1.Args[1]
b = mergePoint(b, x0, x1)
v0 := b.NewValue0(x1.Pos, Op386MOVWload, typ.UInt16)
v.copyOf(v0)
- v0.AuxInt = i
- v0.Aux = s
+ v0.AuxInt = int32ToAuxInt(i)
+ v0.Aux = symToAux(s)
v0.AddArg2(p0, mem)
return true
}
if x0.Op != Op386MOVWload {
continue
}
- i0 := x0.AuxInt
- s := x0.Aux
+ i0 := auxIntToInt32(x0.AuxInt)
+ s := auxToSym(x0.Aux)
mem := x0.Args[1]
p := x0.Args[0]
s0 := o0_1
- if s0.Op != Op386SHLLconst || s0.AuxInt != 16 {
+ if s0.Op != Op386SHLLconst || auxIntToInt32(s0.AuxInt) != 16 {
continue
}
x1 := s0.Args[0]
if x1.Op != Op386MOVBload {
continue
}
- i2 := x1.AuxInt
- if x1.Aux != s {
+ i2 := auxIntToInt32(x1.AuxInt)
+ if auxToSym(x1.Aux) != s {
continue
}
_ = x1.Args[1]
continue
}
s1 := v_1
- if s1.Op != Op386SHLLconst || s1.AuxInt != 24 {
+ if s1.Op != Op386SHLLconst || auxIntToInt32(s1.AuxInt) != 24 {
continue
}
x2 := s1.Args[0]
if x2.Op != Op386MOVBload {
continue
}
- i3 := x2.AuxInt
- if x2.Aux != s {
+ i3 := auxIntToInt32(x2.AuxInt)
+ if auxToSym(x2.Aux) != s {
continue
}
_ = x2.Args[1]
b = mergePoint(b, x0, x1, x2)
v0 := b.NewValue0(x2.Pos, Op386MOVLload, typ.UInt32)
v.copyOf(v0)
- v0.AuxInt = i0
- v0.Aux = s
+ v0.AuxInt = int32ToAuxInt(i0)
+ v0.Aux = symToAux(s)
v0.AddArg2(p, mem)
return true
}
if x0.Op != Op386MOVWload {
continue
}
- i := x0.AuxInt
- s := x0.Aux
+ i := auxIntToInt32(x0.AuxInt)
+ s := auxToSym(x0.Aux)
mem := x0.Args[1]
p0 := x0.Args[0]
s0 := o0_1
- if s0.Op != Op386SHLLconst || s0.AuxInt != 16 {
+ if s0.Op != Op386SHLLconst || auxIntToInt32(s0.AuxInt) != 16 {
continue
}
x1 := s0.Args[0]
- if x1.Op != Op386MOVBload || x1.AuxInt != i || x1.Aux != s {
+ if x1.Op != Op386MOVBload || auxIntToInt32(x1.AuxInt) != i || auxToSym(x1.Aux) != s {
continue
}
_ = x1.Args[1]
continue
}
s1 := v_1
- if s1.Op != Op386SHLLconst || s1.AuxInt != 24 {
+ if s1.Op != Op386SHLLconst || auxIntToInt32(s1.AuxInt) != 24 {
continue
}
x2 := s1.Args[0]
- if x2.Op != Op386MOVBload || x2.AuxInt != i || x2.Aux != s {
+ if x2.Op != Op386MOVBload || auxIntToInt32(x2.AuxInt) != i || auxToSym(x2.Aux) != s {
continue
}
_ = x2.Args[1]
b = mergePoint(b, x0, x1, x2)
v0 := b.NewValue0(x2.Pos, Op386MOVLload, typ.UInt32)
v.copyOf(v0)
- v0.AuxInt = i
- v0.Aux = s
+ v0.AuxInt = int32ToAuxInt(i)
+ v0.Aux = symToAux(s)
v0.AddArg2(p0, mem)
return true
}
func rewriteValue386_Op386ORLconst(v *Value) bool {
v_0 := v.Args[0]
// match: (ORLconst [c] x)
- // cond: int32(c)==0
+ // cond: c==0
// result: x
for {
- c := v.AuxInt
+ c := auxIntToInt32(v.AuxInt)
x := v_0
- if !(int32(c) == 0) {
+ if !(c == 0) {
break
}
v.copyOf(x)
return true
}
// match: (ORLconst [c] _)
- // cond: int32(c)==-1
+ // cond: c==-1
// result: (MOVLconst [-1])
for {
- c := v.AuxInt
- if !(int32(c) == -1) {
+ c := auxIntToInt32(v.AuxInt)
+ if !(c == -1) {
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = -1
+ v.AuxInt = int32ToAuxInt(-1)
return true
}
// match: (ORLconst [c] (MOVLconst [d]))
// result: (MOVLconst [c|d])
for {
- c := v.AuxInt
+ c := auxIntToInt32(v.AuxInt)
if v_0.Op != Op386MOVLconst {
break
}
- d := v_0.AuxInt
+ d := auxIntToInt32(v_0.AuxInt)
v.reset(Op386MOVLconst)
- v.AuxInt = c | d
+ v.AuxInt = int32ToAuxInt(c | d)
return true
}
return false
// match: (SARBconst [c] (MOVLconst [d]))
// result: (MOVLconst [d>>uint64(c)])
for {
- c := v.AuxInt
+ c := auxIntToInt8(v.AuxInt)
if v_0.Op != Op386MOVLconst {
break
}
- d := v_0.AuxInt
+ d := auxIntToInt32(v_0.AuxInt)
v.reset(Op386MOVLconst)
- v.AuxInt = d >> uint64(c)
+ v.AuxInt = int32ToAuxInt(d >> uint64(c))
return true
}
return false
// match: (SARLconst [c] (MOVLconst [d]))
// result: (MOVLconst [d>>uint64(c)])
for {
- c := v.AuxInt
+ c := auxIntToInt32(v.AuxInt)
if v_0.Op != Op386MOVLconst {
break
}
- d := v_0.AuxInt
+ d := auxIntToInt32(v_0.AuxInt)
v.reset(Op386MOVLconst)
- v.AuxInt = d >> uint64(c)
+ v.AuxInt = int32ToAuxInt(d >> uint64(c))
return true
}
return false
// match: (SARWconst [c] (MOVLconst [d]))
// result: (MOVLconst [d>>uint64(c)])
for {
- c := v.AuxInt
+ c := auxIntToInt16(v.AuxInt)
if v_0.Op != Op386MOVLconst {
break
}
- d := v_0.AuxInt
+ d := auxIntToInt32(v_0.AuxInt)
v.reset(Op386MOVLconst)
- v.AuxInt = d >> uint64(c)
+ v.AuxInt = int32ToAuxInt(d >> uint64(c))
return true
}
return false
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
// match: (SBBLcarrymask (FlagLT_ULT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = -1
+ v.AuxInt = int32ToAuxInt(-1)
return true
}
// match: (SBBLcarrymask (FlagLT_UGT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
// match: (SBBLcarrymask (FlagGT_ULT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = -1
+ v.AuxInt = int32ToAuxInt(-1)
return true
}
// match: (SBBLcarrymask (FlagGT_UGT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
return false
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
// match: (SETA (FlagLT_ULT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
// match: (SETA (FlagLT_UGT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 1
+ v.AuxInt = int32ToAuxInt(1)
return true
}
// match: (SETA (FlagGT_ULT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
// match: (SETA (FlagGT_UGT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 1
+ v.AuxInt = int32ToAuxInt(1)
return true
}
return false
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 1
+ v.AuxInt = int32ToAuxInt(1)
return true
}
// match: (SETAE (FlagLT_ULT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
// match: (SETAE (FlagLT_UGT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 1
+ v.AuxInt = int32ToAuxInt(1)
return true
}
// match: (SETAE (FlagGT_ULT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
// match: (SETAE (FlagGT_UGT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 1
+ v.AuxInt = int32ToAuxInt(1)
return true
}
return false
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
// match: (SETB (FlagLT_ULT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 1
+ v.AuxInt = int32ToAuxInt(1)
return true
}
// match: (SETB (FlagLT_UGT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
// match: (SETB (FlagGT_ULT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 1
+ v.AuxInt = int32ToAuxInt(1)
return true
}
// match: (SETB (FlagGT_UGT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
return false
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 1
+ v.AuxInt = int32ToAuxInt(1)
return true
}
// match: (SETBE (FlagLT_ULT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 1
+ v.AuxInt = int32ToAuxInt(1)
return true
}
// match: (SETBE (FlagLT_UGT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
// match: (SETBE (FlagGT_ULT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 1
+ v.AuxInt = int32ToAuxInt(1)
return true
}
// match: (SETBE (FlagGT_UGT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
return false
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 1
+ v.AuxInt = int32ToAuxInt(1)
return true
}
// match: (SETEQ (FlagLT_ULT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
// match: (SETEQ (FlagLT_UGT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
// match: (SETEQ (FlagGT_ULT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
// match: (SETEQ (FlagGT_UGT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
return false
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
// match: (SETG (FlagLT_ULT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
// match: (SETG (FlagLT_UGT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
// match: (SETG (FlagGT_ULT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 1
+ v.AuxInt = int32ToAuxInt(1)
return true
}
// match: (SETG (FlagGT_UGT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 1
+ v.AuxInt = int32ToAuxInt(1)
return true
}
return false
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 1
+ v.AuxInt = int32ToAuxInt(1)
return true
}
// match: (SETGE (FlagLT_ULT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
// match: (SETGE (FlagLT_UGT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
// match: (SETGE (FlagGT_ULT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 1
+ v.AuxInt = int32ToAuxInt(1)
return true
}
// match: (SETGE (FlagGT_UGT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 1
+ v.AuxInt = int32ToAuxInt(1)
return true
}
return false
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
// match: (SETL (FlagLT_ULT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 1
+ v.AuxInt = int32ToAuxInt(1)
return true
}
// match: (SETL (FlagLT_UGT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 1
+ v.AuxInt = int32ToAuxInt(1)
return true
}
// match: (SETL (FlagGT_ULT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
// match: (SETL (FlagGT_UGT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
return false
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 1
+ v.AuxInt = int32ToAuxInt(1)
return true
}
// match: (SETLE (FlagLT_ULT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 1
+ v.AuxInt = int32ToAuxInt(1)
return true
}
// match: (SETLE (FlagLT_UGT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 1
+ v.AuxInt = int32ToAuxInt(1)
return true
}
// match: (SETLE (FlagGT_ULT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
// match: (SETLE (FlagGT_UGT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
return false
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
// match: (SETNE (FlagLT_ULT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 1
+ v.AuxInt = int32ToAuxInt(1)
return true
}
// match: (SETNE (FlagLT_UGT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 1
+ v.AuxInt = int32ToAuxInt(1)
return true
}
// match: (SETNE (FlagGT_ULT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 1
+ v.AuxInt = int32ToAuxInt(1)
return true
}
// match: (SETNE (FlagGT_UGT))
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 1
+ v.AuxInt = int32ToAuxInt(1)
return true
}
return false
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
return false
func rewriteValue386_Op386SUBLconst(v *Value) bool {
v_0 := v.Args[0]
// match: (SUBLconst [c] x)
- // cond: int32(c) == 0
+ // cond: c==0
// result: x
for {
- c := v.AuxInt
+ c := auxIntToInt32(v.AuxInt)
x := v_0
- if !(int32(c) == 0) {
+ if !(c == 0) {
break
}
v.copyOf(x)
return true
}
// match: (SUBLconst [c] x)
- // result: (ADDLconst [int64(int32(-c))] x)
+ // result: (ADDLconst [-c] x)
for {
- c := v.AuxInt
+ c := auxIntToInt32(v.AuxInt)
x := v_0
v.reset(Op386ADDLconst)
- v.AuxInt = int64(int32(-c))
+ v.AuxInt = int32ToAuxInt(-c)
v.AddArg(x)
return true
}
break
}
v.reset(Op386MOVLconst)
- v.AuxInt = 0
+ v.AuxInt = int32ToAuxInt(0)
return true
}
return false
return true
}
// match: (XORLconst [c] x)
- // cond: int32(c)==0
+ // cond: c==0
// result: x
for {
- c := v.AuxInt
+ c := auxIntToInt32(v.AuxInt)
x := v_0
- if !(int32(c) == 0) {
+ if !(c == 0) {
break
}
v.copyOf(x)
// match: (XORLconst [c] (MOVLconst [d]))
// result: (MOVLconst [c^d])
for {
- c := v.AuxInt
+ c := auxIntToInt32(v.AuxInt)
if v_0.Op != Op386MOVLconst {
break
}
- d := v_0.AuxInt
+ d := auxIntToInt32(v_0.AuxInt)
v.reset(Op386MOVLconst)
- v.AuxInt = c ^ d
+ v.AuxInt = int32ToAuxInt(c ^ d)
return true
}
return false