]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: remove noDuffDevice
authorRuss Cox <rsc@golang.org>
Fri, 7 Mar 2025 16:30:07 +0000 (11:30 -0500)
committerGopher Robot <gobot@golang.org>
Wed, 12 Mar 2025 12:40:38 +0000 (05:40 -0700)
noDuffDevice was for Plan 9, but Plan 9 doesn't need it anymore.
It was also being set in s390x, mips, mipsle, and wasm, but
on those systems it had no effect since the SSA rules for those
architectures don't refer to it at all.

Change-Id: Ib85c0832674c714f3ad5091f0a022eb7cd3ebcdf
Reviewed-on: https://go-review.googlesource.com/c/go/+/655878
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>

15 files changed:
src/cmd/compile/internal/ssa/_gen/386.rules
src/cmd/compile/internal/ssa/_gen/AMD64.rules
src/cmd/compile/internal/ssa/_gen/ARM.rules
src/cmd/compile/internal/ssa/_gen/ARM64.rules
src/cmd/compile/internal/ssa/_gen/LOONG64.rules
src/cmd/compile/internal/ssa/_gen/MIPS64.rules
src/cmd/compile/internal/ssa/_gen/RISCV64.rules
src/cmd/compile/internal/ssa/config.go
src/cmd/compile/internal/ssa/rewrite386.go
src/cmd/compile/internal/ssa/rewriteAMD64.go
src/cmd/compile/internal/ssa/rewriteARM.go
src/cmd/compile/internal/ssa/rewriteARM64.go
src/cmd/compile/internal/ssa/rewriteLOONG64.go
src/cmd/compile/internal/ssa/rewriteMIPS64.go
src/cmd/compile/internal/ssa/rewriteRISCV64.go

index 216f5c2e2e79eb1cfb3d8e8da03d333c85acaf76..97414913e4fe42cfbe5891406a80eef9e81993c1 100644 (file)
 // Medium copying uses a duff device.
 (Move [s] dst src mem)
        && s > 8 && s <= 4*128 && s%4 == 0
-       && !config.noDuffDevice && logLargeCopy(v, s) =>
+       && logLargeCopy(v, s) =>
        (DUFFCOPY [10*(128-s/4)] dst src mem)
 // 10 and 128 are magic constants.  10 is the number of bytes to encode:
 //     MOVL    (SI), CX
 // and 128 is the number of such blocks. See src/runtime/duff_386.s:duffcopy.
 
 // Large copying uses REP MOVSL.
-(Move [s] dst src mem) && (s > 4*128 || config.noDuffDevice) && s%4 == 0 && logLargeCopy(v, s) =>
+(Move [s] dst src mem) && s > 4*128 && s%4 == 0 && logLargeCopy(v, s) =>
        (REPMOVSL dst src (MOVLconst [int32(s/4)]) mem)
 
 // Lowering Zero instructions
 
 // Medium zeroing uses a duff device.
 (Zero [s] destptr mem)
-  && s > 16 && s <= 4*128 && s%4 == 0
-  && !config.noDuffDevice =>
+  && s > 16 && s <= 4*128 && s%4 == 0 =>
        (DUFFZERO [1*(128-s/4)] destptr (MOVLconst [0]) mem)
 // 1 and 128 are magic constants.  1 is the number of bytes to encode STOSL.
 // 128 is the number of STOSL instructions in duffzero.
 
 // Large zeroing uses REP STOSQ.
 (Zero [s] destptr mem)
-  && (s > 4*128 || (config.noDuffDevice && s > 16))
+  && s > 4*128
   && s%4 == 0 =>
        (REPSTOSL destptr (MOVLconst [int32(s/4)]) (MOVLconst [0]) mem)
 
index f8bf1eb6534e850fa9aefeb84511f112a687b983..dd3b9a68d744c70540eb166cea612eefc55ce0cb 100644 (file)
 // Medium copying uses a duff device.
 (Move [s] dst src mem)
        && s > 64 && s <= 16*64 && s%16 == 0
-       && !config.noDuffDevice && logLargeCopy(v, s) =>
+       && logLargeCopy(v, s) =>
        (DUFFCOPY [s] dst src mem)
 
 // 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 && s%8 == 0 && logLargeCopy(v, s) =>
        (REPMOVSQ dst src (MOVQconst [s/8]) mem)
 
 // Lowering Zero instructions
 
 // 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 =>
        (DUFFZERO [s] destptr mem)
 
 // Large zeroing uses REP STOSQ.
 (Zero [s] destptr mem)
-       && (s > 1024 || (config.noDuffDevice && s > 64))
-       && s%8 == 0 =>
+       && s > 1024 && s%8 == 0 =>
        (REPSTOSQ destptr (MOVQconst [s/8]) (MOVQconst [0]) mem)
 
 // Lowering constants
