1// Copyright 2016 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package runtime
6
7import "internal/cpu"
8
9const (
10	_HWCAP_VX = 1 << 11 // vector facility
11)
12
13func archauxv(tag, val uintptr) {
14	switch tag {
15	case _AT_HWCAP:
16		cpu.HWCap = uint(val)
17	}
18}
19
20func osArchInit() {}
21
22func checkS390xCPU() {
23	// Check if the present z-system has the hardware capability to carryout
24	// floating point operations. Check if hwcap reflects CPU capability for the
25	// necessary floating point hardware (HasVX) availability.
26	// Starting with Go1.19, z13 is the minimum machine level for running Go on LoZ
27	if cpu.HWCap&_HWCAP_VX == 0 {
28		print("runtime: This CPU has no floating point hardware, so this program cannot be run. \n")
29		exit(1)
30	}
31}
32