From: Lynn Boger Date: Mon, 4 Oct 2021 13:00:20 +0000 (-0500) Subject: cmd/compile: fix PPC64.rules to correct failure in issue45344.go with regabi X-Git-Tag: go1.18beta1~1081 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=94323206aee1363471a4ae3b8d40dd4ae7a5cd9c;p=gostls13.git cmd/compile: fix PPC64.rules to correct failure in issue45344.go with regabi 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 Reviewed-by: Cherry Mui Trust: Lynn Boger --- diff --git a/src/cmd/compile/internal/ssa/gen/PPC64.rules b/src/cmd/compile/internal/ssa/gen/PPC64.rules index 4b11e81fa2..0393feb125 100644 --- a/src/cmd/compile/internal/ssa/gen/PPC64.rules +++ b/src/cmd/compile/internal/ssa/gen/PPC64.rules @@ -580,7 +580,7 @@ (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) diff --git a/src/cmd/compile/internal/ssa/rewritePPC64.go b/src/cmd/compile/internal/ssa/rewritePPC64.go index 6127fd262b..450ea861f3 100644 --- a/src/cmd/compile/internal/ssa/rewritePPC64.go +++ b/src/cmd/compile/internal/ssa/rewritePPC64.go @@ -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)