index 63535a4b29d5c23db21ef52682bf108d02ff8da7..431a12f35b70f105683fd942ebdc2616f180479d 100644 (file)
 // 4 and 128 are magic constants, see runtime/mkduff.go
 (Zero [s] {t} ptr mem)
        && s%4 == 0 && s > 4 && s <= 512
-       && t.Alignment()%4 == 0 && !config.noDuffDevice =>
+       && t.Alignment()%4 == 0 =>
        (DUFFZERO [4 * (128 - s/4)] ptr (MOVWconst [0]) mem)
 
 // Large zeroing uses a loop
 (Zero [s] {t} ptr mem)
-       && (s > 512 || config.noDuffDevice) || t.Alignment()%4 != 0 =>
+       && s > 512 || t.Alignment()%4 != 0 =>
        (LoweredZero [t.Alignment()]
                ptr
                (ADDconst <ptr.Type> ptr [int32(s-moveSize(t.Alignment(), config))])
 // 8 and 128 are magic constants, see runtime/mkduff.go
 (Move [s] {t} dst src mem)
        && s%4 == 0 && s > 4 && s <= 512
-       && t.Alignment()%4 == 0 && !config.noDuffDevice && logLargeCopy(v, s) =>
+       && t.Alignment()%4 == 0 && logLargeCopy(v, s) =>
        (DUFFCOPY [8 * (128 - s/4)] dst src mem)
 
 // Large move uses a loop
 (Move [s] {t} dst src mem)
-       && ((s > 512 || config.noDuffDevice) || t.Alignment()%4 != 0) && logLargeCopy(v, s) =>
+       && (s > 512 || t.Alignment()%4 != 0) && logLargeCopy(v, s) =>
        (LoweredMove [t.Alignment()]
                dst
                src
index 359c1811b0ee9d1bcbcf7132711379ec74ab15a3..f07070df0abbf48f3470a77af331fa043aa9dd51 100644 (file)
 // medium zeroing uses a duff device
 // 4, 16, and 64 are magic constants, see runtime/mkduff.go
 (Zero [s] ptr mem)
-       && s%16 == 0 && s > 64 && s <= 16*64
-       && !config.noDuffDevice =>
+       && s%16 == 0 && s > 64 && s <= 16*64 =>
        (DUFFZERO [4 * (64 - s/16)] ptr mem)
 
 // large zeroing uses a loop
 (Zero [s] ptr mem)
-       && s%16 == 0 && (s > 16*64 || config.noDuffDevice) =>
+       && s%16 == 0 && s > 16*64 =>
        (LoweredZero
                ptr
                (ADDconst <ptr.Type> [s-16] ptr)
 // medium move uses a duff device
 (Move [s] dst src mem)
        && s > 64 && s <= 16*64 && s%16 == 0
-       && !config.noDuffDevice && logLargeCopy(v, s) =>
+       && logLargeCopy(v, s) =>
        (DUFFCOPY [8 * (64 - s/16)] dst src mem)
 // 8 is the number of bytes to encode:
 //
 
 // large move uses a loop
 (Move [s] dst src mem)
-       && s%16 == 0 && (s > 16*64 || config.noDuffDevice)
+       && s%16 == 0 && s > 16*64
        && logLargeCopy(v, s) =>
        (LoweredMove
                dst
index 41c120c9832f8096564d4b725ec0c346e2105f4c..c94e1e19e2bf2111a30dfac1f7ceefa1d5f5c680 100644 (file)
 
 // medium zeroing uses a duff device
 (Zero [s] ptr mem)
-    && s%8 == 0 && s > 16 && s <= 8*128
-    && !config.noDuffDevice =>
+    && s%8 == 0 && s > 16 && s <= 8*128 =>
     (DUFFZERO [8 * (128 - s/8)] ptr mem)
 
 // large zeroing uses a loop
 // medium move uses a duff device
 (Move [s] dst src mem)
         && s%8 == 0 && s > 16 && s <= 8*128
-        && !config.noDuffDevice && logLargeCopy(v, s)  =>
+        && logLargeCopy(v, s)  =>
         (DUFFCOPY [16 * (128 - s/8)] dst src mem)
 // 16 and 128 are magic constants.  16 is the number of bytes to encode:
 //     MOVV    (R20), R30
index cc3985ecdd0a6fc66a378a094a591f79fd606549..5b55c3bef75e9c0075bef43f680ec4ec5eec28c9 100644 (file)
 // 8, and 128 are magic constants, see runtime/mkduff.go
 (Zero [s] {t} ptr mem)
        && s%8 == 0 && s > 24 && s <= 8*128
-       && t.Alignment()%8 == 0 && !config.noDuffDevice =>
+       && t.Alignment()%8 == 0 =>
        (DUFFZERO [8 * (128 - s/8)] ptr mem)
 
 // large or unaligned zeroing uses a loop
 (Zero [s] {t} ptr mem)
-       && (s > 8*128 || config.noDuffDevice) || t.Alignment()%8 != 0 =>
+       && s > 8*128 || t.Alignment()%8 != 0 =>
        (LoweredZero [t.Alignment()]
                ptr
                (ADDVconst <ptr.Type> ptr [s-moveSize(t.Alignment(), config)])
 // medium move uses a duff device
 (Move [s] {t} dst src mem)
        && s%8 == 0 && s >= 24 && s <= 8*128 && t.Alignment()%8 == 0
-       && !config.noDuffDevice && logLargeCopy(v, s)  =>
+       && logLargeCopy(v, s)  =>
        (DUFFCOPY [16 * (128 - s/8)] dst src mem)
 // 16 and 128 are magic constants.  16 is the number of bytes to encode:
 //     MOVV    (R1), R23
index a69df619a576c65fe5ae377e55d047d95ab7bcaf..6319746dc781293a469b8aebda421b171df3d04c 100644 (file)
 // 8 and 128 are magic constants, see runtime/mkduff.go
 (Zero [s] {t} ptr mem)
        && s%8 == 0 && s <= 8*128
-       && t.Alignment()%8 == 0 && !config.noDuffDevice =>
+       && t.Alignment()%8 == 0 =>
        (DUFFZERO [8 * (128 - s/8)] ptr mem)
 
 // Generic zeroing uses a loop
 // 16 and 128 are magic constants, see runtime/mkduff.go
 (Move [s] {t} dst src mem)
        && s%8 == 0 && s <= 8*128 && t.Alignment()%8 == 0
-       && !config.noDuffDevice && logLargeCopy(v, s) =>
+       && logLargeCopy(v, s) =>
        (DUFFCOPY [16 * (128 - s/8)] dst src mem)
 
 // Generic move uses a loop
index cf881ee0782da33eb2309115b9ac279e8bc4f5db..09c1ebb1077fbf495a1a7a4849fa630beb00f436 100644 (file)
@@ -41,7 +41,6 @@ type Config struct {
        hasGReg        bool      // has hardware g register
        ctxt           *obj.Link // Generic arch information
        optimize       bool      // Do optimization
-       noDuffDevice   bool      // Don't use Duff's device
        useAvg         bool      // Use optimizations that need Avg* operations
        useHmul        bool      // Use optimizations that need Hmul* operations
        SoftFloat      bool      //
@@ -295,7 +294,6 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize, softfloat boo
                c.FPReg = framepointerRegS390X
                c.LinkReg = linkRegS390X
                c.hasGReg = true
-               c.noDuffDevice = true
                c.BigEndian = true
                c.unalignedOK = true
                c.haveBswap64 = true
@@ -316,7 +314,6 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize, softfloat boo
                c.FPReg = framepointerRegMIPS
                c.LinkReg = linkRegMIPS
                c.hasGReg = true
-               c.noDuffDevice = true
        case "riscv64":
                c.PtrSize = 8
                c.RegSize = 8
@@ -344,7 +341,6 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize, softfloat boo
                c.FPReg = framepointerRegWasm
                c.LinkReg = linkRegWasm
                c.hasGReg = true
-               c.noDuffDevice = true
                c.useAvg = false
                c.useHmul = false
        default:
index dbc1335fcdc338ecf373eecb1fdc64129c619531..9ece0e4eb787240526e78b9410c2ad03a57dfc9e 100644 (file)
@@ -8924,7 +8924,6 @@ func rewriteValue386_OpMove(v *Value) bool {
        v_1 := v.Args[1]
        v_0 := v.Args[0]
        b := v.Block
-       config := b.Func.Config
        typ := &b.Func.Config.Types
        // match: (Move [0] _ _ mem)
        // result: mem
@@ -9113,14 +9112,14 @@ func rewriteValue386_OpMove(v *Value) bool {
                return true
        }
        // match: (Move [s] dst src mem)
-       // cond: s > 8 && s <= 4*128 && s%4 == 0 && !config.noDuffDevice && logLargeCopy(v, s)
+       // cond: s > 8 && s <= 4*128 && s%4 == 0 && logLargeCopy(v, s)
        // result: (DUFFCOPY [10*(128-s/4)] dst src mem)
        for {
                s := auxIntToInt64(v.AuxInt)
                dst := v_0
                src := v_1
                mem := v_2
-               if !(s > 8 && s <= 4*128 && s%4 == 0 && !config.noDuffDevice && logLargeCopy(v, s)) {
+               if !(s > 8 && s <= 4*128 && s%4 == 0 && logLargeCopy(v, s)) {
                        break
                }
                v.reset(Op386DUFFCOPY)
@@ -9129,14 +9128,14 @@ func rewriteValue386_OpMove(v *Value) bool {
                return true
        }
        // match: (Move [s] dst src mem)
-       // cond: (s > 4*128 || config.noDuffDevice) && s%4 == 0 && logLargeCopy(v, s)
+       // cond: s > 4*128 && s%4 == 0 && logLargeCopy(v, s)
        // result: (REPMOVSL dst src (MOVLconst [int32(s/4)]) mem)
        for {
                s := auxIntToInt64(v.AuxInt)
                dst := v_0
                src := v_1
                mem := v_2
-               if !((s > 4*128 || config.noDuffDevice) && s%4 == 0 && logLargeCopy(v, s)) {
+               if !(s > 4*128 && s%4 == 0 && logLargeCopy(v, s)) {
                        break
                }
                v.reset(Op386REPMOVSL)
@@ -10575,7 +10574,6 @@ func rewriteValue386_OpZero(v *Value) bool {
        v_1 := v.Args[1]
        v_0 := v.Args[0]
        b := v.Block
-       config := b.Func.Config
        typ := &b.Func.Config.Types
        // match: (Zero [0] _ mem)
        // result: mem
@@ -10769,13 +10767,13 @@ func rewriteValue386_OpZero(v *Value) bool {
                return true
        }
        // match: (Zero [s] destptr mem)
-       // cond: s > 16 && s <= 4*128 && s%4 == 0 && !config.noDuffDevice
+       // cond: s > 16 && s <= 4*128 && s%4 == 0
        // result: (DUFFZERO [1*(128-s/4)] destptr (MOVLconst [0]) mem)
        for {
                s := auxIntToInt64(v.AuxInt)
                destptr := v_0
                mem := v_1
-               if !(s > 16 && s <= 4*128 && s%4 == 0 && !config.noDuffDevice) {
+               if !(s > 16 && s <= 4*128 && s%4 == 0) {
                        break
                }
                v.reset(Op386DUFFZERO)
@@ -10786,13 +10784,13 @@ func rewriteValue386_OpZero(v *Value) bool {
                return true
        }
        // match: (Zero [s] destptr mem)
-       // cond: (s > 4*128 || (config.noDuffDevice && s > 16)) && s%4 == 0
+       // cond: s > 4*128 && s%4 == 0
        // result: (REPSTOSL destptr (MOVLconst [int32(s/4)]) (MOVLconst [0]) mem)
        for {
                s := auxIntToInt64(v.AuxInt)
                destptr := v_0
                mem := v_1
-               if !((s > 4*128 || (config.noDuffDevice && s > 16)) && s%4 == 0) {
+               if !(s > 4*128 && s%4 == 0) {
                        break
                }
                v.reset(Op386REPSTOSL)
index 10a18757948793604fad55e8cbd04c29825409f0..be9ed7f6e16f41be8f11f65cb79f24d337cea832 100644 (file)
@@ -27830,7 +27830,6 @@ func rewriteValueAMD64_OpMove(v *Value) bool {
        v_1 := v.Args[1]
        v_0 := v.Args[0]
        b := v.Block
-       config := b.Func.Config
        typ := &b.Func.Config.Types
        // match: (Move [0] _ _ mem)
        // result: mem
@@ -28230,14 +28229,14 @@ func rewriteValueAMD64_OpMove(v *Value) bool {
                return true
        }
        // match: (Move [s] dst src mem)
-       // cond: s > 64 && s <= 16*64 && s%16 == 0 && !config.noDuffDevice && logLargeCopy(v, s)
+       // cond: s > 64 && s <= 16*64 && s%16 == 0 && logLargeCopy(v, s)
        // result: (DUFFCOPY [s] dst src mem)
        for {
                s := auxIntToInt64(v.AuxInt)
                dst := v_0
                src := v_1
                mem := v_2
-               if !(s > 64 && s <= 16*64 && s%16 == 0 && !config.noDuffDevice && logLargeCopy(v, s)) {
+               if !(s > 64 && s <= 16*64 && s%16 == 0 && logLargeCopy(v, s)) {
                        break
                }
                v.reset(OpAMD64DUFFCOPY)
@@ -28246,14 +28245,14 @@ func rewriteValueAMD64_OpMove(v *Value) bool {
                return true
        }
        // match: (Move [s] dst src mem)
-       // cond: (s > 16*64 || config.noDuffDevice) && s%8 == 0 && logLargeCopy(v, s)
+       // cond: s > 16*64 && s%8 == 0 && logLargeCopy(v, s)
        // result: (REPMOVSQ dst src (MOVQconst [s/8]) mem)
        for {
                s := auxIntToInt64(v.AuxInt)
                dst := v_0
                src := v_1
                mem := v_2
-               if !((s > 16*64 || config.noDuffDevice) && s%8 == 0 && logLargeCopy(v, s)) {
+               if !(s > 16*64 && s%8 == 0 && logLargeCopy(v, s)) {
                        break
                }
                v.reset(OpAMD64REPMOVSQ)
@@ -30443,7 +30442,6 @@ func rewriteValueAMD64_OpZero(v *Value) bool {
        v_1 := v.Args[1]
        v_0 := v.Args[0]
        b := v.Block
-       config := b.Func.Config
        typ := &b.Func.Config.Types
        // match: (Zero [0] _ mem)
        // result: mem
@@ -30745,13 +30743,13 @@ func rewriteValueAMD64_OpZero(v *Value) bool {
                return true
        }
        // match: (Zero [s] destptr mem)
-       // cond: s > 64 && s <= 1024 && s%16 == 0 && !config.noDuffDevice
+       // cond: s > 64 && s <= 1024 && s%16 == 0
        // result: (DUFFZERO [s] destptr mem)
        for {
                s := auxIntToInt64(v.AuxInt)
                destptr := v_0
                mem := v_1
-               if !(s > 64 && s <= 1024 && s%16 == 0 && !config.noDuffDevice) {
+               if !(s > 64 && s <= 1024 && s%16 == 0) {
                        break
                }
                v.reset(OpAMD64DUFFZERO)
@@ -30760,13 +30758,13 @@ func rewriteValueAMD64_OpZero(v *Value) bool {
                return true
        }
        // match: (Zero [s] destptr mem)
-       // cond: (s > 1024 || (config.noDuffDevice && s > 64)) && s%8 == 0
+       // cond: s > 1024 && s%8 == 0
        // result: (REPSTOSQ destptr (MOVQconst [s/8]) (MOVQconst [0]) mem)
        for {
                s := auxIntToInt64(v.AuxInt)
                destptr := v_0
                mem := v_1
-               if !((s > 1024 || (config.noDuffDevice && s > 64)) && s%8 == 0) {
+               if !(s > 1024 && s%8 == 0) {
                        break
                }
                v.reset(OpAMD64REPSTOSQ)
index f958acba05a19e7d01c1d83ea23b825e6f4d9706..00517da4a13d2009956dc36b1ea689dde54d0181 100644 (file)
@@ -14751,7 +14751,7 @@ func rewriteValueARM_OpMove(v *Value) bool {
                return true
        }
        // match: (Move [s] {t} dst src mem)
-       // cond: s%4 == 0 && s > 4 && s <= 512 && t.Alignment()%4 == 0 && !config.noDuffDevice && logLargeCopy(v, s)
+       // cond: s%4 == 0 && s > 4 && s <= 512 && t.Alignment()%4 == 0 && logLargeCopy(v, s)
        // result: (DUFFCOPY [8 * (128 - s/4)] dst src mem)
        for {
                s := auxIntToInt64(v.AuxInt)
@@ -14759,7 +14759,7 @@ func rewriteValueARM_OpMove(v *Value) bool {
                dst := v_0
                src := v_1
                mem := v_2
-               if !(s%4 == 0 && s > 4 && s <= 512 && t.Alignment()%4 == 0 && !config.noDuffDevice && logLargeCopy(v, s)) {
+               if !(s%4 == 0 && s > 4 && s <= 512 && t.Alignment()%4 == 0 && logLargeCopy(v, s)) {
                        break
                }
                v.reset(OpARMDUFFCOPY)
@@ -14768,7 +14768,7 @@ func rewriteValueARM_OpMove(v *Value) bool {
                return true
        }
        // match: (Move [s] {t} dst src mem)
-       // cond: ((s > 512 || config.noDuffDevice) || t.Alignment()%4 != 0) && logLargeCopy(v, s)
+       // cond: (s > 512 || t.Alignment()%4 != 0) && logLargeCopy(v, s)
        // result: (LoweredMove [t.Alignment()] dst src (ADDconst <src.Type> src [int32(s-moveSize(t.Alignment(), config))]) mem)
        for {
                s := auxIntToInt64(v.AuxInt)
@@ -14776,7 +14776,7 @@ func rewriteValueARM_OpMove(v *Value) bool {
                dst := v_0
                src := v_1
                mem := v_2
-               if !(((s > 512 || config.noDuffDevice) || t.Alignment()%4 != 0) && logLargeCopy(v, s)) {
+               if !((s > 512 || t.Alignment()%4 != 0) && logLargeCopy(v, s)) {
                        break
                }
                v.reset(OpARMLoweredMove)
@@ -16175,14 +16175,14 @@ func rewriteValueARM_OpZero(v *Value) bool {
                return true
        }
        // match: (Zero [s] {t} ptr mem)
-       // cond: s%4 == 0 && s > 4 && s <= 512 && t.Alignment()%4 == 0 && !config.noDuffDevice
+       // cond: s%4 == 0 && s > 4 && s <= 512 && t.Alignment()%4 == 0
        // result: (DUFFZERO [4 * (128 - s/4)] ptr (MOVWconst [0]) mem)
        for {
                s := auxIntToInt64(v.AuxInt)
                t := auxToType(v.Aux)
                ptr := v_0
                mem := v_1
-               if !(s%4 == 0 && s > 4 && s <= 512 && t.Alignment()%4 == 0 && !config.noDuffDevice) {
+               if !(s%4 == 0 && s > 4 && s <= 512 && t.Alignment()%4 == 0) {
                        break
                }
                v.reset(OpARMDUFFZERO)
@@ -16193,14 +16193,14 @@ func rewriteValueARM_OpZero(v *Value) bool {
                return true
        }
        // match: (Zero [s] {t} ptr mem)
-       // cond: (s > 512 || config.noDuffDevice) || t.Alignment()%4 != 0
+       // cond: s > 512 || t.Alignment()%4 != 0
        // result: (LoweredZero [t.Alignment()] ptr (ADDconst <ptr.Type> ptr [int32(s-moveSize(t.Alignment(), config))]) (MOVWconst [0]) mem)
        for {
                s := auxIntToInt64(v.AuxInt)
                t := auxToType(v.Aux)
                ptr := v_0
                mem := v_1
-               if !((s > 512 || config.noDuffDevice) || t.Alignment()%4 != 0) {
+               if !(s > 512 || t.Alignment()%4 != 0) {
                        break
                }
                v.reset(OpARMLoweredZero)
index d7f99bc46cbede19987ea5dc0a540443ffbcf442..b4ee37007e1720d0d7e0852ff2877165e4ad0bd0 100644 (file)
@@ -20588,7 +20588,6 @@ func rewriteValueARM64_OpMove(v *Value) bool {
        v_1 := v.Args[1]
        v_0 := v.Args[0]
        b := v.Block
-       config := b.Func.Config
        typ := &b.Func.Config.Types
        // match: (Move [0] _ _ mem)
        // result: mem
@@ -21078,14 +21077,14 @@ func rewriteValueARM64_OpMove(v *Value) bool {
                return true
        }
        // match: (Move [s] dst src mem)
-       // cond: s > 64 && s <= 16*64 && s%16 == 0 && !config.noDuffDevice && logLargeCopy(v, s)
+       // cond: s > 64 && s <= 16*64 && s%16 == 0 && logLargeCopy(v, s)
        // result: (DUFFCOPY [8 * (64 - s/16)] dst src mem)
        for {
                s := auxIntToInt64(v.AuxInt)
                dst := v_0
                src := v_1
                mem := v_2
-               if !(s > 64 && s <= 16*64 && s%16 == 0 && !config.noDuffDevice && logLargeCopy(v, s)) {
+               if !(s > 64 && s <= 16*64 && s%16 == 0 && logLargeCopy(v, s)) {
                        break
                }
                v.reset(OpARM64DUFFCOPY)
@@ -21094,14 +21093,14 @@ func rewriteValueARM64_OpMove(v *Value) bool {
                return true
        }
        // match: (Move [s] dst src mem)
-       // cond: s%16 == 0 && (s > 16*64 || config.noDuffDevice) && logLargeCopy(v, s)
+       // cond: s%16 == 0 && s > 16*64 && logLargeCopy(v, s)
        // result: (LoweredMove dst src (ADDconst <src.Type> src [s-16]) mem)
        for {
                s := auxIntToInt64(v.AuxInt)
                dst := v_0
                src := v_1
                mem := v_2
-               if !(s%16 == 0 && (s > 16*64 || config.noDuffDevice) && logLargeCopy(v, s)) {
+               if !(s%16 == 0 && s > 16*64 && logLargeCopy(v, s)) {
                        break
                }
                v.reset(OpARM64LoweredMove)
@@ -23446,7 +23445,6 @@ func rewriteValueARM64_OpZero(v *Value) bool {
        v_1 := v.Args[1]
        v_0 := v.Args[0]
        b := v.Block
-       config := b.Func.Config
        typ := &b.Func.Config.Types
        // match: (Zero [0] _ mem)
        // result: mem
@@ -23822,13 +23820,13 @@ func rewriteValueARM64_OpZero(v *Value) bool {
                return true
        }
        // match: (Zero [s] ptr mem)
-       // cond: s%16 == 0 && s > 64 && s <= 16*64 && !config.noDuffDevice
+       // cond: s%16 == 0 && s > 64 && s <= 16*64
        // result: (DUFFZERO [4 * (64 - s/16)] ptr mem)
        for {
                s := auxIntToInt64(v.AuxInt)
                ptr := v_0
                mem := v_1
-               if !(s%16 == 0 && s > 64 && s <= 16*64 && !config.noDuffDevice) {
+               if !(s%16 == 0 && s > 64 && s <= 16*64) {
                        break
                }
                v.reset(OpARM64DUFFZERO)
@@ -23837,13 +23835,13 @@ func rewriteValueARM64_OpZero(v *Value) bool {
                return true
        }
        // match: (Zero [s] ptr mem)
-       // cond: s%16 == 0 && (s > 16*64 || config.noDuffDevice)
+       // cond: s%16 == 0 && s > 16*64
        // result: (LoweredZero ptr (ADDconst <ptr.Type> [s-16] ptr) mem)
        for {
                s := auxIntToInt64(v.AuxInt)
                ptr := v_0
                mem := v_1
-               if !(s%16 == 0 && (s > 16*64 || config.noDuffDevice)) {
+               if !(s%16 == 0 && s > 16*64) {
                        break
                }
                v.reset(OpARM64LoweredZero)
index 01000db4c057bbcc742c6d4a8c0e4519c3700b6c..d3cdf8b9bcd5d56df47c2853f8404f49f66eb4c5 100644 (file)
@@ -7961,7 +7961,6 @@ func rewriteValueLOONG64_OpMove(v *Value) bool {
        v_1 := v.Args[1]
        v_0 := v.Args[0]
        b := v.Block
-       config := b.Func.Config
        typ := &b.Func.Config.Types
        // match: (Move [0] _ _ mem)
        // result: mem
@@ -8311,14 +8310,14 @@ func rewriteValueLOONG64_OpMove(v *Value) bool {
                return true
        }
        // match: (Move [s] dst src mem)
-       // cond: s%8 == 0 && s > 16 && s <= 8*128 && !config.noDuffDevice && logLargeCopy(v, s)
+       // cond: s%8 == 0 && s > 16 && s <= 8*128 && logLargeCopy(v, s)
        // result: (DUFFCOPY [16 * (128 - s/8)] dst src mem)
        for {
                s := auxIntToInt64(v.AuxInt)
                dst := v_0
                src := v_1
                mem := v_2
-               if !(s%8 == 0 && s > 16 && s <= 8*128 && !config.noDuffDevice && logLargeCopy(v, s)) {
+               if !(s%8 == 0 && s > 16 && s <= 8*128 && logLargeCopy(v, s)) {
                        break
                }
                v.reset(OpLOONG64DUFFCOPY)
@@ -9873,7 +9872,6 @@ func rewriteValueLOONG64_OpZero(v *Value) bool {
        v_1 := v.Args[1]
        v_0 := v.Args[0]
        b := v.Block
-       config := b.Func.Config
        typ := &b.Func.Config.Types
        // match: (Zero [0] _ mem)
        // result: mem
@@ -10167,13 +10165,13 @@ func rewriteValueLOONG64_OpZero(v *Value) bool {
                return true
        }
        // match: (Zero [s] ptr mem)
-       // cond: s%8 == 0 && s > 16 && s <= 8*128 && !config.noDuffDevice
+       // cond: s%8 == 0 && s > 16 && s <= 8*128
        // result: (DUFFZERO [8 * (128 - s/8)] ptr mem)
        for {
                s := auxIntToInt64(v.AuxInt)
                ptr := v_0
                mem := v_1
-               if !(s%8 == 0 && s > 16 && s <= 8*128 && !config.noDuffDevice) {
+               if !(s%8 == 0 && s > 16 && s <= 8*128) {
                        break
                }
                v.reset(OpLOONG64DUFFZERO)
index b82f027a5a801ad5b034cea6aacf020d07d5f5cc..10281e7e70905acd5729247c24c275e9f1664524 100644 (file)
@@ -6043,7 +6043,7 @@ func rewriteValueMIPS64_OpMove(v *Value) bool {
                return true
        }
        // match: (Move [s] {t} dst src mem)
-       // cond: s%8 == 0 && s >= 24 && s <= 8*128 && t.Alignment()%8 == 0 && !config.noDuffDevice && logLargeCopy(v, s)
+       // cond: s%8 == 0 && s >= 24 && s <= 8*128 && t.Alignment()%8 == 0 && logLargeCopy(v, s)
        // result: (DUFFCOPY [16 * (128 - s/8)] dst src mem)
        for {
                s := auxIntToInt64(v.AuxInt)
@@ -6051,7 +6051,7 @@ func rewriteValueMIPS64_OpMove(v *Value) bool {
                dst := v_0
                src := v_1
                mem := v_2
-               if !(s%8 == 0 && s >= 24 && s <= 8*128 && t.Alignment()%8 == 0 && !config.noDuffDevice && logLargeCopy(v, s)) {
+               if !(s%8 == 0 && s >= 24 && s <= 8*128 && t.Alignment()%8 == 0 && logLargeCopy(v, s)) {
                        break
                }
                v.reset(OpMIPS64DUFFCOPY)
@@ -8200,14 +8200,14 @@ func rewriteValueMIPS64_OpZero(v *Value) bool {
                return true
        }
        // match: (Zero [s] {t} ptr mem)
-       // cond: s%8 == 0 && s > 24 && s <= 8*128 && t.Alignment()%8 == 0 && !config.noDuffDevice
+       // cond: s%8 == 0 && s > 24 && s <= 8*128 && t.Alignment()%8 == 0
        // result: (DUFFZERO [8 * (128 - s/8)] ptr mem)
        for {
                s := auxIntToInt64(v.AuxInt)
                t := auxToType(v.Aux)
                ptr := v_0
                mem := v_1
-               if !(s%8 == 0 && s > 24 && s <= 8*128 && t.Alignment()%8 == 0 && !config.noDuffDevice) {
+               if !(s%8 == 0 && s > 24 && s <= 8*128 && t.Alignment()%8 == 0) {
                        break
                }
                v.reset(OpMIPS64DUFFZERO)
@@ -8216,14 +8216,14 @@ func rewriteValueMIPS64_OpZero(v *Value) bool {
                return true
        }
        // match: (Zero [s] {t} ptr mem)
-       // cond: (s > 8*128 || config.noDuffDevice) || t.Alignment()%8 != 0
+       // cond: s > 8*128 || t.Alignment()%8 != 0
        // result: (LoweredZero [t.Alignment()] ptr (ADDVconst <ptr.Type> ptr [s-moveSize(t.Alignment(), config)]) mem)
        for {
                s := auxIntToInt64(v.AuxInt)
                t := auxToType(v.Aux)
                ptr := v_0
                mem := v_1
-               if !((s > 8*128 || config.noDuffDevice) || t.Alignment()%8 != 0) {
+               if !(s > 8*128 || t.Alignment()%8 != 0) {
                        break
                }
                v.reset(OpMIPS64LoweredZero)
index 3a044b5c9d26027a6ecfb24e0201fe3d9eb3c413..165c9799f989f9f375b0dc034413cb53c9c9972e 100644 (file)
@@ -3015,7 +3015,7 @@ func rewriteValueRISCV64_OpMove(v *Value) bool {
                return true
        }
        // match: (Move [s] {t} dst src mem)
-       // cond: s%8 == 0 && s <= 8*128 && t.Alignment()%8 == 0 && !config.noDuffDevice && logLargeCopy(v, s)
+       // cond: s%8 == 0 && s <= 8*128 && t.Alignment()%8 == 0 && logLargeCopy(v, s)
        // result: (DUFFCOPY [16 * (128 - s/8)] dst src mem)
        for {
                s := auxIntToInt64(v.AuxInt)
@@ -3023,7 +3023,7 @@ func rewriteValueRISCV64_OpMove(v *Value) bool {
                dst := v_0
                src := v_1
                mem := v_2
-               if !(s%8 == 0 && s <= 8*128 && t.Alignment()%8 == 0 && !config.noDuffDevice && logLargeCopy(v, s)) {
+               if !(s%8 == 0 && s <= 8*128 && t.Alignment()%8 == 0 && logLargeCopy(v, s)) {
                        break
                }
                v.reset(OpRISCV64DUFFCOPY)
@@ -9053,14 +9053,14 @@ func rewriteValueRISCV64_OpZero(v *Value) bool {
                return true
        }
        // match: (Zero [s] {t} ptr mem)
-       // cond: s%8 == 0 && s <= 8*128 && t.Alignment()%8 == 0 && !config.noDuffDevice
+       // cond: s%8 == 0 && s <= 8*128 && t.Alignment()%8 == 0
        // result: (DUFFZERO [8 * (128 - s/8)] ptr mem)
        for {
                s := auxIntToInt64(v.AuxInt)
                t := auxToType(v.Aux)
                ptr := v_0
                mem := v_1
-               if !(s%8 == 0 && s <= 8*128 && t.Alignment()%8 == 0 && !config.noDuffDevice) {
+               if !(s%8 == 0 && s <= 8*128 && t.Alignment()%8 == 0) {
                        break
                }
                v.reset(OpRISCV64DUFFZERO)