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:
Michael Munday
2019-02-28 11:51:10 +00:00
parent 92a0ff1e1e
commit 6c9a33b5f7
7 changed files with 308 additions and 9 deletions
+17
View File
@@ -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)")
}
}