mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.simd] cmd/compile: more support for cpufeatures
add hasFeature, also record maximum feature for a function Change-Id: I68dd063aad1c1dc0ef5310a9f5d970c03dd31a0e Reviewed-on: https://go-review.googlesource.com/c/go/+/710695 Reviewed-by: Junyang Shao <shaojunyang@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
be57d94c4c
commit
ba72ee0f30
3 changed files with 7 additions and 0 deletions
|
|
@ -473,6 +473,10 @@ const (
|
|||
CPUsve2
|
||||
)
|
||||
|
||||
func (f CPUfeatures) hasFeature(x CPUfeatures) bool {
|
||||
return f&x == x
|
||||
}
|
||||
|
||||
func (f CPUfeatures) String() string {
|
||||
if f == CPUNone {
|
||||
return "none"
|
||||
|
|
|
|||
|
|
@ -201,6 +201,7 @@ func cpufeatures(f *Func) {
|
|||
}
|
||||
|
||||
b.CPUfeatures = feat
|
||||
f.maxCPUFeatures |= feat // not necessary to refine this estimate below
|
||||
}
|
||||
|
||||
// If the flow graph is irreducible, things can still change on backedges.
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ type Func struct {
|
|||
ABISelf *abi.ABIConfig // ABI for function being compiled
|
||||
ABIDefault *abi.ABIConfig // ABI for rtcall and other no-parsed-signature/pragma functions.
|
||||
|
||||
maxCPUFeatures CPUfeatures // union of all the CPU features in all the blocks.
|
||||
|
||||
scheduled bool // Values in Blocks are in final order
|
||||
laidout bool // Blocks are ordered
|
||||
NoSplit bool // true if function is marked as nosplit. Used by schedule check pass.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue