From: Alberto Donizetti Date: Tue, 21 Apr 2020 11:48:57 +0000 (+0200) Subject: cmd/compile: convert last 386 rules to typed aux X-Git-Tag: go1.15beta1~462 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a95bf77e1a756d3d3a03c73d2898d8553b8b6168;p=gostls13.git cmd/compile: convert last 386 rules to typed aux Passes GOARCH=386 gotip build -toolexec 'toolstash -cmp' -a std Change-Id: I4d1ca83d37ab9f628fc3f1261fe40b81e59137ff Reviewed-on: https://go-review.googlesource.com/c/go/+/229100 Reviewed-by: Keith Randall --- diff --git a/src/cmd/compile/internal/ssa/gen/386.rules b/src/cmd/compile/internal/ssa/gen/386.rules index 9bf85c1d0f..4a8244eb27 100644 --- a/src/cmd/compile/internal/ssa/gen/386.rules +++ b/src/cmd/compile/internal/ssa/gen/386.rules @@ -79,7 +79,7 @@ (Trunc32to8 ...) => (Copy ...) (Trunc32to16 ...) => (Copy ...) -// Lowering float <-> int +// Lowering float-int conversions (Cvt32to32F ...) => (CVTSL2SS ...) (Cvt32to64F ...) => (CVTSL2SD ...) @@ -749,191 +749,191 @@ (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< (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< (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 [c] x) && t.Size()==1 && int8(x)==0 -> (MOVLconst [0]) +// (ANDLconst [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 @@ -946,7 +946,7 @@ && 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))) @@ -956,7 +956,7 @@ && 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) @@ -972,7 +972,7 @@ && 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) @@ -988,125 +988,125 @@ && 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))]) diff --git a/src/cmd/compile/internal/ssa/rewrite386.go b/src/cmd/compile/internal/ssa/rewrite386.go index 1cc2bd434b..b4d2056b3b 100644 --- a/src/cmd/compile/internal/ssa/rewrite386.go +++ b/src/cmd/compile/internal/ssa/rewrite386.go @@ -1112,40 +1112,40 @@ func rewriteValue386_Op386ADDLconst(v *Value) bool { 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 } @@ -1550,24 +1550,24 @@ func rewriteValue386_Op386ANDLconst(v *Value) bool { 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) @@ -1576,13 +1576,13 @@ func rewriteValue386_Op386ANDLconst(v *Value) bool { // 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 @@ -1798,8 +1798,8 @@ func rewriteValue386_Op386CMPB(v *Value) bool { 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 @@ -1807,8 +1807,8 @@ func rewriteValue386_Op386CMPB(v *Value) bool { 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 } @@ -1821,8 +1821,8 @@ func rewriteValue386_Op386CMPB(v *Value) bool { 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)) { @@ -1830,8 +1830,8 @@ func rewriteValue386_Op386CMPB(v *Value) bool { } 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 @@ -1917,15 +1917,15 @@ func rewriteValue386_Op386CMPBconst(v *Value) bool { 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) @@ -1935,7 +1935,7 @@ func rewriteValue386_Op386CMPBconst(v *Value) bool { // cond: l.Uses==1 // result: (TESTB x y) for { - if v.AuxInt != 0 { + if auxIntToInt8(v.AuxInt) != 0 { break } l := v_0 @@ -1953,29 +1953,29 @@ func rewriteValue386_Op386CMPBconst(v *Value) bool { } // 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 @@ -1984,26 +1984,26 @@ func rewriteValue386_Op386CMPBconst(v *Value) bool { 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 } @@ -2014,23 +2014,23 @@ func rewriteValue386_Op386CMPBload(v *Value) bool { 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 } @@ -2091,8 +2091,8 @@ func rewriteValue386_Op386CMPL(v *Value) bool { 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 @@ -2100,8 +2100,8 @@ func rewriteValue386_Op386CMPL(v *Value) bool { 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 } @@ -2114,8 +2114,8 @@ func rewriteValue386_Op386CMPL(v *Value) bool { 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)) { @@ -2123,8 +2123,8 @@ func rewriteValue386_Op386CMPL(v *Value) bool { } 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 @@ -2213,11 +2213,11 @@ func rewriteValue386_Op386CMPLconst(v *Value) bool { // cond: 0 <= n && 0 < c && c <= 32 && (1<>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 @@ -7005,13 +7005,13 @@ func rewriteValue386_Op386SARLconst(v *Value) bool { // 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 @@ -7049,13 +7049,13 @@ func rewriteValue386_Op386SARWconst(v *Value) bool { // 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 @@ -7089,7 +7089,7 @@ func rewriteValue386_Op386SBBLcarrymask(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } // match: (SBBLcarrymask (FlagLT_ULT)) @@ -7099,7 +7099,7 @@ func rewriteValue386_Op386SBBLcarrymask(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = -1 + v.AuxInt = int32ToAuxInt(-1) return true } // match: (SBBLcarrymask (FlagLT_UGT)) @@ -7109,7 +7109,7 @@ func rewriteValue386_Op386SBBLcarrymask(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } // match: (SBBLcarrymask (FlagGT_ULT)) @@ -7119,7 +7119,7 @@ func rewriteValue386_Op386SBBLcarrymask(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = -1 + v.AuxInt = int32ToAuxInt(-1) return true } // match: (SBBLcarrymask (FlagGT_UGT)) @@ -7129,7 +7129,7 @@ func rewriteValue386_Op386SBBLcarrymask(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } return false @@ -7154,7 +7154,7 @@ func rewriteValue386_Op386SETA(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } // match: (SETA (FlagLT_ULT)) @@ -7164,7 +7164,7 @@ func rewriteValue386_Op386SETA(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } // match: (SETA (FlagLT_UGT)) @@ -7174,7 +7174,7 @@ func rewriteValue386_Op386SETA(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 1 + v.AuxInt = int32ToAuxInt(1) return true } // match: (SETA (FlagGT_ULT)) @@ -7184,7 +7184,7 @@ func rewriteValue386_Op386SETA(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } // match: (SETA (FlagGT_UGT)) @@ -7194,7 +7194,7 @@ func rewriteValue386_Op386SETA(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 1 + v.AuxInt = int32ToAuxInt(1) return true } return false @@ -7219,7 +7219,7 @@ func rewriteValue386_Op386SETAE(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 1 + v.AuxInt = int32ToAuxInt(1) return true } // match: (SETAE (FlagLT_ULT)) @@ -7229,7 +7229,7 @@ func rewriteValue386_Op386SETAE(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } // match: (SETAE (FlagLT_UGT)) @@ -7239,7 +7239,7 @@ func rewriteValue386_Op386SETAE(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 1 + v.AuxInt = int32ToAuxInt(1) return true } // match: (SETAE (FlagGT_ULT)) @@ -7249,7 +7249,7 @@ func rewriteValue386_Op386SETAE(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } // match: (SETAE (FlagGT_UGT)) @@ -7259,7 +7259,7 @@ func rewriteValue386_Op386SETAE(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 1 + v.AuxInt = int32ToAuxInt(1) return true } return false @@ -7284,7 +7284,7 @@ func rewriteValue386_Op386SETB(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } // match: (SETB (FlagLT_ULT)) @@ -7294,7 +7294,7 @@ func rewriteValue386_Op386SETB(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 1 + v.AuxInt = int32ToAuxInt(1) return true } // match: (SETB (FlagLT_UGT)) @@ -7304,7 +7304,7 @@ func rewriteValue386_Op386SETB(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } // match: (SETB (FlagGT_ULT)) @@ -7314,7 +7314,7 @@ func rewriteValue386_Op386SETB(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 1 + v.AuxInt = int32ToAuxInt(1) return true } // match: (SETB (FlagGT_UGT)) @@ -7324,7 +7324,7 @@ func rewriteValue386_Op386SETB(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } return false @@ -7349,7 +7349,7 @@ func rewriteValue386_Op386SETBE(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 1 + v.AuxInt = int32ToAuxInt(1) return true } // match: (SETBE (FlagLT_ULT)) @@ -7359,7 +7359,7 @@ func rewriteValue386_Op386SETBE(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 1 + v.AuxInt = int32ToAuxInt(1) return true } // match: (SETBE (FlagLT_UGT)) @@ -7369,7 +7369,7 @@ func rewriteValue386_Op386SETBE(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } // match: (SETBE (FlagGT_ULT)) @@ -7379,7 +7379,7 @@ func rewriteValue386_Op386SETBE(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 1 + v.AuxInt = int32ToAuxInt(1) return true } // match: (SETBE (FlagGT_UGT)) @@ -7389,7 +7389,7 @@ func rewriteValue386_Op386SETBE(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } return false @@ -7414,7 +7414,7 @@ func rewriteValue386_Op386SETEQ(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 1 + v.AuxInt = int32ToAuxInt(1) return true } // match: (SETEQ (FlagLT_ULT)) @@ -7424,7 +7424,7 @@ func rewriteValue386_Op386SETEQ(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } // match: (SETEQ (FlagLT_UGT)) @@ -7434,7 +7434,7 @@ func rewriteValue386_Op386SETEQ(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } // match: (SETEQ (FlagGT_ULT)) @@ -7444,7 +7444,7 @@ func rewriteValue386_Op386SETEQ(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } // match: (SETEQ (FlagGT_UGT)) @@ -7454,7 +7454,7 @@ func rewriteValue386_Op386SETEQ(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } return false @@ -7479,7 +7479,7 @@ func rewriteValue386_Op386SETG(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } // match: (SETG (FlagLT_ULT)) @@ -7489,7 +7489,7 @@ func rewriteValue386_Op386SETG(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } // match: (SETG (FlagLT_UGT)) @@ -7499,7 +7499,7 @@ func rewriteValue386_Op386SETG(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } // match: (SETG (FlagGT_ULT)) @@ -7509,7 +7509,7 @@ func rewriteValue386_Op386SETG(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 1 + v.AuxInt = int32ToAuxInt(1) return true } // match: (SETG (FlagGT_UGT)) @@ -7519,7 +7519,7 @@ func rewriteValue386_Op386SETG(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 1 + v.AuxInt = int32ToAuxInt(1) return true } return false @@ -7544,7 +7544,7 @@ func rewriteValue386_Op386SETGE(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 1 + v.AuxInt = int32ToAuxInt(1) return true } // match: (SETGE (FlagLT_ULT)) @@ -7554,7 +7554,7 @@ func rewriteValue386_Op386SETGE(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } // match: (SETGE (FlagLT_UGT)) @@ -7564,7 +7564,7 @@ func rewriteValue386_Op386SETGE(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } // match: (SETGE (FlagGT_ULT)) @@ -7574,7 +7574,7 @@ func rewriteValue386_Op386SETGE(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 1 + v.AuxInt = int32ToAuxInt(1) return true } // match: (SETGE (FlagGT_UGT)) @@ -7584,7 +7584,7 @@ func rewriteValue386_Op386SETGE(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 1 + v.AuxInt = int32ToAuxInt(1) return true } return false @@ -7609,7 +7609,7 @@ func rewriteValue386_Op386SETL(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } // match: (SETL (FlagLT_ULT)) @@ -7619,7 +7619,7 @@ func rewriteValue386_Op386SETL(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 1 + v.AuxInt = int32ToAuxInt(1) return true } // match: (SETL (FlagLT_UGT)) @@ -7629,7 +7629,7 @@ func rewriteValue386_Op386SETL(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 1 + v.AuxInt = int32ToAuxInt(1) return true } // match: (SETL (FlagGT_ULT)) @@ -7639,7 +7639,7 @@ func rewriteValue386_Op386SETL(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } // match: (SETL (FlagGT_UGT)) @@ -7649,7 +7649,7 @@ func rewriteValue386_Op386SETL(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } return false @@ -7674,7 +7674,7 @@ func rewriteValue386_Op386SETLE(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 1 + v.AuxInt = int32ToAuxInt(1) return true } // match: (SETLE (FlagLT_ULT)) @@ -7684,7 +7684,7 @@ func rewriteValue386_Op386SETLE(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 1 + v.AuxInt = int32ToAuxInt(1) return true } // match: (SETLE (FlagLT_UGT)) @@ -7694,7 +7694,7 @@ func rewriteValue386_Op386SETLE(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 1 + v.AuxInt = int32ToAuxInt(1) return true } // match: (SETLE (FlagGT_ULT)) @@ -7704,7 +7704,7 @@ func rewriteValue386_Op386SETLE(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } // match: (SETLE (FlagGT_UGT)) @@ -7714,7 +7714,7 @@ func rewriteValue386_Op386SETLE(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } return false @@ -7739,7 +7739,7 @@ func rewriteValue386_Op386SETNE(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } // match: (SETNE (FlagLT_ULT)) @@ -7749,7 +7749,7 @@ func rewriteValue386_Op386SETNE(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 1 + v.AuxInt = int32ToAuxInt(1) return true } // match: (SETNE (FlagLT_UGT)) @@ -7759,7 +7759,7 @@ func rewriteValue386_Op386SETNE(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 1 + v.AuxInt = int32ToAuxInt(1) return true } // match: (SETNE (FlagGT_ULT)) @@ -7769,7 +7769,7 @@ func rewriteValue386_Op386SETNE(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 1 + v.AuxInt = int32ToAuxInt(1) return true } // match: (SETNE (FlagGT_UGT)) @@ -7779,7 +7779,7 @@ func rewriteValue386_Op386SETNE(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 1 + v.AuxInt = int32ToAuxInt(1) return true } return false @@ -8036,7 +8036,7 @@ func rewriteValue386_Op386SUBL(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } return false @@ -8062,24 +8062,24 @@ func rewriteValue386_Op386SUBLcarry(v *Value) bool { 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 } @@ -8480,7 +8480,7 @@ func rewriteValue386_Op386XORL(v *Value) bool { break } v.reset(Op386MOVLconst) - v.AuxInt = 0 + v.AuxInt = int32ToAuxInt(0) return true } return false @@ -8502,12 +8502,12 @@ func rewriteValue386_Op386XORLconst(v *Value) bool { 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) @@ -8516,13 +8516,13 @@ func rewriteValue386_Op386XORLconst(v *Value) bool { // 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