1
0
mirror of https://github.com/golang/go synced 2024-11-17 04:55:07 -07:00

cmd/compile: fix PrefetchStreamed builtin implementation on PPC64

This CL fixes encoding of PrefetchStreamed on PPC64 to be consistent
with what is implemented on AMD64 and ARM64 platforms which is
prefetchNTA (prefetch non-temporal access). Looking at the definition
of prefetchNTA, the closest corresponding Touch hint (TH) value to be
used on PPC64 is 16 that states that the address is accessed in a
transient manner. Current usage of TH=8 may cause degraded
performance.

Change-Id: I393bf5a9b971a22f632b3cbfb4fa659062af9a27
Reviewed-on: https://go-review.googlesource.com/c/go/+/390316
Reviewed-by: Paul Murphy <murp@ibm.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Archana R 2022-03-07 01:54:14 -06:00 committed by Paul Murphy
parent e475cf2e70
commit 7b15e297a2
2 changed files with 8 additions and 4 deletions

View File

@ -1479,7 +1479,11 @@
&& clobber(call)
=> (Move [sz] dst src mem)
// Prefetch instructions (aux is option: 0 - DCBT ; 8 - DCBT stream)
// Prefetch instructions (TH specified using aux field)
// For DCBT Ra,Rb,TH, A value of TH indicates:
// 0, hint this cache line will be used soon. (PrefetchCache)
// 16, hint this cache line will not be used for long. (PrefetchCacheStreamed)
// See ISA 3.0 Book II 4.3.2 for more detail. https://openpower.foundation/specifications/isa/
(PrefetchCache ptr mem) => (DCBT ptr mem [0])
(PrefetchCacheStreamed ptr mem) => (DCBT ptr mem [8])
(PrefetchCacheStreamed ptr mem) => (DCBT ptr mem [16])

View File

@ -14140,12 +14140,12 @@ func rewriteValuePPC64_OpPrefetchCacheStreamed(v *Value) bool {
v_1 := v.Args[1]
v_0 := v.Args[0]
// match: (PrefetchCacheStreamed ptr mem)
// result: (DCBT ptr mem [8])
// result: (DCBT ptr mem [16])
for {
ptr := v_0
mem := v_1
v.reset(OpPPC64DCBT)
v.AuxInt = int64ToAuxInt(8)
v.AuxInt = int64ToAuxInt(16)
v.AddArg2(ptr, mem)
return true
}