]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: used TESTL instead of TESTQ for cpu feature flag detection
authorKeith Randall <khr@golang.org>
Sat, 9 Oct 2021 22:17:03 +0000 (15:17 -0700)
committerKeith Randall <khr@golang.org>
Sun, 10 Oct 2021 15:11:26 +0000 (15:11 +0000)
Uses one less byte when encoded. Performance is unchanged.

Change-Id: If400c9c9fc07a033e5ae9bf975ec512e432f7825
Reviewed-on: https://go-review.googlesource.com/c/go/+/354949
Trust: Keith Randall <khr@golang.org>
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/rewriteAMD64.go

index 9c476d885a07c865b0fa785ff0ca53a243156d0b..8b73ee14ea7a36f5aa657d0ea7a34b70bac59dbb 100644 (file)
 (GetCallerPC ...) => (LoweredGetCallerPC ...)
 (GetCallerSP ...) => (LoweredGetCallerSP ...)
 
-(HasCPUFeature {s}) => (SETNE (CMPQconst [0] (LoweredHasCPUFeature {s})))
+(HasCPUFeature {s}) => (SETNE (CMPLconst [0] (LoweredHasCPUFeature {s})))
 (Addr {sym} base) => (LEAQ {sym} base)
 (LocalAddr {sym} base _) => (LEAQ {sym} base)
 
index 88c76dd1693eb92753937d6529aa94cb1f946243..201fbf29542f766cc254c8d31e8a0467afe218bc 100644 (file)
@@ -29254,11 +29254,11 @@ func rewriteValueAMD64_OpHasCPUFeature(v *Value) bool {
        b := v.Block
        typ := &b.Func.Config.Types
        // match: (HasCPUFeature {s})
-       // result: (SETNE (CMPQconst [0] (LoweredHasCPUFeature {s})))
+       // result: (SETNE (CMPLconst [0] (LoweredHasCPUFeature {s})))
        for {
                s := auxToSym(v.Aux)
                v.reset(OpAMD64SETNE)
-               v0 := b.NewValue0(v.Pos, OpAMD64CMPQconst, types.TypeFlags)
+               v0 := b.NewValue0(v.Pos, OpAMD64CMPLconst, types.TypeFlags)
                v0.AuxInt = int32ToAuxInt(0)
                v1 := b.NewValue0(v.Pos, OpAMD64LoweredHasCPUFeature, typ.UInt64)
                v1.Aux = symToAux(s)