mirror of
https://github.com/rwinkhart/sys.git
synced 2026-08-30 22:06:37 -04:00
cpu: add CPU features for s390x
Add basic support for IBM Z (s390x) CPU feature (known as 'facilities') detection. Note that some of these features are mandatory when using the Go compiler (for example, ldisp and eimm) but aren't mandatory when using gccgo. Cryptographic function detection is not yet implemented for gccgo. Change-Id: Ic6494d0df0bc1c1ad1713c9ff11ae23fba03d215 Reviewed-on: https://go-review.googlesource.com/c/163003 Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
@@ -55,3 +55,20 @@ func TestPPC64minimalFeatures(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestS390X(t *testing.T) {
|
||||
if runtime.GOARCH != "s390x" {
|
||||
return
|
||||
}
|
||||
if testing.Verbose() {
|
||||
t.Logf("%+v\n", cpu.S390X)
|
||||
}
|
||||
// z/Architecture is mandatory
|
||||
if !cpu.S390X.HasZARCH {
|
||||
t.Error("HasZARCH expected true, got false")
|
||||
}
|
||||
// vector-enhancements require vector facility to be enabled
|
||||
if cpu.S390X.HasVXE && !cpu.S390X.HasVX {
|
||||
t.Error("HasVX expected true, got false (VXE is true)")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user