]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: fix PPC64.rules to correct failure in issue45344.go with regabi
authorLynn Boger <laboger@linux.vnet.ibm.com>
Mon, 4 Oct 2021 13:00:20 +0000 (08:00 -0500)
committerLynn Boger <laboger@linux.vnet.ibm.com>
Mon, 4 Oct 2021 15:50:43 +0000 (15:50 +0000)
This changes a rule in PPC64.rules to fix a failure in
test/issue45344.go when regabi is enabled.

Change-Id: I98baf2ae92c766b7276b0f3167b2e6fef37dfe84
Reviewed-on: https://go-review.googlesource.com/c/go/+/353789
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Trust: Lynn Boger <laboger@linux.vnet.ibm.com>

src/cmd/compile/internal/ssa/gen/PPC64.rules
src/cmd/compile/internal/ssa/rewritePPC64.go

index 4b11e81fa29367c175c4876d3ec55d9fc431057a..0393feb125662c93b82f676ee451a0c1aaff55df 100644 (file)
 (Store {t} ptr val mem) && t.Size() == 8 && is64BitFloat(val.Type) => (FMOVDstore ptr val mem)
 (Store {t} ptr val mem) && t.Size() == 8 && is32BitFloat(val.Type) => (FMOVDstore ptr val mem) // glitch from (Cvt32Fto64F x) => x -- type is wrong
 (Store {t} ptr val mem) && t.Size() == 4 && is32BitFloat(val.Type) => (FMOVSstore ptr val mem)
-(Store {t} ptr val mem) && t.Size() == 8 && (is64BitInt(val.Type) || isPtr(val.Type)) => (MOVDstore ptr val mem)
+(Store {t} ptr val mem) && t.Size() == 8 && !is64BitFloat(val.Type) => (MOVDstore ptr val mem)
 (Store {t} ptr val mem) && t.Size() == 4 && is32BitInt(val.Type) => (MOVWstore ptr val mem)
 (Store {t} ptr val mem) && t.Size() == 2 => (MOVHstore ptr val mem)
 (Store {t} ptr val mem) && t.Size() == 1 => (MOVBstore ptr val mem)
index 6127fd262b56a7f95be77cee0c8f2d0964d9c685..450ea861f34450e990378501000a3585ccbf4208 100644 (file)
@@ -16583,14 +16583,14 @@ func rewriteValuePPC64_OpStore(v *Value) bool {
                return true
        }
        // match: (Store {t} ptr val mem)
-       // cond: t.Size() == 8 && (is64BitInt(val.Type) || isPtr(val.Type))
+       // cond: t.Size() == 8 && !is64BitFloat(val.Type)
        // result: (MOVDstore ptr val mem)
        for {
                t := auxToType(v.Aux)
                ptr := v_0
                val := v_1
                mem := v_2
-               if !(t.Size() == 8 && (is64BitInt(val.Type) || isPtr(val.Type))) {
+               if !(t.Size() == 8 && !is64BitFloat(val.Type)) {
                        break
                }
                v.reset(OpPPC64MOVDstore)