From dc9879e8fde3af804ac310ee54cf67efdae26aab Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Sun, 12 Apr 2020 17:11:25 -0700 Subject: [PATCH] cmd/compile: convert more AMD64.rules lines to typed aux mode Change-Id: Idded860128b1a23680520d8c2b9f6d8620dcfcc7 Reviewed-on: https://go-review.googlesource.com/c/go/+/228077 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: Cherry Zhang --- src/cmd/compile/internal/ssa/gen/AMD64.rules | 302 ++++++------- src/cmd/compile/internal/ssa/gen/rulegen.go | 21 +- src/cmd/compile/internal/ssa/op.go | 4 + src/cmd/compile/internal/ssa/rewrite.go | 18 + src/cmd/compile/internal/ssa/rewriteAMD64.go | 448 +++++++++---------- 5 files changed, 413 insertions(+), 380 deletions(-) diff --git a/src/cmd/compile/internal/ssa/gen/AMD64.rules b/src/cmd/compile/internal/ssa/gen/AMD64.rules index 367e88f2e5..26ad55b413 100644 --- a/src/cmd/compile/internal/ssa/gen/AMD64.rules +++ b/src/cmd/compile/internal/ssa/gen/AMD64.rules @@ -114,191 +114,191 @@ // Lowering extension // Note: we always extend to 64 bits even though some ops don't need that many result bits. -(SignExt8to16 ...) -> (MOVBQSX ...) -(SignExt8to32 ...) -> (MOVBQSX ...) -(SignExt8to64 ...) -> (MOVBQSX ...) -(SignExt16to32 ...) -> (MOVWQSX ...) -(SignExt16to64 ...) -> (MOVWQSX ...) -(SignExt32to64 ...) -> (MOVLQSX ...) +(SignExt8to16 ...) => (MOVBQSX ...) +(SignExt8to32 ...) => (MOVBQSX ...) +(SignExt8to64 ...) => (MOVBQSX ...) +(SignExt16to32 ...) => (MOVWQSX ...) +(SignExt16to64 ...) => (MOVWQSX ...) +(SignExt32to64 ...) => (MOVLQSX ...) -(ZeroExt8to16 ...) -> (MOVBQZX ...) -(ZeroExt8to32 ...) -> (MOVBQZX ...) -(ZeroExt8to64 ...) -> (MOVBQZX ...) -(ZeroExt16to32 ...) -> (MOVWQZX ...) -(ZeroExt16to64 ...) -> (MOVWQZX ...) -(ZeroExt32to64 ...) -> (MOVLQZX ...) +(ZeroExt8to16 ...) => (MOVBQZX ...) +(ZeroExt8to32 ...) => (MOVBQZX ...) +(ZeroExt8to64 ...) => (MOVBQZX ...) +(ZeroExt16to32 ...) => (MOVWQZX ...) +(ZeroExt16to64 ...) => (MOVWQZX ...) +(ZeroExt32to64 ...) => (MOVLQZX ...) -(Slicemask x) -> (SARQconst (NEGQ x) [63]) +(Slicemask x) => (SARQconst (NEGQ x) [63]) -(SpectreIndex x y) -> (CMOVQCC x (MOVQconst [0]) (CMPQ x y)) -(SpectreSliceIndex x y) -> (CMOVQHI x (MOVQconst [0]) (CMPQ x y)) +(SpectreIndex x y) => (CMOVQCC x (MOVQconst [0]) (CMPQ x y)) +(SpectreSliceIndex x y) => (CMOVQHI x (MOVQconst [0]) (CMPQ x y)) // Lowering truncation // Because we ignore high parts of registers, truncates are just copies. -(Trunc16to8 ...) -> (Copy ...) -(Trunc32to8 ...) -> (Copy ...) -(Trunc32to16 ...) -> (Copy ...) -(Trunc64to8 ...) -> (Copy ...) -(Trunc64to16 ...) -> (Copy ...) -(Trunc64to32 ...) -> (Copy ...) +(Trunc16to8 ...) => (Copy ...) +(Trunc32to8 ...) => (Copy ...) +(Trunc32to16 ...) => (Copy ...) +(Trunc64to8 ...) => (Copy ...) +(Trunc64to16 ...) => (Copy ...) +(Trunc64to32 ...) => (Copy ...) // Lowering float <-> int -(Cvt32to32F ...) -> (CVTSL2SS ...) -(Cvt32to64F ...) -> (CVTSL2SD ...) -(Cvt64to32F ...) -> (CVTSQ2SS ...) -(Cvt64to64F ...) -> (CVTSQ2SD ...) +(Cvt32to32F ...) => (CVTSL2SS ...) +(Cvt32to64F ...) => (CVTSL2SD ...) +(Cvt64to32F ...) => (CVTSQ2SS ...) +(Cvt64to64F ...) => (CVTSQ2SD ...) -(Cvt32Fto32 ...) -> (CVTTSS2SL ...) -(Cvt32Fto64 ...) -> (CVTTSS2SQ ...) -(Cvt64Fto32 ...) -> (CVTTSD2SL ...) -(Cvt64Fto64 ...) -> (CVTTSD2SQ ...) +(Cvt32Fto32 ...) => (CVTTSS2SL ...) +(Cvt32Fto64 ...) => (CVTTSS2SQ ...) +(Cvt64Fto32 ...) => (CVTTSD2SL ...) +(Cvt64Fto64 ...) => (CVTTSD2SQ ...) -(Cvt32Fto64F ...) -> (CVTSS2SD ...) -(Cvt64Fto32F ...) -> (CVTSD2SS ...) +(Cvt32Fto64F ...) => (CVTSS2SD ...) +(Cvt64Fto32F ...) => (CVTSD2SS ...) -(Round(32|64)F ...) -> (Copy ...) +(Round(32|64)F ...) => (Copy ...) -(CvtBoolToUint8 ...) -> (Copy ...) +(CvtBoolToUint8 ...) => (Copy ...) // Lowering shifts // Unsigned shifts need to return 0 if shift amount is >= width of shifted value. // result = (arg << shift) & (shift >= argbits ? 0 : 0xffffffffffffffff) -(Lsh64x(64|32|16|8) x y) && !shiftIsBounded(v) -> (ANDQ (SHLQ x y) (SBBQcarrymask (CMP(Q|L|W|B)const y [64]))) -(Lsh32x(64|32|16|8) x y) && !shiftIsBounded(v) -> (ANDL (SHLL x y) (SBBLcarrymask (CMP(Q|L|W|B)const y [32]))) -(Lsh16x(64|32|16|8) x y) && !shiftIsBounded(v) -> (ANDL (SHLL x y) (SBBLcarrymask (CMP(Q|L|W|B)const y [32]))) -(Lsh8x(64|32|16|8) x y) && !shiftIsBounded(v) -> (ANDL (SHLL x y) (SBBLcarrymask (CMP(Q|L|W|B)const y [32]))) - -(Lsh64x(64|32|16|8) x y) && shiftIsBounded(v) -> (SHLQ x y) -(Lsh32x(64|32|16|8) x y) && shiftIsBounded(v) -> (SHLL x y) -(Lsh16x(64|32|16|8) x y) && shiftIsBounded(v) -> (SHLL x y) -(Lsh8x(64|32|16|8) x y) && shiftIsBounded(v) -> (SHLL x y) - -(Rsh64Ux(64|32|16|8) x y) && !shiftIsBounded(v) -> (ANDQ (SHRQ x y) (SBBQcarrymask (CMP(Q|L|W|B)const y [64]))) -(Rsh32Ux(64|32|16|8) x y) && !shiftIsBounded(v) -> (ANDL (SHRL x y) (SBBLcarrymask (CMP(Q|L|W|B)const y [32]))) -(Rsh16Ux(64|32|16|8) x y) && !shiftIsBounded(v) -> (ANDL (SHRW x y) (SBBLcarrymask (CMP(Q|L|W|B)const y [16]))) -(Rsh8Ux(64|32|16|8) x y) && !shiftIsBounded(v) -> (ANDL (SHRB x y) (SBBLcarrymask (CMP(Q|L|W|B)const y [8]))) - -(Rsh64Ux(64|32|16|8) x y) && shiftIsBounded(v) -> (SHRQ x y) -(Rsh32Ux(64|32|16|8) x y) && shiftIsBounded(v) -> (SHRL x y) -(Rsh16Ux(64|32|16|8) x y) && shiftIsBounded(v) -> (SHRW x y) -(Rsh8Ux(64|32|16|8) x y) && shiftIsBounded(v) -> (SHRB x y) +(Lsh64x(64|32|16|8) x y) && !shiftIsBounded(v) => (ANDQ (SHLQ x y) (SBBQcarrymask (CMP(Q|L|W|B)const y [64]))) +(Lsh32x(64|32|16|8) x y) && !shiftIsBounded(v) => (ANDL (SHLL x y) (SBBLcarrymask (CMP(Q|L|W|B)const y [32]))) +(Lsh16x(64|32|16|8) x y) && !shiftIsBounded(v) => (ANDL (SHLL x y) (SBBLcarrymask (CMP(Q|L|W|B)const y [32]))) +(Lsh8x(64|32|16|8) x y) && !shiftIsBounded(v) => (ANDL (SHLL x y) (SBBLcarrymask (CMP(Q|L|W|B)const y [32]))) + +(Lsh64x(64|32|16|8) x y) && shiftIsBounded(v) => (SHLQ x y) +(Lsh32x(64|32|16|8) x y) && shiftIsBounded(v) => (SHLL x y) +(Lsh16x(64|32|16|8) x y) && shiftIsBounded(v) => (SHLL x y) +(Lsh8x(64|32|16|8) x y) && shiftIsBounded(v) => (SHLL x y) + +(Rsh64Ux(64|32|16|8) x y) && !shiftIsBounded(v) => (ANDQ (SHRQ x y) (SBBQcarrymask (CMP(Q|L|W|B)const y [64]))) +(Rsh32Ux(64|32|16|8) x y) && !shiftIsBounded(v) => (ANDL (SHRL x y) (SBBLcarrymask (CMP(Q|L|W|B)const y [32]))) +(Rsh16Ux(64|32|16|8) x y) && !shiftIsBounded(v) => (ANDL (SHRW x y) (SBBLcarrymask (CMP(Q|L|W|B)const y [16]))) +(Rsh8Ux(64|32|16|8) x y) && !shiftIsBounded(v) => (ANDL (SHRB x y) (SBBLcarrymask (CMP(Q|L|W|B)const y [8]))) + +(Rsh64Ux(64|32|16|8) x y) && shiftIsBounded(v) => (SHRQ x y) +(Rsh32Ux(64|32|16|8) x y) && shiftIsBounded(v) => (SHRL x y) +(Rsh16Ux(64|32|16|8) x y) && shiftIsBounded(v) => (SHRW x y) +(Rsh8Ux(64|32|16|8) x y) && shiftIsBounded(v) => (SHRB x y) // Signed right shift needs to return 0/-1 if shift amount is >= width of shifted value. // We implement this by setting the shift value to -1 (all ones) if the shift value is >= width. -(Rsh64x(64|32|16|8) x y) && !shiftIsBounded(v) -> (SARQ x (OR(Q|L|L|L) y (NOT(Q|L|L|L) (SBB(Q|L|L|L)carrymask (CMP(Q|L|W|B)const y [64]))))) -(Rsh32x(64|32|16|8) x y) && !shiftIsBounded(v) -> (SARL x (OR(Q|L|L|L) y (NOT(Q|L|L|L) (SBB(Q|L|L|L)carrymask (CMP(Q|L|W|B)const y [32]))))) -(Rsh16x(64|32|16|8) x y) && !shiftIsBounded(v) -> (SARW x (OR(Q|L|L|L) y (NOT(Q|L|L|L) (SBB(Q|L|L|L)carrymask (CMP(Q|L|W|B)const y [16]))))) -(Rsh8x(64|32|16|8) x y) && !shiftIsBounded(v) -> (SARB x (OR(Q|L|L|L) y (NOT(Q|L|L|L) (SBB(Q|L|L|L)carrymask (CMP(Q|L|W|B)const y [8]))))) +(Rsh64x(64|32|16|8) x y) && !shiftIsBounded(v) => (SARQ x (OR(Q|L|L|L) y (NOT(Q|L|L|L) (SBB(Q|L|L|L)carrymask (CMP(Q|L|W|B)const y [64]))))) +(Rsh32x(64|32|16|8) x y) && !shiftIsBounded(v) => (SARL x (OR(Q|L|L|L) y (NOT(Q|L|L|L) (SBB(Q|L|L|L)carrymask (CMP(Q|L|W|B)const y [32]))))) +(Rsh16x(64|32|16|8) x y) && !shiftIsBounded(v) => (SARW x (OR(Q|L|L|L) y (NOT(Q|L|L|L) (SBB(Q|L|L|L)carrymask (CMP(Q|L|W|B)const y [16]))))) +(Rsh8x(64|32|16|8) x y) && !shiftIsBounded(v) => (SARB x (OR(Q|L|L|L) y (NOT(Q|L|L|L) (SBB(Q|L|L|L)carrymask (CMP(Q|L|W|B)const y [8]))))) -(Rsh64x(64|32|16|8) x y) && shiftIsBounded(v) -> (SARQ x y) -(Rsh32x(64|32|16|8) x y) && shiftIsBounded(v) -> (SARL x y) -(Rsh16x(64|32|16|8) x y) && shiftIsBounded(v) -> (SARW x y) -(Rsh8x(64|32|16|8) x y) && shiftIsBounded(v) -> (SARB x y) +(Rsh64x(64|32|16|8) x y) && shiftIsBounded(v) => (SARQ x y) +(Rsh32x(64|32|16|8) x y) && shiftIsBounded(v) => (SARL x y) +(Rsh16x(64|32|16|8) x y) && shiftIsBounded(v) => (SARW x y) +(Rsh8x(64|32|16|8) x y) && shiftIsBounded(v) => (SARB x y) // Lowering integer comparisons -(Less(64|32|16|8) x y) -> (SETL (CMP(Q|L|W|B) x y)) -(Less(64|32|16|8)U x y) -> (SETB (CMP(Q|L|W|B) x y)) -(Leq(64|32|16|8) x y) -> (SETLE (CMP(Q|L|W|B) x y)) -(Leq(64|32|16|8)U x y) -> (SETBE (CMP(Q|L|W|B) x y)) -(Eq(Ptr|64|32|16|8|B) x y) -> (SETEQ (CMP(Q|Q|L|W|B|B) x y)) -(Neq(Ptr|64|32|16|8|B) x y) -> (SETNE (CMP(Q|Q|L|W|B|B) x y)) +(Less(64|32|16|8) x y) => (SETL (CMP(Q|L|W|B) x y)) +(Less(64|32|16|8)U x y) => (SETB (CMP(Q|L|W|B) x y)) +(Leq(64|32|16|8) x y) => (SETLE (CMP(Q|L|W|B) x y)) +(Leq(64|32|16|8)U x y) => (SETBE (CMP(Q|L|W|B) x y)) +(Eq(Ptr|64|32|16|8|B) x y) => (SETEQ (CMP(Q|Q|L|W|B|B) x y)) +(Neq(Ptr|64|32|16|8|B) x y) => (SETNE (CMP(Q|Q|L|W|B|B) x y)) // Lowering floating point comparisons // Note Go assembler gets UCOMISx operand order wrong, but it is right here // and the operands are reversed when generating assembly language. -(Eq(32|64)F x y) -> (SETEQF (UCOMIS(S|D) x y)) -(Neq(32|64)F x y) -> (SETNEF (UCOMIS(S|D) x y)) +(Eq(32|64)F x y) => (SETEQF (UCOMIS(S|D) x y)) +(Neq(32|64)F x y) => (SETNEF (UCOMIS(S|D) x y)) // Use SETGF/SETGEF with reversed operands to dodge NaN case. -(Less(32|64)F x y) -> (SETGF (UCOMIS(S|D) y x)) -(Leq(32|64)F x y) -> (SETGEF (UCOMIS(S|D) y x)) +(Less(32|64)F x y) => (SETGF (UCOMIS(S|D) y x)) +(Leq(32|64)F x y) => (SETGEF (UCOMIS(S|D) y x)) // Lowering loads -(Load ptr mem) && (is64BitInt(t) || isPtr(t)) -> (MOVQload ptr mem) -(Load ptr mem) && is32BitInt(t) -> (MOVLload ptr mem) -(Load ptr mem) && is16BitInt(t) -> (MOVWload ptr mem) -(Load ptr mem) && (t.IsBoolean() || is8BitInt(t)) -> (MOVBload ptr mem) -(Load ptr mem) && is32BitFloat(t) -> (MOVSSload ptr mem) -(Load ptr mem) && is64BitFloat(t) -> (MOVSDload ptr mem) +(Load ptr mem) && (is64BitInt(t) || isPtr(t)) => (MOVQload ptr mem) +(Load ptr mem) && is32BitInt(t) => (MOVLload ptr mem) +(Load ptr mem) && is16BitInt(t) => (MOVWload ptr mem) +(Load ptr mem) && (t.IsBoolean() || is8BitInt(t)) => (MOVBload ptr mem) +(Load ptr mem) && is32BitFloat(t) => (MOVSSload ptr mem) +(Load ptr mem) && is64BitFloat(t) => (MOVSDload ptr mem) // Lowering stores // These more-specific FP versions of Store pattern should come first. -(Store {t} ptr val mem) && t.(*types.Type).Size() == 8 && is64BitFloat(val.Type) -> (MOVSDstore ptr val mem) -(Store {t} ptr val mem) && t.(*types.Type).Size() == 4 && is32BitFloat(val.Type) -> (MOVSSstore ptr val mem) +(Store {t} ptr val mem) && t.Size() == 8 && is64BitFloat(val.Type) => (MOVSDstore ptr val mem) +(Store {t} ptr val mem) && t.Size() == 4 && is32BitFloat(val.Type) => (MOVSSstore ptr val mem) -(Store {t} ptr val mem) && t.(*types.Type).Size() == 8 -> (MOVQstore ptr val mem) -(Store {t} ptr val mem) && t.(*types.Type).Size() == 4 -> (MOVLstore ptr val mem) -(Store {t} ptr val mem) && t.(*types.Type).Size() == 2 -> (MOVWstore ptr val mem) -(Store {t} ptr val mem) && t.(*types.Type).Size() == 1 -> (MOVBstore ptr val mem) +(Store {t} ptr val mem) && t.Size() == 8 => (MOVQstore ptr val mem) +(Store {t} ptr val mem) && t.Size() == 4 => (MOVLstore ptr val mem) +(Store {t} ptr val mem) && t.Size() == 2 => (MOVWstore ptr val mem) +(Store {t} ptr val mem) && t.Size() == 1 => (MOVBstore ptr val mem) // Lowering moves -(Move [0] _ _ mem) -> mem -(Move [1] dst src mem) -> (MOVBstore dst (MOVBload src mem) mem) -(Move [2] dst src mem) -> (MOVWstore dst (MOVWload src mem) mem) -(Move [4] dst src mem) -> (MOVLstore dst (MOVLload src mem) mem) -(Move [8] dst src mem) -> (MOVQstore dst (MOVQload src mem) mem) -(Move [16] dst src mem) && config.useSSE -> (MOVOstore dst (MOVOload src mem) mem) -(Move [16] dst src mem) && !config.useSSE -> +(Move [0] _ _ mem) => mem +(Move [1] dst src mem) => (MOVBstore dst (MOVBload src mem) mem) +(Move [2] dst src mem) => (MOVWstore dst (MOVWload src mem) mem) +(Move [4] dst src mem) => (MOVLstore dst (MOVLload src mem) mem) +(Move [8] dst src mem) => (MOVQstore dst (MOVQload src mem) mem) +(Move [16] dst src mem) && config.useSSE => (MOVOstore dst (MOVOload src mem) mem) +(Move [16] dst src mem) && !config.useSSE => (MOVQstore [8] dst (MOVQload [8] src mem) (MOVQstore dst (MOVQload src mem) mem)) -(Move [32] dst src mem) -> +(Move [32] dst src mem) => (Move [16] (OffPtr dst [16]) (OffPtr src [16]) (Move [16] dst src mem)) -(Move [48] dst src mem) && config.useSSE -> +(Move [48] dst src mem) && config.useSSE => (Move [32] (OffPtr dst [16]) (OffPtr src [16]) (Move [16] dst src mem)) -(Move [64] dst src mem) && config.useSSE -> +(Move [64] dst src mem) && config.useSSE => (Move [32] (OffPtr dst [32]) (OffPtr src [32]) (Move [32] dst src mem)) -(Move [3] dst src mem) -> +(Move [3] dst src mem) => (MOVBstore [2] dst (MOVBload [2] src mem) (MOVWstore dst (MOVWload src mem) mem)) -(Move [5] dst src mem) -> +(Move [5] dst src mem) => (MOVBstore [4] dst (MOVBload [4] src mem) (MOVLstore dst (MOVLload src mem) mem)) -(Move [6] dst src mem) -> +(Move [6] dst src mem) => (MOVWstore [4] dst (MOVWload [4] src mem) (MOVLstore dst (MOVLload src mem) mem)) -(Move [7] dst src mem) -> +(Move [7] dst src mem) => (MOVLstore [3] dst (MOVLload [3] src mem) (MOVLstore dst (MOVLload src mem) mem)) -(Move [9] dst src mem) -> +(Move [9] dst src mem) => (MOVBstore [8] dst (MOVBload [8] src mem) (MOVQstore dst (MOVQload src mem) mem)) -(Move [10] dst src mem) -> +(Move [10] dst src mem) => (MOVWstore [8] dst (MOVWload [8] src mem) (MOVQstore dst (MOVQload src mem) mem)) -(Move [12] dst src mem) -> +(Move [12] dst src mem) => (MOVLstore [8] dst (MOVLload [8] src mem) (MOVQstore dst (MOVQload src mem) mem)) -(Move [s] dst src mem) && s == 11 || s >= 13 && s <= 15 -> - (MOVQstore [s-8] dst (MOVQload [s-8] src mem) +(Move [s] dst src mem) && s == 11 || s >= 13 && s <= 15 => + (MOVQstore [int32(s-8)] dst (MOVQload [int32(s-8)] src mem) (MOVQstore dst (MOVQload src mem) mem)) // Adjust moves to be a multiple of 16 bytes. (Move [s] dst src mem) - && s > 16 && s%16 != 0 && s%16 <= 8 -> + && s > 16 && s%16 != 0 && s%16 <= 8 => (Move [s-s%16] (OffPtr dst [s%16]) (OffPtr src [s%16]) (MOVQstore dst (MOVQload src mem) mem)) (Move [s] dst src mem) - && s > 16 && s%16 != 0 && s%16 > 8 && config.useSSE -> + && s > 16 && s%16 != 0 && s%16 > 8 && config.useSSE => (Move [s-s%16] (OffPtr dst [s%16]) (OffPtr src [s%16]) (MOVOstore dst (MOVOload src mem) mem)) (Move [s] dst src mem) - && s > 16 && s%16 != 0 && s%16 > 8 && !config.useSSE -> + && s > 16 && s%16 != 0 && s%16 > 8 && !config.useSSE => (Move [s-s%16] (OffPtr dst [s%16]) (OffPtr src [s%16]) @@ -308,7 +308,7 @@ // Medium copying uses a duff device. (Move [s] dst src mem) && s > 64 && s <= 16*64 && s%16 == 0 - && !config.noDuffDevice && logLargeCopy(v, s) -> + && !config.noDuffDevice && logLargeCopy(v, s) => (DUFFCOPY [14*(64-s/16)] dst src mem) // 14 and 64 are magic constants. 14 is the number of bytes to encode: // MOVUPS (SI), X0 @@ -318,71 +318,71 @@ // and 64 is the number of such blocks. See src/runtime/duff_amd64.s:duffcopy. // Large copying uses REP MOVSQ. -(Move [s] dst src mem) && (s > 16*64 || config.noDuffDevice) && s%8 == 0 && logLargeCopy(v, s) -> +(Move [s] dst src mem) && (s > 16*64 || config.noDuffDevice) && s%8 == 0 && logLargeCopy(v, s) => (REPMOVSQ dst src (MOVQconst [s/8]) mem) // Lowering Zero instructions -(Zero [0] _ mem) -> mem -(Zero [1] destptr mem) -> (MOVBstoreconst [0] destptr mem) -(Zero [2] destptr mem) -> (MOVWstoreconst [0] destptr mem) -(Zero [4] destptr mem) -> (MOVLstoreconst [0] destptr mem) -(Zero [8] destptr mem) -> (MOVQstoreconst [0] destptr mem) - -(Zero [3] destptr mem) -> - (MOVBstoreconst [makeValAndOff(0,2)] destptr - (MOVWstoreconst [0] destptr mem)) -(Zero [5] destptr mem) -> - (MOVBstoreconst [makeValAndOff(0,4)] destptr - (MOVLstoreconst [0] destptr mem)) -(Zero [6] destptr mem) -> - (MOVWstoreconst [makeValAndOff(0,4)] destptr - (MOVLstoreconst [0] destptr mem)) -(Zero [7] destptr mem) -> - (MOVLstoreconst [makeValAndOff(0,3)] destptr - (MOVLstoreconst [0] destptr mem)) +(Zero [0] _ mem) => mem +(Zero [1] destptr mem) => (MOVBstoreconst [makeValAndOff32(0,0)] destptr mem) +(Zero [2] destptr mem) => (MOVWstoreconst [makeValAndOff32(0,0)] destptr mem) +(Zero [4] destptr mem) => (MOVLstoreconst [makeValAndOff32(0,0)] destptr mem) +(Zero [8] destptr mem) => (MOVQstoreconst [makeValAndOff32(0,0)] destptr mem) + +(Zero [3] destptr mem) => + (MOVBstoreconst [makeValAndOff32(0,2)] destptr + (MOVWstoreconst [makeValAndOff32(0,0)] destptr mem)) +(Zero [5] destptr mem) => + (MOVBstoreconst [makeValAndOff32(0,4)] destptr + (MOVLstoreconst [makeValAndOff32(0,0)] destptr mem)) +(Zero [6] destptr mem) => + (MOVWstoreconst [makeValAndOff32(0,4)] destptr + (MOVLstoreconst [makeValAndOff32(0,0)] destptr mem)) +(Zero [7] destptr mem) => + (MOVLstoreconst [makeValAndOff32(0,3)] destptr + (MOVLstoreconst [makeValAndOff32(0,0)] destptr mem)) // Strip off any fractional word zeroing. -(Zero [s] destptr mem) && s%8 != 0 && s > 8 && !config.useSSE -> +(Zero [s] destptr mem) && s%8 != 0 && s > 8 && !config.useSSE => (Zero [s-s%8] (OffPtr destptr [s%8]) - (MOVQstoreconst [0] destptr mem)) + (MOVQstoreconst [makeValAndOff32(0,0)] destptr mem)) // Zero small numbers of words directly. -(Zero [16] destptr mem) && !config.useSSE -> - (MOVQstoreconst [makeValAndOff(0,8)] destptr - (MOVQstoreconst [0] destptr mem)) -(Zero [24] destptr mem) && !config.useSSE -> - (MOVQstoreconst [makeValAndOff(0,16)] destptr - (MOVQstoreconst [makeValAndOff(0,8)] destptr - (MOVQstoreconst [0] destptr mem))) -(Zero [32] destptr mem) && !config.useSSE -> - (MOVQstoreconst [makeValAndOff(0,24)] destptr - (MOVQstoreconst [makeValAndOff(0,16)] destptr - (MOVQstoreconst [makeValAndOff(0,8)] destptr - (MOVQstoreconst [0] destptr mem)))) - -(Zero [s] destptr mem) && s > 8 && s < 16 && config.useSSE -> - (MOVQstoreconst [makeValAndOff(0,s-8)] destptr - (MOVQstoreconst [0] destptr mem)) +(Zero [16] destptr mem) && !config.useSSE => + (MOVQstoreconst [makeValAndOff32(0,8)] destptr + (MOVQstoreconst [makeValAndOff32(0,0)] destptr mem)) +(Zero [24] destptr mem) && !config.useSSE => + (MOVQstoreconst [makeValAndOff32(0,16)] destptr + (MOVQstoreconst [makeValAndOff32(0,8)] destptr + (MOVQstoreconst [makeValAndOff32(0,0)] destptr mem))) +(Zero [32] destptr mem) && !config.useSSE => + (MOVQstoreconst [makeValAndOff32(0,24)] destptr + (MOVQstoreconst [makeValAndOff32(0,16)] destptr + (MOVQstoreconst [makeValAndOff32(0,8)] destptr + (MOVQstoreconst [makeValAndOff32(0,0)] destptr mem)))) + +(Zero [s] destptr mem) && s > 8 && s < 16 && config.useSSE => + (MOVQstoreconst [makeValAndOff32(0,int32(s-8))] destptr + (MOVQstoreconst [makeValAndOff32(0,0)] destptr mem)) // Adjust zeros to be a multiple of 16 bytes. -(Zero [s] destptr mem) && s%16 != 0 && s > 16 && s%16 > 8 && config.useSSE -> +(Zero [s] destptr mem) && s%16 != 0 && s > 16 && s%16 > 8 && config.useSSE => (Zero [s-s%16] (OffPtr destptr [s%16]) (MOVOstore destptr (MOVOconst [0]) mem)) -(Zero [s] destptr mem) && s%16 != 0 && s > 16 && s%16 <= 8 && config.useSSE -> +(Zero [s] destptr mem) && s%16 != 0 && s > 16 && s%16 <= 8 && config.useSSE => (Zero [s-s%16] (OffPtr destptr [s%16]) - (MOVQstoreconst [0] destptr mem)) + (MOVQstoreconst [makeValAndOff32(0,0)] destptr mem)) -(Zero [16] destptr mem) && config.useSSE -> +(Zero [16] destptr mem) && config.useSSE => (MOVOstore destptr (MOVOconst [0]) mem) -(Zero [32] destptr mem) && config.useSSE -> +(Zero [32] destptr mem) && config.useSSE => (MOVOstore (OffPtr destptr [16]) (MOVOconst [0]) (MOVOstore destptr (MOVOconst [0]) mem)) -(Zero [48] destptr mem) && config.useSSE -> +(Zero [48] destptr mem) && config.useSSE => (MOVOstore (OffPtr destptr [32]) (MOVOconst [0]) (MOVOstore (OffPtr destptr [16]) (MOVOconst [0]) (MOVOstore destptr (MOVOconst [0]) mem))) -(Zero [64] destptr mem) && config.useSSE -> +(Zero [64] destptr mem) && config.useSSE => (MOVOstore (OffPtr destptr [48]) (MOVOconst [0]) (MOVOstore (OffPtr destptr [32]) (MOVOconst [0]) (MOVOstore (OffPtr destptr [16]) (MOVOconst [0]) @@ -390,13 +390,13 @@ // Medium zeroing uses a duff device. (Zero [s] destptr mem) - && s > 64 && s <= 1024 && s%16 == 0 && !config.noDuffDevice -> + && s > 64 && s <= 1024 && s%16 == 0 && !config.noDuffDevice => (DUFFZERO [s] destptr (MOVOconst [0]) mem) // Large zeroing uses REP STOSQ. (Zero [s] destptr mem) && (s > 1024 || (config.noDuffDevice && s > 64 || !config.useSSE && s > 32)) - && s%8 == 0 -> + && s%8 == 0 => (REPSTOSQ destptr (MOVQconst [s/8]) (MOVQconst [0]) mem) // Lowering constants diff --git a/src/cmd/compile/internal/ssa/gen/rulegen.go b/src/cmd/compile/internal/ssa/gen/rulegen.go index c1a69e6e91..a1d7203a2e 100644 --- a/src/cmd/compile/internal/ssa/gen/rulegen.go +++ b/src/cmd/compile/internal/ssa/gen/rulegen.go @@ -1034,18 +1034,18 @@ func genMatch0(rr *RuleRewrite, arch arch, match, v string, cnt map[string]int, if !token.IsIdentifier(e.name) || rr.declared(e.name) { switch e.field { case "Aux": - rr.add(breakf("auxTo%s(%s.%s) != %s", strings.Title(e.dclType), v, e.field, e.name)) + rr.add(breakf("auxTo%s(%s.%s) != %s", title(e.dclType), v, e.field, e.name)) case "AuxInt": - rr.add(breakf("auxIntTo%s(%s.%s) != %s", strings.Title(e.dclType), v, e.field, e.name)) + rr.add(breakf("auxIntTo%s(%s.%s) != %s", title(e.dclType), v, e.field, e.name)) case "Type": rr.add(breakf("%s.%s != %s", v, e.field, e.name)) } } else { switch e.field { case "Aux": - rr.add(declf(e.name, "auxTo%s(%s.%s)", strings.Title(e.dclType), v, e.field)) + rr.add(declf(e.name, "auxTo%s(%s.%s)", title(e.dclType), v, e.field)) case "AuxInt": - rr.add(declf(e.name, "auxIntTo%s(%s.%s)", strings.Title(e.dclType), v, e.field)) + rr.add(declf(e.name, "auxIntTo%s(%s.%s)", title(e.dclType), v, e.field)) case "Type": rr.add(declf(e.name, "%s.%s", v, e.field)) } @@ -1762,7 +1762,8 @@ func (op opData) auxIntType() string { return "int32" case "Int64": return "int64" - //case "Int128": + case "Int128": + return "int128" case "Float32": return "float32" case "Float64": @@ -1780,6 +1781,16 @@ func (op opData) auxIntType() string { } } +func title(s string) string { + if i := strings.Index(s, "."); i >= 0 { + s = s[i+1:] + } + return strings.Title(s) +} + func unTitle(s string) string { + if i := strings.Index(s, "."); i >= 0 { + s = s[i+1:] + } return strings.ToLower(s[:1]) + s[1:] } diff --git a/src/cmd/compile/internal/ssa/op.go b/src/cmd/compile/internal/ssa/op.go index 5ed69fcf7b..9f65e135d3 100644 --- a/src/cmd/compile/internal/ssa/op.go +++ b/src/cmd/compile/internal/ssa/op.go @@ -192,6 +192,10 @@ func (x ValAndOff) add(off int64) int64 { return makeValAndOff(x.Val(), x.Off()+off) } +// int128 is a type that stores a 128-bit constant. +// The only allowed constant right now is 0, so we can cheat quite a bit. +type int128 int64 + type BoundsKind uint8 const ( diff --git a/src/cmd/compile/internal/ssa/rewrite.go b/src/cmd/compile/internal/ssa/rewrite.go index a7f824b914..27036a7244 100644 --- a/src/cmd/compile/internal/ssa/rewrite.go +++ b/src/cmd/compile/internal/ssa/rewrite.go @@ -568,6 +568,12 @@ func auxIntToFloat64(i int64) float64 { func auxIntToValAndOff(i int64) ValAndOff { return ValAndOff(i) } +func auxIntToInt128(x int64) int128 { + if x != 0 { + panic("nonzero int128 not allowed") + } + return 0 +} func boolToAuxInt(b bool) int64 { if b { @@ -596,6 +602,12 @@ func float64ToAuxInt(f float64) int64 { func valAndOffToAuxInt(v ValAndOff) int64 { return int64(v) } +func int128ToAuxInt(x int128) int64 { + if x != 0 { + panic("nonzero int128 not allowed") + } + return 0 +} func auxToString(i interface{}) string { return i.(string) @@ -605,6 +617,9 @@ func auxToSym(i interface{}) Sym { s, _ := i.(Sym) return s } +func auxToType(i interface{}) *types.Type { + return i.(*types.Type) +} func stringToAux(s string) interface{} { return s @@ -612,6 +627,9 @@ func stringToAux(s string) interface{} { func symToAux(s Sym) interface{} { return s } +func typeToAux(t *types.Type) interface{} { + return t +} // uaddOvf reports whether unsigned a+b would overflow. func uaddOvf(a, b int64) bool { diff --git a/src/cmd/compile/internal/ssa/rewriteAMD64.go b/src/cmd/compile/internal/ssa/rewriteAMD64.go index 51b82b15f4..f4f83597eb 100644 --- a/src/cmd/compile/internal/ssa/rewriteAMD64.go +++ b/src/cmd/compile/internal/ssa/rewriteAMD64.go @@ -30355,7 +30355,7 @@ func rewriteValueAMD64_OpLsh16x16(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPWconst, types.TypeFlags) - v2.AuxInt = 32 + v2.AuxInt = int16ToAuxInt(32) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -30395,7 +30395,7 @@ func rewriteValueAMD64_OpLsh16x32(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPLconst, types.TypeFlags) - v2.AuxInt = 32 + v2.AuxInt = int32ToAuxInt(32) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -30435,7 +30435,7 @@ func rewriteValueAMD64_OpLsh16x64(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPQconst, types.TypeFlags) - v2.AuxInt = 32 + v2.AuxInt = int32ToAuxInt(32) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -30475,7 +30475,7 @@ func rewriteValueAMD64_OpLsh16x8(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPBconst, types.TypeFlags) - v2.AuxInt = 32 + v2.AuxInt = int8ToAuxInt(32) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -30515,7 +30515,7 @@ func rewriteValueAMD64_OpLsh32x16(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPWconst, types.TypeFlags) - v2.AuxInt = 32 + v2.AuxInt = int16ToAuxInt(32) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -30555,7 +30555,7 @@ func rewriteValueAMD64_OpLsh32x32(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPLconst, types.TypeFlags) - v2.AuxInt = 32 + v2.AuxInt = int32ToAuxInt(32) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -30595,7 +30595,7 @@ func rewriteValueAMD64_OpLsh32x64(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPQconst, types.TypeFlags) - v2.AuxInt = 32 + v2.AuxInt = int32ToAuxInt(32) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -30635,7 +30635,7 @@ func rewriteValueAMD64_OpLsh32x8(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPBconst, types.TypeFlags) - v2.AuxInt = 32 + v2.AuxInt = int8ToAuxInt(32) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -30675,7 +30675,7 @@ func rewriteValueAMD64_OpLsh64x16(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBQcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPWconst, types.TypeFlags) - v2.AuxInt = 64 + v2.AuxInt = int16ToAuxInt(64) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -30715,7 +30715,7 @@ func rewriteValueAMD64_OpLsh64x32(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBQcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPLconst, types.TypeFlags) - v2.AuxInt = 64 + v2.AuxInt = int32ToAuxInt(64) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -30755,7 +30755,7 @@ func rewriteValueAMD64_OpLsh64x64(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBQcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPQconst, types.TypeFlags) - v2.AuxInt = 64 + v2.AuxInt = int32ToAuxInt(64) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -30795,7 +30795,7 @@ func rewriteValueAMD64_OpLsh64x8(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBQcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPBconst, types.TypeFlags) - v2.AuxInt = 64 + v2.AuxInt = int8ToAuxInt(64) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -30835,7 +30835,7 @@ func rewriteValueAMD64_OpLsh8x16(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPWconst, types.TypeFlags) - v2.AuxInt = 32 + v2.AuxInt = int16ToAuxInt(32) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -30875,7 +30875,7 @@ func rewriteValueAMD64_OpLsh8x32(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPLconst, types.TypeFlags) - v2.AuxInt = 32 + v2.AuxInt = int32ToAuxInt(32) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -30915,7 +30915,7 @@ func rewriteValueAMD64_OpLsh8x64(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPQconst, types.TypeFlags) - v2.AuxInt = 32 + v2.AuxInt = int32ToAuxInt(32) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -30955,7 +30955,7 @@ func rewriteValueAMD64_OpLsh8x8(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPBconst, types.TypeFlags) - v2.AuxInt = 32 + v2.AuxInt = int8ToAuxInt(32) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -31136,7 +31136,7 @@ func rewriteValueAMD64_OpMove(v *Value) bool { // match: (Move [0] _ _ mem) // result: mem for { - if v.AuxInt != 0 { + if auxIntToInt64(v.AuxInt) != 0 { break } mem := v_2 @@ -31146,7 +31146,7 @@ func rewriteValueAMD64_OpMove(v *Value) bool { // match: (Move [1] dst src mem) // result: (MOVBstore dst (MOVBload src mem) mem) for { - if v.AuxInt != 1 { + if auxIntToInt64(v.AuxInt) != 1 { break } dst := v_0 @@ -31161,7 +31161,7 @@ func rewriteValueAMD64_OpMove(v *Value) bool { // match: (Move [2] dst src mem) // result: (MOVWstore dst (MOVWload src mem) mem) for { - if v.AuxInt != 2 { + if auxIntToInt64(v.AuxInt) != 2 { break } dst := v_0 @@ -31176,7 +31176,7 @@ func rewriteValueAMD64_OpMove(v *Value) bool { // match: (Move [4] dst src mem) // result: (MOVLstore dst (MOVLload src mem) mem) for { - if v.AuxInt != 4 { + if auxIntToInt64(v.AuxInt) != 4 { break } dst := v_0 @@ -31191,7 +31191,7 @@ func rewriteValueAMD64_OpMove(v *Value) bool { // match: (Move [8] dst src mem) // result: (MOVQstore dst (MOVQload src mem) mem) for { - if v.AuxInt != 8 { + if auxIntToInt64(v.AuxInt) != 8 { break } dst := v_0 @@ -31207,7 +31207,7 @@ func rewriteValueAMD64_OpMove(v *Value) bool { // cond: config.useSSE // result: (MOVOstore dst (MOVOload src mem) mem) for { - if v.AuxInt != 16 { + if auxIntToInt64(v.AuxInt) != 16 { break } dst := v_0 @@ -31226,7 +31226,7 @@ func rewriteValueAMD64_OpMove(v *Value) bool { // cond: !config.useSSE // result: (MOVQstore [8] dst (MOVQload [8] src mem) (MOVQstore dst (MOVQload src mem) mem)) for { - if v.AuxInt != 16 { + if auxIntToInt64(v.AuxInt) != 16 { break } dst := v_0 @@ -31236,9 +31236,9 @@ func rewriteValueAMD64_OpMove(v *Value) bool { break } v.reset(OpAMD64MOVQstore) - v.AuxInt = 8 + v.AuxInt = int32ToAuxInt(8) v0 := b.NewValue0(v.Pos, OpAMD64MOVQload, typ.UInt64) - v0.AuxInt = 8 + v0.AuxInt = int32ToAuxInt(8) v0.AddArg2(src, mem) v1 := b.NewValue0(v.Pos, OpAMD64MOVQstore, types.TypeMem) v2 := b.NewValue0(v.Pos, OpAMD64MOVQload, typ.UInt64) @@ -31250,22 +31250,22 @@ func rewriteValueAMD64_OpMove(v *Value) bool { // match: (Move [32] dst src mem) // result: (Move [16] (OffPtr dst [16]) (OffPtr src [16]) (Move [16] dst src mem)) for { - if v.AuxInt != 32 { + if auxIntToInt64(v.AuxInt) != 32 { break } dst := v_0 src := v_1 mem := v_2 v.reset(OpMove) - v.AuxInt = 16 + v.AuxInt = int64ToAuxInt(16) v0 := b.NewValue0(v.Pos, OpOffPtr, dst.Type) - v0.AuxInt = 16 + v0.AuxInt = int64ToAuxInt(16) v0.AddArg(dst) v1 := b.NewValue0(v.Pos, OpOffPtr, src.Type) - v1.AuxInt = 16 + v1.AuxInt = int64ToAuxInt(16) v1.AddArg(src) v2 := b.NewValue0(v.Pos, OpMove, types.TypeMem) - v2.AuxInt = 16 + v2.AuxInt = int64ToAuxInt(16) v2.AddArg3(dst, src, mem) v.AddArg3(v0, v1, v2) return true @@ -31274,7 +31274,7 @@ func rewriteValueAMD64_OpMove(v *Value) bool { // cond: config.useSSE // result: (Move [32] (OffPtr dst [16]) (OffPtr src [16]) (Move [16] dst src mem)) for { - if v.AuxInt != 48 { + if auxIntToInt64(v.AuxInt) != 48 { break } dst := v_0 @@ -31284,15 +31284,15 @@ func rewriteValueAMD64_OpMove(v *Value) bool { break } v.reset(OpMove) - v.AuxInt = 32 + v.AuxInt = int64ToAuxInt(32) v0 := b.NewValue0(v.Pos, OpOffPtr, dst.Type) - v0.AuxInt = 16 + v0.AuxInt = int64ToAuxInt(16) v0.AddArg(dst) v1 := b.NewValue0(v.Pos, OpOffPtr, src.Type) - v1.AuxInt = 16 + v1.AuxInt = int64ToAuxInt(16) v1.AddArg(src) v2 := b.NewValue0(v.Pos, OpMove, types.TypeMem) - v2.AuxInt = 16 + v2.AuxInt = int64ToAuxInt(16) v2.AddArg3(dst, src, mem) v.AddArg3(v0, v1, v2) return true @@ -31301,7 +31301,7 @@ func rewriteValueAMD64_OpMove(v *Value) bool { // cond: config.useSSE // result: (Move [32] (OffPtr dst [32]) (OffPtr src [32]) (Move [32] dst src mem)) for { - if v.AuxInt != 64 { + if auxIntToInt64(v.AuxInt) != 64 { break } dst := v_0 @@ -31311,15 +31311,15 @@ func rewriteValueAMD64_OpMove(v *Value) bool { break } v.reset(OpMove) - v.AuxInt = 32 + v.AuxInt = int64ToAuxInt(32) v0 := b.NewValue0(v.Pos, OpOffPtr, dst.Type) - v0.AuxInt = 32 + v0.AuxInt = int64ToAuxInt(32) v0.AddArg(dst) v1 := b.NewValue0(v.Pos, OpOffPtr, src.Type) - v1.AuxInt = 32 + v1.AuxInt = int64ToAuxInt(32) v1.AddArg(src) v2 := b.NewValue0(v.Pos, OpMove, types.TypeMem) - v2.AuxInt = 32 + v2.AuxInt = int64ToAuxInt(32) v2.AddArg3(dst, src, mem) v.AddArg3(v0, v1, v2) return true @@ -31327,16 +31327,16 @@ func rewriteValueAMD64_OpMove(v *Value) bool { // match: (Move [3] dst src mem) // result: (MOVBstore [2] dst (MOVBload [2] src mem) (MOVWstore dst (MOVWload src mem) mem)) for { - if v.AuxInt != 3 { + if auxIntToInt64(v.AuxInt) != 3 { break } dst := v_0 src := v_1 mem := v_2 v.reset(OpAMD64MOVBstore) - v.AuxInt = 2 + v.AuxInt = int32ToAuxInt(2) v0 := b.NewValue0(v.Pos, OpAMD64MOVBload, typ.UInt8) - v0.AuxInt = 2 + v0.AuxInt = int32ToAuxInt(2) v0.AddArg2(src, mem) v1 := b.NewValue0(v.Pos, OpAMD64MOVWstore, types.TypeMem) v2 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) @@ -31348,16 +31348,16 @@ func rewriteValueAMD64_OpMove(v *Value) bool { // match: (Move [5] dst src mem) // result: (MOVBstore [4] dst (MOVBload [4] src mem) (MOVLstore dst (MOVLload src mem) mem)) for { - if v.AuxInt != 5 { + if auxIntToInt64(v.AuxInt) != 5 { break } dst := v_0 src := v_1 mem := v_2 v.reset(OpAMD64MOVBstore) - v.AuxInt = 4 + v.AuxInt = int32ToAuxInt(4) v0 := b.NewValue0(v.Pos, OpAMD64MOVBload, typ.UInt8) - v0.AuxInt = 4 + v0.AuxInt = int32ToAuxInt(4) v0.AddArg2(src, mem) v1 := b.NewValue0(v.Pos, OpAMD64MOVLstore, types.TypeMem) v2 := b.NewValue0(v.Pos, OpAMD64MOVLload, typ.UInt32) @@ -31369,16 +31369,16 @@ func rewriteValueAMD64_OpMove(v *Value) bool { // match: (Move [6] dst src mem) // result: (MOVWstore [4] dst (MOVWload [4] src mem) (MOVLstore dst (MOVLload src mem) mem)) for { - if v.AuxInt != 6 { + if auxIntToInt64(v.AuxInt) != 6 { break } dst := v_0 src := v_1 mem := v_2 v.reset(OpAMD64MOVWstore) - v.AuxInt = 4 + v.AuxInt = int32ToAuxInt(4) v0 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) - v0.AuxInt = 4 + v0.AuxInt = int32ToAuxInt(4) v0.AddArg2(src, mem) v1 := b.NewValue0(v.Pos, OpAMD64MOVLstore, types.TypeMem) v2 := b.NewValue0(v.Pos, OpAMD64MOVLload, typ.UInt32) @@ -31390,16 +31390,16 @@ func rewriteValueAMD64_OpMove(v *Value) bool { // match: (Move [7] dst src mem) // result: (MOVLstore [3] dst (MOVLload [3] src mem) (MOVLstore dst (MOVLload src mem) mem)) for { - if v.AuxInt != 7 { + if auxIntToInt64(v.AuxInt) != 7 { break } dst := v_0 src := v_1 mem := v_2 v.reset(OpAMD64MOVLstore) - v.AuxInt = 3 + v.AuxInt = int32ToAuxInt(3) v0 := b.NewValue0(v.Pos, OpAMD64MOVLload, typ.UInt32) - v0.AuxInt = 3 + v0.AuxInt = int32ToAuxInt(3) v0.AddArg2(src, mem) v1 := b.NewValue0(v.Pos, OpAMD64MOVLstore, types.TypeMem) v2 := b.NewValue0(v.Pos, OpAMD64MOVLload, typ.UInt32) @@ -31411,16 +31411,16 @@ func rewriteValueAMD64_OpMove(v *Value) bool { // match: (Move [9] dst src mem) // result: (MOVBstore [8] dst (MOVBload [8] src mem) (MOVQstore dst (MOVQload src mem) mem)) for { - if v.AuxInt != 9 { + if auxIntToInt64(v.AuxInt) != 9 { break } dst := v_0 src := v_1 mem := v_2 v.reset(OpAMD64MOVBstore) - v.AuxInt = 8 + v.AuxInt = int32ToAuxInt(8) v0 := b.NewValue0(v.Pos, OpAMD64MOVBload, typ.UInt8) - v0.AuxInt = 8 + v0.AuxInt = int32ToAuxInt(8) v0.AddArg2(src, mem) v1 := b.NewValue0(v.Pos, OpAMD64MOVQstore, types.TypeMem) v2 := b.NewValue0(v.Pos, OpAMD64MOVQload, typ.UInt64) @@ -31432,16 +31432,16 @@ func rewriteValueAMD64_OpMove(v *Value) bool { // match: (Move [10] dst src mem) // result: (MOVWstore [8] dst (MOVWload [8] src mem) (MOVQstore dst (MOVQload src mem) mem)) for { - if v.AuxInt != 10 { + if auxIntToInt64(v.AuxInt) != 10 { break } dst := v_0 src := v_1 mem := v_2 v.reset(OpAMD64MOVWstore) - v.AuxInt = 8 + v.AuxInt = int32ToAuxInt(8) v0 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) - v0.AuxInt = 8 + v0.AuxInt = int32ToAuxInt(8) v0.AddArg2(src, mem) v1 := b.NewValue0(v.Pos, OpAMD64MOVQstore, types.TypeMem) v2 := b.NewValue0(v.Pos, OpAMD64MOVQload, typ.UInt64) @@ -31453,16 +31453,16 @@ func rewriteValueAMD64_OpMove(v *Value) bool { // match: (Move [12] dst src mem) // result: (MOVLstore [8] dst (MOVLload [8] src mem) (MOVQstore dst (MOVQload src mem) mem)) for { - if v.AuxInt != 12 { + if auxIntToInt64(v.AuxInt) != 12 { break } dst := v_0 src := v_1 mem := v_2 v.reset(OpAMD64MOVLstore) - v.AuxInt = 8 + v.AuxInt = int32ToAuxInt(8) v0 := b.NewValue0(v.Pos, OpAMD64MOVLload, typ.UInt32) - v0.AuxInt = 8 + v0.AuxInt = int32ToAuxInt(8) v0.AddArg2(src, mem) v1 := b.NewValue0(v.Pos, OpAMD64MOVQstore, types.TypeMem) v2 := b.NewValue0(v.Pos, OpAMD64MOVQload, typ.UInt64) @@ -31473,9 +31473,9 @@ func rewriteValueAMD64_OpMove(v *Value) bool { } // match: (Move [s] dst src mem) // cond: s == 11 || s >= 13 && s <= 15 - // result: (MOVQstore [s-8] dst (MOVQload [s-8] src mem) (MOVQstore dst (MOVQload src mem) mem)) + // result: (MOVQstore [int32(s-8)] dst (MOVQload [int32(s-8)] src mem) (MOVQstore dst (MOVQload src mem) mem)) for { - s := v.AuxInt + s := auxIntToInt64(v.AuxInt) dst := v_0 src := v_1 mem := v_2 @@ -31483,9 +31483,9 @@ func rewriteValueAMD64_OpMove(v *Value) bool { break } v.reset(OpAMD64MOVQstore) - v.AuxInt = s - 8 + v.AuxInt = int32ToAuxInt(int32(s - 8)) v0 := b.NewValue0(v.Pos, OpAMD64MOVQload, typ.UInt64) - v0.AuxInt = s - 8 + v0.AuxInt = int32ToAuxInt(int32(s - 8)) v0.AddArg2(src, mem) v1 := b.NewValue0(v.Pos, OpAMD64MOVQstore, types.TypeMem) v2 := b.NewValue0(v.Pos, OpAMD64MOVQload, typ.UInt64) @@ -31498,7 +31498,7 @@ func rewriteValueAMD64_OpMove(v *Value) bool { // cond: s > 16 && s%16 != 0 && s%16 <= 8 // result: (Move [s-s%16] (OffPtr dst [s%16]) (OffPtr src [s%16]) (MOVQstore dst (MOVQload src mem) mem)) for { - s := v.AuxInt + s := auxIntToInt64(v.AuxInt) dst := v_0 src := v_1 mem := v_2 @@ -31506,12 +31506,12 @@ func rewriteValueAMD64_OpMove(v *Value) bool { break } v.reset(OpMove) - v.AuxInt = s - s%16 + v.AuxInt = int64ToAuxInt(s - s%16) v0 := b.NewValue0(v.Pos, OpOffPtr, dst.Type) - v0.AuxInt = s % 16 + v0.AuxInt = int64ToAuxInt(s % 16) v0.AddArg(dst) v1 := b.NewValue0(v.Pos, OpOffPtr, src.Type) - v1.AuxInt = s % 16 + v1.AuxInt = int64ToAuxInt(s % 16) v1.AddArg(src) v2 := b.NewValue0(v.Pos, OpAMD64MOVQstore, types.TypeMem) v3 := b.NewValue0(v.Pos, OpAMD64MOVQload, typ.UInt64) @@ -31524,7 +31524,7 @@ func rewriteValueAMD64_OpMove(v *Value) bool { // cond: s > 16 && s%16 != 0 && s%16 > 8 && config.useSSE // result: (Move [s-s%16] (OffPtr dst [s%16]) (OffPtr src [s%16]) (MOVOstore dst (MOVOload src mem) mem)) for { - s := v.AuxInt + s := auxIntToInt64(v.AuxInt) dst := v_0 src := v_1 mem := v_2 @@ -31532,12 +31532,12 @@ func rewriteValueAMD64_OpMove(v *Value) bool { break } v.reset(OpMove) - v.AuxInt = s - s%16 + v.AuxInt = int64ToAuxInt(s - s%16) v0 := b.NewValue0(v.Pos, OpOffPtr, dst.Type) - v0.AuxInt = s % 16 + v0.AuxInt = int64ToAuxInt(s % 16) v0.AddArg(dst) v1 := b.NewValue0(v.Pos, OpOffPtr, src.Type) - v1.AuxInt = s % 16 + v1.AuxInt = int64ToAuxInt(s % 16) v1.AddArg(src) v2 := b.NewValue0(v.Pos, OpAMD64MOVOstore, types.TypeMem) v3 := b.NewValue0(v.Pos, OpAMD64MOVOload, types.TypeInt128) @@ -31550,7 +31550,7 @@ func rewriteValueAMD64_OpMove(v *Value) bool { // cond: s > 16 && s%16 != 0 && s%16 > 8 && !config.useSSE // result: (Move [s-s%16] (OffPtr dst [s%16]) (OffPtr src [s%16]) (MOVQstore [8] dst (MOVQload [8] src mem) (MOVQstore dst (MOVQload src mem) mem))) for { - s := v.AuxInt + s := auxIntToInt64(v.AuxInt) dst := v_0 src := v_1 mem := v_2 @@ -31558,17 +31558,17 @@ func rewriteValueAMD64_OpMove(v *Value) bool { break } v.reset(OpMove) - v.AuxInt = s - s%16 + v.AuxInt = int64ToAuxInt(s - s%16) v0 := b.NewValue0(v.Pos, OpOffPtr, dst.Type) - v0.AuxInt = s % 16 + v0.AuxInt = int64ToAuxInt(s % 16) v0.AddArg(dst) v1 := b.NewValue0(v.Pos, OpOffPtr, src.Type) - v1.AuxInt = s % 16 + v1.AuxInt = int64ToAuxInt(s % 16) v1.AddArg(src) v2 := b.NewValue0(v.Pos, OpAMD64MOVQstore, types.TypeMem) - v2.AuxInt = 8 + v2.AuxInt = int32ToAuxInt(8) v3 := b.NewValue0(v.Pos, OpAMD64MOVQload, typ.UInt64) - v3.AuxInt = 8 + v3.AuxInt = int32ToAuxInt(8) v3.AddArg2(src, mem) v4 := b.NewValue0(v.Pos, OpAMD64MOVQstore, types.TypeMem) v5 := b.NewValue0(v.Pos, OpAMD64MOVQload, typ.UInt64) @@ -31582,7 +31582,7 @@ func rewriteValueAMD64_OpMove(v *Value) bool { // cond: s > 64 && s <= 16*64 && s%16 == 0 && !config.noDuffDevice && logLargeCopy(v, s) // result: (DUFFCOPY [14*(64-s/16)] dst src mem) for { - s := v.AuxInt + s := auxIntToInt64(v.AuxInt) dst := v_0 src := v_1 mem := v_2 @@ -31590,7 +31590,7 @@ func rewriteValueAMD64_OpMove(v *Value) bool { break } v.reset(OpAMD64DUFFCOPY) - v.AuxInt = 14 * (64 - s/16) + v.AuxInt = int64ToAuxInt(14 * (64 - s/16)) v.AddArg3(dst, src, mem) return true } @@ -31598,7 +31598,7 @@ func rewriteValueAMD64_OpMove(v *Value) bool { // cond: (s > 16*64 || config.noDuffDevice) && s%8 == 0 && logLargeCopy(v, s) // result: (REPMOVSQ dst src (MOVQconst [s/8]) mem) for { - s := v.AuxInt + s := auxIntToInt64(v.AuxInt) dst := v_0 src := v_1 mem := v_2 @@ -31607,7 +31607,7 @@ func rewriteValueAMD64_OpMove(v *Value) bool { } v.reset(OpAMD64REPMOVSQ) v0 := b.NewValue0(v.Pos, OpAMD64MOVQconst, typ.UInt64) - v0.AuxInt = s / 8 + v0.AuxInt = int64ToAuxInt(s / 8) v.AddArg4(dst, src, v0, mem) return true } @@ -31928,7 +31928,7 @@ func rewriteValueAMD64_OpRsh16Ux16(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPWconst, types.TypeFlags) - v2.AuxInt = 16 + v2.AuxInt = int16ToAuxInt(16) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -31968,7 +31968,7 @@ func rewriteValueAMD64_OpRsh16Ux32(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPLconst, types.TypeFlags) - v2.AuxInt = 16 + v2.AuxInt = int32ToAuxInt(16) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -32008,7 +32008,7 @@ func rewriteValueAMD64_OpRsh16Ux64(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPQconst, types.TypeFlags) - v2.AuxInt = 16 + v2.AuxInt = int32ToAuxInt(16) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -32048,7 +32048,7 @@ func rewriteValueAMD64_OpRsh16Ux8(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPBconst, types.TypeFlags) - v2.AuxInt = 16 + v2.AuxInt = int8ToAuxInt(16) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -32089,7 +32089,7 @@ func rewriteValueAMD64_OpRsh16x16(v *Value) bool { v1 := b.NewValue0(v.Pos, OpAMD64NOTL, y.Type) v2 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, y.Type) v3 := b.NewValue0(v.Pos, OpAMD64CMPWconst, types.TypeFlags) - v3.AuxInt = 16 + v3.AuxInt = int16ToAuxInt(16) v3.AddArg(y) v2.AddArg(v3) v1.AddArg(v2) @@ -32132,7 +32132,7 @@ func rewriteValueAMD64_OpRsh16x32(v *Value) bool { v1 := b.NewValue0(v.Pos, OpAMD64NOTL, y.Type) v2 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, y.Type) v3 := b.NewValue0(v.Pos, OpAMD64CMPLconst, types.TypeFlags) - v3.AuxInt = 16 + v3.AuxInt = int32ToAuxInt(16) v3.AddArg(y) v2.AddArg(v3) v1.AddArg(v2) @@ -32175,7 +32175,7 @@ func rewriteValueAMD64_OpRsh16x64(v *Value) bool { v1 := b.NewValue0(v.Pos, OpAMD64NOTQ, y.Type) v2 := b.NewValue0(v.Pos, OpAMD64SBBQcarrymask, y.Type) v3 := b.NewValue0(v.Pos, OpAMD64CMPQconst, types.TypeFlags) - v3.AuxInt = 16 + v3.AuxInt = int32ToAuxInt(16) v3.AddArg(y) v2.AddArg(v3) v1.AddArg(v2) @@ -32218,7 +32218,7 @@ func rewriteValueAMD64_OpRsh16x8(v *Value) bool { v1 := b.NewValue0(v.Pos, OpAMD64NOTL, y.Type) v2 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, y.Type) v3 := b.NewValue0(v.Pos, OpAMD64CMPBconst, types.TypeFlags) - v3.AuxInt = 16 + v3.AuxInt = int8ToAuxInt(16) v3.AddArg(y) v2.AddArg(v3) v1.AddArg(v2) @@ -32260,7 +32260,7 @@ func rewriteValueAMD64_OpRsh32Ux16(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPWconst, types.TypeFlags) - v2.AuxInt = 32 + v2.AuxInt = int16ToAuxInt(32) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -32300,7 +32300,7 @@ func rewriteValueAMD64_OpRsh32Ux32(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPLconst, types.TypeFlags) - v2.AuxInt = 32 + v2.AuxInt = int32ToAuxInt(32) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -32340,7 +32340,7 @@ func rewriteValueAMD64_OpRsh32Ux64(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPQconst, types.TypeFlags) - v2.AuxInt = 32 + v2.AuxInt = int32ToAuxInt(32) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -32380,7 +32380,7 @@ func rewriteValueAMD64_OpRsh32Ux8(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPBconst, types.TypeFlags) - v2.AuxInt = 32 + v2.AuxInt = int8ToAuxInt(32) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -32421,7 +32421,7 @@ func rewriteValueAMD64_OpRsh32x16(v *Value) bool { v1 := b.NewValue0(v.Pos, OpAMD64NOTL, y.Type) v2 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, y.Type) v3 := b.NewValue0(v.Pos, OpAMD64CMPWconst, types.TypeFlags) - v3.AuxInt = 32 + v3.AuxInt = int16ToAuxInt(32) v3.AddArg(y) v2.AddArg(v3) v1.AddArg(v2) @@ -32464,7 +32464,7 @@ func rewriteValueAMD64_OpRsh32x32(v *Value) bool { v1 := b.NewValue0(v.Pos, OpAMD64NOTL, y.Type) v2 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, y.Type) v3 := b.NewValue0(v.Pos, OpAMD64CMPLconst, types.TypeFlags) - v3.AuxInt = 32 + v3.AuxInt = int32ToAuxInt(32) v3.AddArg(y) v2.AddArg(v3) v1.AddArg(v2) @@ -32507,7 +32507,7 @@ func rewriteValueAMD64_OpRsh32x64(v *Value) bool { v1 := b.NewValue0(v.Pos, OpAMD64NOTQ, y.Type) v2 := b.NewValue0(v.Pos, OpAMD64SBBQcarrymask, y.Type) v3 := b.NewValue0(v.Pos, OpAMD64CMPQconst, types.TypeFlags) - v3.AuxInt = 32 + v3.AuxInt = int32ToAuxInt(32) v3.AddArg(y) v2.AddArg(v3) v1.AddArg(v2) @@ -32550,7 +32550,7 @@ func rewriteValueAMD64_OpRsh32x8(v *Value) bool { v1 := b.NewValue0(v.Pos, OpAMD64NOTL, y.Type) v2 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, y.Type) v3 := b.NewValue0(v.Pos, OpAMD64CMPBconst, types.TypeFlags) - v3.AuxInt = 32 + v3.AuxInt = int8ToAuxInt(32) v3.AddArg(y) v2.AddArg(v3) v1.AddArg(v2) @@ -32592,7 +32592,7 @@ func rewriteValueAMD64_OpRsh64Ux16(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBQcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPWconst, types.TypeFlags) - v2.AuxInt = 64 + v2.AuxInt = int16ToAuxInt(64) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -32632,7 +32632,7 @@ func rewriteValueAMD64_OpRsh64Ux32(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBQcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPLconst, types.TypeFlags) - v2.AuxInt = 64 + v2.AuxInt = int32ToAuxInt(64) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -32672,7 +32672,7 @@ func rewriteValueAMD64_OpRsh64Ux64(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBQcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPQconst, types.TypeFlags) - v2.AuxInt = 64 + v2.AuxInt = int32ToAuxInt(64) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -32712,7 +32712,7 @@ func rewriteValueAMD64_OpRsh64Ux8(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBQcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPBconst, types.TypeFlags) - v2.AuxInt = 64 + v2.AuxInt = int8ToAuxInt(64) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -32753,7 +32753,7 @@ func rewriteValueAMD64_OpRsh64x16(v *Value) bool { v1 := b.NewValue0(v.Pos, OpAMD64NOTL, y.Type) v2 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, y.Type) v3 := b.NewValue0(v.Pos, OpAMD64CMPWconst, types.TypeFlags) - v3.AuxInt = 64 + v3.AuxInt = int16ToAuxInt(64) v3.AddArg(y) v2.AddArg(v3) v1.AddArg(v2) @@ -32796,7 +32796,7 @@ func rewriteValueAMD64_OpRsh64x32(v *Value) bool { v1 := b.NewValue0(v.Pos, OpAMD64NOTL, y.Type) v2 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, y.Type) v3 := b.NewValue0(v.Pos, OpAMD64CMPLconst, types.TypeFlags) - v3.AuxInt = 64 + v3.AuxInt = int32ToAuxInt(64) v3.AddArg(y) v2.AddArg(v3) v1.AddArg(v2) @@ -32839,7 +32839,7 @@ func rewriteValueAMD64_OpRsh64x64(v *Value) bool { v1 := b.NewValue0(v.Pos, OpAMD64NOTQ, y.Type) v2 := b.NewValue0(v.Pos, OpAMD64SBBQcarrymask, y.Type) v3 := b.NewValue0(v.Pos, OpAMD64CMPQconst, types.TypeFlags) - v3.AuxInt = 64 + v3.AuxInt = int32ToAuxInt(64) v3.AddArg(y) v2.AddArg(v3) v1.AddArg(v2) @@ -32882,7 +32882,7 @@ func rewriteValueAMD64_OpRsh64x8(v *Value) bool { v1 := b.NewValue0(v.Pos, OpAMD64NOTL, y.Type) v2 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, y.Type) v3 := b.NewValue0(v.Pos, OpAMD64CMPBconst, types.TypeFlags) - v3.AuxInt = 64 + v3.AuxInt = int8ToAuxInt(64) v3.AddArg(y) v2.AddArg(v3) v1.AddArg(v2) @@ -32924,7 +32924,7 @@ func rewriteValueAMD64_OpRsh8Ux16(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPWconst, types.TypeFlags) - v2.AuxInt = 8 + v2.AuxInt = int16ToAuxInt(8) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -32964,7 +32964,7 @@ func rewriteValueAMD64_OpRsh8Ux32(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPLconst, types.TypeFlags) - v2.AuxInt = 8 + v2.AuxInt = int32ToAuxInt(8) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -33004,7 +33004,7 @@ func rewriteValueAMD64_OpRsh8Ux64(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPQconst, types.TypeFlags) - v2.AuxInt = 8 + v2.AuxInt = int32ToAuxInt(8) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -33044,7 +33044,7 @@ func rewriteValueAMD64_OpRsh8Ux8(v *Value) bool { v0.AddArg2(x, y) v1 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, t) v2 := b.NewValue0(v.Pos, OpAMD64CMPBconst, types.TypeFlags) - v2.AuxInt = 8 + v2.AuxInt = int8ToAuxInt(8) v2.AddArg(y) v1.AddArg(v2) v.AddArg2(v0, v1) @@ -33085,7 +33085,7 @@ func rewriteValueAMD64_OpRsh8x16(v *Value) bool { v1 := b.NewValue0(v.Pos, OpAMD64NOTL, y.Type) v2 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, y.Type) v3 := b.NewValue0(v.Pos, OpAMD64CMPWconst, types.TypeFlags) - v3.AuxInt = 8 + v3.AuxInt = int16ToAuxInt(8) v3.AddArg(y) v2.AddArg(v3) v1.AddArg(v2) @@ -33128,7 +33128,7 @@ func rewriteValueAMD64_OpRsh8x32(v *Value) bool { v1 := b.NewValue0(v.Pos, OpAMD64NOTL, y.Type) v2 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, y.Type) v3 := b.NewValue0(v.Pos, OpAMD64CMPLconst, types.TypeFlags) - v3.AuxInt = 8 + v3.AuxInt = int32ToAuxInt(8) v3.AddArg(y) v2.AddArg(v3) v1.AddArg(v2) @@ -33171,7 +33171,7 @@ func rewriteValueAMD64_OpRsh8x64(v *Value) bool { v1 := b.NewValue0(v.Pos, OpAMD64NOTQ, y.Type) v2 := b.NewValue0(v.Pos, OpAMD64SBBQcarrymask, y.Type) v3 := b.NewValue0(v.Pos, OpAMD64CMPQconst, types.TypeFlags) - v3.AuxInt = 8 + v3.AuxInt = int32ToAuxInt(8) v3.AddArg(y) v2.AddArg(v3) v1.AddArg(v2) @@ -33214,7 +33214,7 @@ func rewriteValueAMD64_OpRsh8x8(v *Value) bool { v1 := b.NewValue0(v.Pos, OpAMD64NOTL, y.Type) v2 := b.NewValue0(v.Pos, OpAMD64SBBLcarrymask, y.Type) v3 := b.NewValue0(v.Pos, OpAMD64CMPBconst, types.TypeFlags) - v3.AuxInt = 8 + v3.AuxInt = int8ToAuxInt(8) v3.AddArg(y) v2.AddArg(v3) v1.AddArg(v2) @@ -33491,7 +33491,7 @@ func rewriteValueAMD64_OpSlicemask(v *Value) bool { t := v.Type x := v_0 v.reset(OpAMD64SARQconst) - v.AuxInt = 63 + v.AuxInt = int8ToAuxInt(63) v0 := b.NewValue0(v.Pos, OpAMD64NEGQ, t) v0.AddArg(x) v.AddArg(v0) @@ -33510,7 +33510,7 @@ func rewriteValueAMD64_OpSpectreIndex(v *Value) bool { y := v_1 v.reset(OpAMD64CMOVQCC) v0 := b.NewValue0(v.Pos, OpAMD64MOVQconst, typ.UInt64) - v0.AuxInt = 0 + v0.AuxInt = int64ToAuxInt(0) v1 := b.NewValue0(v.Pos, OpAMD64CMPQ, types.TypeFlags) v1.AddArg2(x, y) v.AddArg3(x, v0, v1) @@ -33529,7 +33529,7 @@ func rewriteValueAMD64_OpSpectreSliceIndex(v *Value) bool { y := v_1 v.reset(OpAMD64CMOVQHI) v0 := b.NewValue0(v.Pos, OpAMD64MOVQconst, typ.UInt64) - v0.AuxInt = 0 + v0.AuxInt = int64ToAuxInt(0) v1 := b.NewValue0(v.Pos, OpAMD64CMPQ, types.TypeFlags) v1.AddArg2(x, y) v.AddArg3(x, v0, v1) @@ -33541,14 +33541,14 @@ func rewriteValueAMD64_OpStore(v *Value) bool { v_1 := v.Args[1] v_0 := v.Args[0] // match: (Store {t} ptr val mem) - // cond: t.(*types.Type).Size() == 8 && is64BitFloat(val.Type) + // cond: t.Size() == 8 && is64BitFloat(val.Type) // result: (MOVSDstore ptr val mem) for { - t := v.Aux + t := auxToType(v.Aux) ptr := v_0 val := v_1 mem := v_2 - if !(t.(*types.Type).Size() == 8 && is64BitFloat(val.Type)) { + if !(t.Size() == 8 && is64BitFloat(val.Type)) { break } v.reset(OpAMD64MOVSDstore) @@ -33556,14 +33556,14 @@ func rewriteValueAMD64_OpStore(v *Value) bool { return true } // match: (Store {t} ptr val mem) - // cond: t.(*types.Type).Size() == 4 && is32BitFloat(val.Type) + // cond: t.Size() == 4 && is32BitFloat(val.Type) // result: (MOVSSstore ptr val mem) for { - t := v.Aux + t := auxToType(v.Aux) ptr := v_0 val := v_1 mem := v_2 - if !(t.(*types.Type).Size() == 4 && is32BitFloat(val.Type)) { + if !(t.Size() == 4 && is32BitFloat(val.Type)) { break } v.reset(OpAMD64MOVSSstore) @@ -33571,14 +33571,14 @@ func rewriteValueAMD64_OpStore(v *Value) bool { return true } // match: (Store {t} ptr val mem) - // cond: t.(*types.Type).Size() == 8 + // cond: t.Size() == 8 // result: (MOVQstore ptr val mem) for { - t := v.Aux + t := auxToType(v.Aux) ptr := v_0 val := v_1 mem := v_2 - if !(t.(*types.Type).Size() == 8) { + if !(t.Size() == 8) { break } v.reset(OpAMD64MOVQstore) @@ -33586,14 +33586,14 @@ func rewriteValueAMD64_OpStore(v *Value) bool { return true } // match: (Store {t} ptr val mem) - // cond: t.(*types.Type).Size() == 4 + // cond: t.Size() == 4 // result: (MOVLstore ptr val mem) for { - t := v.Aux + t := auxToType(v.Aux) ptr := v_0 val := v_1 mem := v_2 - if !(t.(*types.Type).Size() == 4) { + if !(t.Size() == 4) { break } v.reset(OpAMD64MOVLstore) @@ -33601,14 +33601,14 @@ func rewriteValueAMD64_OpStore(v *Value) bool { return true } // match: (Store {t} ptr val mem) - // cond: t.(*types.Type).Size() == 2 + // cond: t.Size() == 2 // result: (MOVWstore ptr val mem) for { - t := v.Aux + t := auxToType(v.Aux) ptr := v_0 val := v_1 mem := v_2 - if !(t.(*types.Type).Size() == 2) { + if !(t.Size() == 2) { break } v.reset(OpAMD64MOVWstore) @@ -33616,14 +33616,14 @@ func rewriteValueAMD64_OpStore(v *Value) bool { return true } // match: (Store {t} ptr val mem) - // cond: t.(*types.Type).Size() == 1 + // cond: t.Size() == 1 // result: (MOVBstore ptr val mem) for { - t := v.Aux + t := auxToType(v.Aux) ptr := v_0 val := v_1 mem := v_2 - if !(t.(*types.Type).Size() == 1) { + if !(t.Size() == 1) { break } v.reset(OpAMD64MOVBstore) @@ -33653,7 +33653,7 @@ func rewriteValueAMD64_OpZero(v *Value) bool { // match: (Zero [0] _ mem) // result: mem for { - if v.AuxInt != 0 { + if auxIntToInt64(v.AuxInt) != 0 { break } mem := v_1 @@ -33661,147 +33661,147 @@ func rewriteValueAMD64_OpZero(v *Value) bool { return true } // match: (Zero [1] destptr mem) - // result: (MOVBstoreconst [0] destptr mem) + // result: (MOVBstoreconst [makeValAndOff32(0,0)] destptr mem) for { - if v.AuxInt != 1 { + if auxIntToInt64(v.AuxInt) != 1 { break } destptr := v_0 mem := v_1 v.reset(OpAMD64MOVBstoreconst) - v.AuxInt = 0 + v.AuxInt = valAndOffToAuxInt(makeValAndOff32(0, 0)) v.AddArg2(destptr, mem) return true } // match: (Zero [2] destptr mem) - // result: (MOVWstoreconst [0] destptr mem) + // result: (MOVWstoreconst [makeValAndOff32(0,0)] destptr mem) for { - if v.AuxInt != 2 { + if auxIntToInt64(v.AuxInt) != 2 { break } destptr := v_0 mem := v_1 v.reset(OpAMD64MOVWstoreconst) - v.AuxInt = 0 + v.AuxInt = valAndOffToAuxInt(makeValAndOff32(0, 0)) v.AddArg2(destptr, mem) return true } // match: (Zero [4] destptr mem) - // result: (MOVLstoreconst [0] destptr mem) + // result: (MOVLstoreconst [makeValAndOff32(0,0)] destptr mem) for { - if v.AuxInt != 4 { + if auxIntToInt64(v.AuxInt) != 4 { break } destptr := v_0 mem := v_1 v.reset(OpAMD64MOVLstoreconst) - v.AuxInt = 0 + v.AuxInt = valAndOffToAuxInt(makeValAndOff32(0, 0)) v.AddArg2(destptr, mem) return true } // match: (Zero [8] destptr mem) - // result: (MOVQstoreconst [0] destptr mem) + // result: (MOVQstoreconst [makeValAndOff32(0,0)] destptr mem) for { - if v.AuxInt != 8 { + if auxIntToInt64(v.AuxInt) != 8 { break } destptr := v_0 mem := v_1 v.reset(OpAMD64MOVQstoreconst) - v.AuxInt = 0 + v.AuxInt = valAndOffToAuxInt(makeValAndOff32(0, 0)) v.AddArg2(destptr, mem) return true } // match: (Zero [3] destptr mem) - // result: (MOVBstoreconst [makeValAndOff(0,2)] destptr (MOVWstoreconst [0] destptr mem)) + // result: (MOVBstoreconst [makeValAndOff32(0,2)] destptr (MOVWstoreconst [makeValAndOff32(0,0)] destptr mem)) for { - if v.AuxInt != 3 { + if auxIntToInt64(v.AuxInt) != 3 { break } destptr := v_0 mem := v_1 v.reset(OpAMD64MOVBstoreconst) - v.AuxInt = makeValAndOff(0, 2) + v.AuxInt = valAndOffToAuxInt(makeValAndOff32(0, 2)) v0 := b.NewValue0(v.Pos, OpAMD64MOVWstoreconst, types.TypeMem) - v0.AuxInt = 0 + v0.AuxInt = valAndOffToAuxInt(makeValAndOff32(0, 0)) v0.AddArg2(destptr, mem) v.AddArg2(destptr, v0) return true } // match: (Zero [5] destptr mem) - // result: (MOVBstoreconst [makeValAndOff(0,4)] destptr (MOVLstoreconst [0] destptr mem)) + // result: (MOVBstoreconst [makeValAndOff32(0,4)] destptr (MOVLstoreconst [makeValAndOff32(0,0)] destptr mem)) for { - if v.AuxInt != 5 { + if auxIntToInt64(v.AuxInt) != 5 { break } destptr := v_0 mem := v_1 v.reset(OpAMD64MOVBstoreconst) - v.AuxInt = makeValAndOff(0, 4) + v.AuxInt = valAndOffToAuxInt(makeValAndOff32(0, 4)) v0 := b.NewValue0(v.Pos, OpAMD64MOVLstoreconst, types.TypeMem) - v0.AuxInt = 0 + v0.AuxInt = valAndOffToAuxInt(makeValAndOff32(0, 0)) v0.AddArg2(destptr, mem) v.AddArg2(destptr, v0) return true } // match: (Zero [6] destptr mem) - // result: (MOVWstoreconst [makeValAndOff(0,4)] destptr (MOVLstoreconst [0] destptr mem)) + // result: (MOVWstoreconst [makeValAndOff32(0,4)] destptr (MOVLstoreconst [makeValAndOff32(0,0)] destptr mem)) for { - if v.AuxInt != 6 { + if auxIntToInt64(v.AuxInt) != 6 { break } destptr := v_0 mem := v_1 v.reset(OpAMD64MOVWstoreconst) - v.AuxInt = makeValAndOff(0, 4) + v.AuxInt = valAndOffToAuxInt(makeValAndOff32(0, 4)) v0 := b.NewValue0(v.Pos, OpAMD64MOVLstoreconst, types.TypeMem) - v0.AuxInt = 0 + v0.AuxInt = valAndOffToAuxInt(makeValAndOff32(0, 0)) v0.AddArg2(destptr, mem) v.AddArg2(destptr, v0) return true } // match: (Zero [7] destptr mem) - // result: (MOVLstoreconst [makeValAndOff(0,3)] destptr (MOVLstoreconst [0] destptr mem)) + // result: (MOVLstoreconst [makeValAndOff32(0,3)] destptr (MOVLstoreconst [makeValAndOff32(0,0)] destptr mem)) for { - if v.AuxInt != 7 { + if auxIntToInt64(v.AuxInt) != 7 { break } destptr := v_0 mem := v_1 v.reset(OpAMD64MOVLstoreconst) - v.AuxInt = makeValAndOff(0, 3) + v.AuxInt = valAndOffToAuxInt(makeValAndOff32(0, 3)) v0 := b.NewValue0(v.Pos, OpAMD64MOVLstoreconst, types.TypeMem) - v0.AuxInt = 0 + v0.AuxInt = valAndOffToAuxInt(makeValAndOff32(0, 0)) v0.AddArg2(destptr, mem) v.AddArg2(destptr, v0) return true } // match: (Zero [s] destptr mem) // cond: s%8 != 0 && s > 8 && !config.useSSE - // result: (Zero [s-s%8] (OffPtr destptr [s%8]) (MOVQstoreconst [0] destptr mem)) + // result: (Zero [s-s%8] (OffPtr destptr [s%8]) (MOVQstoreconst [makeValAndOff32(0,0)] destptr mem)) for { - s := v.AuxInt + s := auxIntToInt64(v.AuxInt) destptr := v_0 mem := v_1 if !(s%8 != 0 && s > 8 && !config.useSSE) { break } v.reset(OpZero) - v.AuxInt = s - s%8 + v.AuxInt = int64ToAuxInt(s - s%8) v0 := b.NewValue0(v.Pos, OpOffPtr, destptr.Type) - v0.AuxInt = s % 8 + v0.AuxInt = int64ToAuxInt(s % 8) v0.AddArg(destptr) v1 := b.NewValue0(v.Pos, OpAMD64MOVQstoreconst, types.TypeMem) - v1.AuxInt = 0 + v1.AuxInt = valAndOffToAuxInt(makeValAndOff32(0, 0)) v1.AddArg2(destptr, mem) v.AddArg2(v0, v1) return true } // match: (Zero [16] destptr mem) // cond: !config.useSSE - // result: (MOVQstoreconst [makeValAndOff(0,8)] destptr (MOVQstoreconst [0] destptr mem)) + // result: (MOVQstoreconst [makeValAndOff32(0,8)] destptr (MOVQstoreconst [makeValAndOff32(0,0)] destptr mem)) for { - if v.AuxInt != 16 { + if auxIntToInt64(v.AuxInt) != 16 { break } destptr := v_0 @@ -33810,18 +33810,18 @@ func rewriteValueAMD64_OpZero(v *Value) bool { break } v.reset(OpAMD64MOVQstoreconst) - v.AuxInt = makeValAndOff(0, 8) + v.AuxInt = valAndOffToAuxInt(makeValAndOff32(0, 8)) v0 := b.NewValue0(v.Pos, OpAMD64MOVQstoreconst, types.TypeMem) - v0.AuxInt = 0 + v0.AuxInt = valAndOffToAuxInt(makeValAndOff32(0, 0)) v0.AddArg2(destptr, mem) v.AddArg2(destptr, v0) return true } // match: (Zero [24] destptr mem) // cond: !config.useSSE - // result: (MOVQstoreconst [makeValAndOff(0,16)] destptr (MOVQstoreconst [makeValAndOff(0,8)] destptr (MOVQstoreconst [0] destptr mem))) + // result: (MOVQstoreconst [makeValAndOff32(0,16)] destptr (MOVQstoreconst [makeValAndOff32(0,8)] destptr (MOVQstoreconst [makeValAndOff32(0,0)] destptr mem))) for { - if v.AuxInt != 24 { + if auxIntToInt64(v.AuxInt) != 24 { break } destptr := v_0 @@ -33830,11 +33830,11 @@ func rewriteValueAMD64_OpZero(v *Value) bool { break } v.reset(OpAMD64MOVQstoreconst) - v.AuxInt = makeValAndOff(0, 16) + v.AuxInt = valAndOffToAuxInt(makeValAndOff32(0, 16)) v0 := b.NewValue0(v.Pos, OpAMD64MOVQstoreconst, types.TypeMem) - v0.AuxInt = makeValAndOff(0, 8) + v0.AuxInt = valAndOffToAuxInt(makeValAndOff32(0, 8)) v1 := b.NewValue0(v.Pos, OpAMD64MOVQstoreconst, types.TypeMem) - v1.AuxInt = 0 + v1.AuxInt = valAndOffToAuxInt(makeValAndOff32(0, 0)) v1.AddArg2(destptr, mem) v0.AddArg2(destptr, v1) v.AddArg2(destptr, v0) @@ -33842,9 +33842,9 @@ func rewriteValueAMD64_OpZero(v *Value) bool { } // match: (Zero [32] destptr mem) // cond: !config.useSSE - // result: (MOVQstoreconst [makeValAndOff(0,24)] destptr (MOVQstoreconst [makeValAndOff(0,16)] destptr (MOVQstoreconst [makeValAndOff(0,8)] destptr (MOVQstoreconst [0] destptr mem)))) + // result: (MOVQstoreconst [makeValAndOff32(0,24)] destptr (MOVQstoreconst [makeValAndOff32(0,16)] destptr (MOVQstoreconst [makeValAndOff32(0,8)] destptr (MOVQstoreconst [makeValAndOff32(0,0)] destptr mem)))) for { - if v.AuxInt != 32 { + if auxIntToInt64(v.AuxInt) != 32 { break } destptr := v_0 @@ -33853,13 +33853,13 @@ func rewriteValueAMD64_OpZero(v *Value) bool { break } v.reset(OpAMD64MOVQstoreconst) - v.AuxInt = makeValAndOff(0, 24) + v.AuxInt = valAndOffToAuxInt(makeValAndOff32(0, 24)) v0 := b.NewValue0(v.Pos, OpAMD64MOVQstoreconst, types.TypeMem) - v0.AuxInt = makeValAndOff(0, 16) + v0.AuxInt = valAndOffToAuxInt(makeValAndOff32(0, 16)) v1 := b.NewValue0(v.Pos, OpAMD64MOVQstoreconst, types.TypeMem) - v1.AuxInt = makeValAndOff(0, 8) + v1.AuxInt = valAndOffToAuxInt(makeValAndOff32(0, 8)) v2 := b.NewValue0(v.Pos, OpAMD64MOVQstoreconst, types.TypeMem) - v2.AuxInt = 0 + v2.AuxInt = valAndOffToAuxInt(makeValAndOff32(0, 0)) v2.AddArg2(destptr, mem) v1.AddArg2(destptr, v2) v0.AddArg2(destptr, v1) @@ -33868,18 +33868,18 @@ func rewriteValueAMD64_OpZero(v *Value) bool { } // match: (Zero [s] destptr mem) // cond: s > 8 && s < 16 && config.useSSE - // result: (MOVQstoreconst [makeValAndOff(0,s-8)] destptr (MOVQstoreconst [0] destptr mem)) + // result: (MOVQstoreconst [makeValAndOff32(0,int32(s-8))] destptr (MOVQstoreconst [makeValAndOff32(0,0)] destptr mem)) for { - s := v.AuxInt + s := auxIntToInt64(v.AuxInt) destptr := v_0 mem := v_1 if !(s > 8 && s < 16 && config.useSSE) { break } v.reset(OpAMD64MOVQstoreconst) - v.AuxInt = makeValAndOff(0, s-8) + v.AuxInt = valAndOffToAuxInt(makeValAndOff32(0, int32(s-8))) v0 := b.NewValue0(v.Pos, OpAMD64MOVQstoreconst, types.TypeMem) - v0.AuxInt = 0 + v0.AuxInt = valAndOffToAuxInt(makeValAndOff32(0, 0)) v0.AddArg2(destptr, mem) v.AddArg2(destptr, v0) return true @@ -33888,41 +33888,41 @@ func rewriteValueAMD64_OpZero(v *Value) bool { // cond: s%16 != 0 && s > 16 && s%16 > 8 && config.useSSE // result: (Zero [s-s%16] (OffPtr destptr [s%16]) (MOVOstore destptr (MOVOconst [0]) mem)) for { - s := v.AuxInt + s := auxIntToInt64(v.AuxInt) destptr := v_0 mem := v_1 if !(s%16 != 0 && s > 16 && s%16 > 8 && config.useSSE) { break } v.reset(OpZero) - v.AuxInt = s - s%16 + v.AuxInt = int64ToAuxInt(s - s%16) v0 := b.NewValue0(v.Pos, OpOffPtr, destptr.Type) - v0.AuxInt = s % 16 + v0.AuxInt = int64ToAuxInt(s % 16) v0.AddArg(destptr) v1 := b.NewValue0(v.Pos, OpAMD64MOVOstore, types.TypeMem) v2 := b.NewValue0(v.Pos, OpAMD64MOVOconst, types.TypeInt128) - v2.AuxInt = 0 + v2.AuxInt = int128ToAuxInt(0) v1.AddArg3(destptr, v2, mem) v.AddArg2(v0, v1) return true } // match: (Zero [s] destptr mem) // cond: s%16 != 0 && s > 16 && s%16 <= 8 && config.useSSE - // result: (Zero [s-s%16] (OffPtr destptr [s%16]) (MOVQstoreconst [0] destptr mem)) + // result: (Zero [s-s%16] (OffPtr destptr [s%16]) (MOVQstoreconst [makeValAndOff32(0,0)] destptr mem)) for { - s := v.AuxInt + s := auxIntToInt64(v.AuxInt) destptr := v_0 mem := v_1 if !(s%16 != 0 && s > 16 && s%16 <= 8 && config.useSSE) { break } v.reset(OpZero) - v.AuxInt = s - s%16 + v.AuxInt = int64ToAuxInt(s - s%16) v0 := b.NewValue0(v.Pos, OpOffPtr, destptr.Type) - v0.AuxInt = s % 16 + v0.AuxInt = int64ToAuxInt(s % 16) v0.AddArg(destptr) v1 := b.NewValue0(v.Pos, OpAMD64MOVQstoreconst, types.TypeMem) - v1.AuxInt = 0 + v1.AuxInt = valAndOffToAuxInt(makeValAndOff32(0, 0)) v1.AddArg2(destptr, mem) v.AddArg2(v0, v1) return true @@ -33931,7 +33931,7 @@ func rewriteValueAMD64_OpZero(v *Value) bool { // cond: config.useSSE // result: (MOVOstore destptr (MOVOconst [0]) mem) for { - if v.AuxInt != 16 { + if auxIntToInt64(v.AuxInt) != 16 { break } destptr := v_0 @@ -33941,7 +33941,7 @@ func rewriteValueAMD64_OpZero(v *Value) bool { } v.reset(OpAMD64MOVOstore) v0 := b.NewValue0(v.Pos, OpAMD64MOVOconst, types.TypeInt128) - v0.AuxInt = 0 + v0.AuxInt = int128ToAuxInt(0) v.AddArg3(destptr, v0, mem) return true } @@ -33949,7 +33949,7 @@ func rewriteValueAMD64_OpZero(v *Value) bool { // cond: config.useSSE // result: (MOVOstore (OffPtr destptr [16]) (MOVOconst [0]) (MOVOstore destptr (MOVOconst [0]) mem)) for { - if v.AuxInt != 32 { + if auxIntToInt64(v.AuxInt) != 32 { break } destptr := v_0 @@ -33959,13 +33959,13 @@ func rewriteValueAMD64_OpZero(v *Value) bool { } v.reset(OpAMD64MOVOstore) v0 := b.NewValue0(v.Pos, OpOffPtr, destptr.Type) - v0.AuxInt = 16 + v0.AuxInt = int64ToAuxInt(16) v0.AddArg(destptr) v1 := b.NewValue0(v.Pos, OpAMD64MOVOconst, types.TypeInt128) - v1.AuxInt = 0 + v1.AuxInt = int128ToAuxInt(0) v2 := b.NewValue0(v.Pos, OpAMD64MOVOstore, types.TypeMem) v3 := b.NewValue0(v.Pos, OpAMD64MOVOconst, types.TypeInt128) - v3.AuxInt = 0 + v3.AuxInt = int128ToAuxInt(0) v2.AddArg3(destptr, v3, mem) v.AddArg3(v0, v1, v2) return true @@ -33974,7 +33974,7 @@ func rewriteValueAMD64_OpZero(v *Value) bool { // cond: config.useSSE // result: (MOVOstore (OffPtr destptr [32]) (MOVOconst [0]) (MOVOstore (OffPtr destptr [16]) (MOVOconst [0]) (MOVOstore destptr (MOVOconst [0]) mem))) for { - if v.AuxInt != 48 { + if auxIntToInt64(v.AuxInt) != 48 { break } destptr := v_0 @@ -33984,19 +33984,19 @@ func rewriteValueAMD64_OpZero(v *Value) bool { } v.reset(OpAMD64MOVOstore) v0 := b.NewValue0(v.Pos, OpOffPtr, destptr.Type) - v0.AuxInt = 32 + v0.AuxInt = int64ToAuxInt(32) v0.AddArg(destptr) v1 := b.NewValue0(v.Pos, OpAMD64MOVOconst, types.TypeInt128) - v1.AuxInt = 0 + v1.AuxInt = int128ToAuxInt(0) v2 := b.NewValue0(v.Pos, OpAMD64MOVOstore, types.TypeMem) v3 := b.NewValue0(v.Pos, OpOffPtr, destptr.Type) - v3.AuxInt = 16 + v3.AuxInt = int64ToAuxInt(16) v3.AddArg(destptr) v4 := b.NewValue0(v.Pos, OpAMD64MOVOconst, types.TypeInt128) - v4.AuxInt = 0 + v4.AuxInt = int128ToAuxInt(0) v5 := b.NewValue0(v.Pos, OpAMD64MOVOstore, types.TypeMem) v6 := b.NewValue0(v.Pos, OpAMD64MOVOconst, types.TypeInt128) - v6.AuxInt = 0 + v6.AuxInt = int128ToAuxInt(0) v5.AddArg3(destptr, v6, mem) v2.AddArg3(v3, v4, v5) v.AddArg3(v0, v1, v2) @@ -34006,7 +34006,7 @@ func rewriteValueAMD64_OpZero(v *Value) bool { // cond: config.useSSE // result: (MOVOstore (OffPtr destptr [48]) (MOVOconst [0]) (MOVOstore (OffPtr destptr [32]) (MOVOconst [0]) (MOVOstore (OffPtr destptr [16]) (MOVOconst [0]) (MOVOstore destptr (MOVOconst [0]) mem)))) for { - if v.AuxInt != 64 { + if auxIntToInt64(v.AuxInt) != 64 { break } destptr := v_0 @@ -34016,25 +34016,25 @@ func rewriteValueAMD64_OpZero(v *Value) bool { } v.reset(OpAMD64MOVOstore) v0 := b.NewValue0(v.Pos, OpOffPtr, destptr.Type) - v0.AuxInt = 48 + v0.AuxInt = int64ToAuxInt(48) v0.AddArg(destptr) v1 := b.NewValue0(v.Pos, OpAMD64MOVOconst, types.TypeInt128) - v1.AuxInt = 0 + v1.AuxInt = int128ToAuxInt(0) v2 := b.NewValue0(v.Pos, OpAMD64MOVOstore, types.TypeMem) v3 := b.NewValue0(v.Pos, OpOffPtr, destptr.Type) - v3.AuxInt = 32 + v3.AuxInt = int64ToAuxInt(32) v3.AddArg(destptr) v4 := b.NewValue0(v.Pos, OpAMD64MOVOconst, types.TypeInt128) - v4.AuxInt = 0 + v4.AuxInt = int128ToAuxInt(0) v5 := b.NewValue0(v.Pos, OpAMD64MOVOstore, types.TypeMem) v6 := b.NewValue0(v.Pos, OpOffPtr, destptr.Type) - v6.AuxInt = 16 + v6.AuxInt = int64ToAuxInt(16) v6.AddArg(destptr) v7 := b.NewValue0(v.Pos, OpAMD64MOVOconst, types.TypeInt128) - v7.AuxInt = 0 + v7.AuxInt = int128ToAuxInt(0) v8 := b.NewValue0(v.Pos, OpAMD64MOVOstore, types.TypeMem) v9 := b.NewValue0(v.Pos, OpAMD64MOVOconst, types.TypeInt128) - v9.AuxInt = 0 + v9.AuxInt = int128ToAuxInt(0) v8.AddArg3(destptr, v9, mem) v5.AddArg3(v6, v7, v8) v2.AddArg3(v3, v4, v5) @@ -34045,16 +34045,16 @@ func rewriteValueAMD64_OpZero(v *Value) bool { // cond: s > 64 && s <= 1024 && s%16 == 0 && !config.noDuffDevice // result: (DUFFZERO [s] destptr (MOVOconst [0]) mem) for { - s := v.AuxInt + s := auxIntToInt64(v.AuxInt) destptr := v_0 mem := v_1 if !(s > 64 && s <= 1024 && s%16 == 0 && !config.noDuffDevice) { break } v.reset(OpAMD64DUFFZERO) - v.AuxInt = s + v.AuxInt = int64ToAuxInt(s) v0 := b.NewValue0(v.Pos, OpAMD64MOVOconst, types.TypeInt128) - v0.AuxInt = 0 + v0.AuxInt = int128ToAuxInt(0) v.AddArg3(destptr, v0, mem) return true } @@ -34062,7 +34062,7 @@ func rewriteValueAMD64_OpZero(v *Value) bool { // cond: (s > 1024 || (config.noDuffDevice && s > 64 || !config.useSSE && s > 32)) && s%8 == 0 // result: (REPSTOSQ destptr (MOVQconst [s/8]) (MOVQconst [0]) mem) for { - s := v.AuxInt + s := auxIntToInt64(v.AuxInt) destptr := v_0 mem := v_1 if !((s > 1024 || (config.noDuffDevice && s > 64 || !config.useSSE && s > 32)) && s%8 == 0) { @@ -34070,9 +34070,9 @@ func rewriteValueAMD64_OpZero(v *Value) bool { } v.reset(OpAMD64REPSTOSQ) v0 := b.NewValue0(v.Pos, OpAMD64MOVQconst, typ.UInt64) - v0.AuxInt = s / 8 + v0.AuxInt = int64ToAuxInt(s / 8) v1 := b.NewValue0(v.Pos, OpAMD64MOVQconst, typ.UInt64) - v1.AuxInt = 0 + v1.AuxInt = int64ToAuxInt(0) v.AddArg4(destptr, v0, v1, mem) return true } -- 2.50.0